> ## Documentation Index
> Fetch the complete documentation index at: https://docs.circuit.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Check a link

> Returns the link's status. Call it every 2 seconds after opening the link. Once `status` is `approved`, `permit` holds the user's permit encrypted to your key; decrypt it and store it like an access token. Needs no permit.



## OpenAPI

````yaml /partner-openapi.gen.json get /partner/v0.1/links/{link_id}
openapi: 3.1.0
info:
  title: Circuit partner API
  version: '0.1'
servers:
  - url: https://api.circuit.org
security: []
paths:
  /partner/v0.1/links/{link_id}:
    get:
      summary: Check a link
      description: >-
        Returns the link's status. Call it every 2 seconds after opening the
        link. Once `status` is `approved`, `permit` holds the user's permit
        encrypted to your key; decrypt it and store it like an access token.
        Needs no permit.
      operationId: getLink
      parameters:
        - name: link_id
          in: path
          required: true
          example: lnk_9c9915b3-1f0e-4b7a-8d2c-3e5f6a7b8c9d
          schema:
            type: string
            examples:
              - lnk_9c9915b3-1f0e-4b7a-8d2c-3e5f6a7b8c9d
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: >-
                  A page where the user approves your app. Once they do, it
                  holds their permit.
                type: object
                properties:
                  id:
                    description: The link's id, starting with `lnk_`.
                    type: string
                  url:
                    description: >-
                      Open this in a real browser so the user can sign in, pick
                      wallets and approve.
                    type: string
                  status:
                    $ref: '#/components/schemas/LinkStatus'
                  permit:
                    description: >-
                      The user's permit, encrypted to your public key, once
                      `status` is `approved`. It is base64url of a 32-byte
                      ephemeral X25519 public key, a 12-byte IV and the
                      AES-256-GCM ciphertext. Null until then.
                    type:
                      - string
                      - 'null'
                  expires_at:
                    $ref: '#/components/schemas/Timestamp'
                    description: When the link expires, five minutes after it was created.
                required:
                  - id
                  - url
                  - status
                  - expires_at
        default:
          description: Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerFailure'
      security: []
components:
  schemas:
    LinkStatus:
      oneOf:
        - description: The user has not approved yet.
          type: string
          const: waiting
        - description: The user approved. `permit` holds their permit.
          type: string
          const: approved
        - description: Five minutes passed without approval. Create a new link.
          type: string
          const: expired
    Timestamp:
      type: string
      format: date-time
    PartnerFailure:
      description: >-
        A failed call. Handle it by HTTP status and `code`, and show `error` to
        the user.
      type: object
      properties:
        error:
          description: A message you can show the user.
          type: string
        code:
          description: >-
            A stable code such as `BAD_REQUEST`, `NOT_FOUND`, `CONFLICT` or
            `UNAUTHORIZED`. New codes can appear.
          type: string
      required:
        - error
        - code

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.