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

# Create Knot Zero Link

> Create a Knot Zero link for a single user.



## OpenAPI

````yaml POST /zero-link/create
openapi: 3.1.0
info:
  title: Knot API
  description: An API to interact with the Knot merchant connectivity platform.
  version: 1.0.0
servers:
  - url: https://development.knotapi.com
    description: Development server
security:
  - basicAuth: []
paths:
  /zero-link/create:
    post:
      summary: Create Knot Zero Link
      description: Create a Knot Zero link for a single user.
      operationId: clip_link_create
      requestBody:
        description: The parameters to include in the user's link.
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - card_switcher
                  description: Product to associate the link with.
                  example: card_switcher
                phone_number:
                  type: string
                  description: >-
                    User's phone number in E.164 format. Must be a valid US or
                    Canadian phone number. Knot sends a one-time code to this
                    number to verify the user each time they open the link.
                  example: '+12025550123'
                external_user_id:
                  type: string
                  description: Your unique identifier for the user.
                  example: 123abc
                  maxLength: 256
                card_id:
                  type: string
                  description: Your unique identifier for the user's card.
                  example: 81n9al10a0ayn13
                  maxLength: 256
              required:
                - type
                - phone_number
                - external_user_id
                - card_id
            examples:
              CreateLink:
                summary: Create link
                value:
                  type: card_switcher
                  phone_number: '+12025550123'
                  external_user_id: 123abc
                  card_id: 81n9al10a0ayn13
      responses:
        '200':
          description: Successful request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  link:
                    type: string
                    description: >-
                      The Knot Zero link for the user: your base link with a
                      unique token appended that references the user's stored
                      parameters. Share it as a URL or encode it as a QR code.
                      The link can be opened any number of times, with a new
                      one-time code each time, and expires after 1 year. It
                      stops working earlier if you create a new link for the
                      same user and card, or revoke it.
                    example: >-
                      https://clip.knotapi.com/switch?token=example_knot_zero_token_1xxxxxxxxxxxxxxxxxx
                  token:
                    type: string
                    description: >-
                      The unique token in `link`, returned separately so you
                      don't need to parse it from the link.
                    example: example_knot_zero_token_1xxxxxxxxxxxxxxxxxx
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                TypeRequired:
                  summary: type is missing
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The type field is required.
                PhoneNumberRequired:
                  summary: phone_number is missing
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The phone number field is required.
                InvalidPhoneNumber:
                  summary: Phone number is invalid
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The phone number format is invalid.
                UnsupportedPhoneNumber:
                  summary: Phone number isn't a valid US or Canadian number
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: >-
                      The phone number must be a valid number in a supported
                      country.
                ExternalUserIdRequired:
                  summary: external_user_id is missing
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The external user id field is required.
                CardIdRequired:
                  summary: card_id is missing
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The card id field is required.
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AuthFailed:
                  summary: Auth failed
                  value:
                    error_type: INVALID_INPUT
                    error_code: INVALID_API_KEYS
                    error_message: Invalid client_id or secret provided.
        '403':
          description: Forbidden request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NoAccess:
                  summary: No access
                  value:
                    error_type: INVALID_REQUEST
                    error_code: NO_ACCESS
                    error_message: >-
                      Knot Zero is not enabled. Please contact Knot for access
                      to this endpoint.
        '429':
          description: Too many requests. Limited to 600 requests per minute per client.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                RateLimited:
                  summary: Rate limited
                  value:
                    error_type: RATE_LIMIT_ERROR
                    error_code: TOO_MANY_REQUESTS
                    error_message: >-
                      Rate limit exceeded. Please retry after the time indicated
                      in the Retry-After header.
                    retry_after: 42
components:
  schemas:
    Error:
      type: object
      properties:
        error_type:
          type: string
          description: Type of error.
          enum:
            - INVALID_INPUT
            - INVALID_REQUEST
            - USER_ERROR
            - SESSION_ERROR
            - MERCHANT_ACCOUNT_ERROR
            - MERCHANT_ERROR
            - SUBSCRIPTION_ERROR
            - TRANSACTION_ERROR
            - CART_ERROR
            - WEBHOOK_ENDPOINT_ERROR
          example: INVALID_REQUEST
        error_code:
          type: string
          description: Error code.
          enum:
            - INVALID_API_KEYS
            - INVALID_FIELD
            - INVALID_JWE
            - INVALID_CURSOR_FORMAT
            - USER_NOT_FOUND
            - MERCHANT_ACCOUNT_NOT_FOUND
            - MERCHANT_ACCOUNT_DISCONNECTED
            - SESSION_NOT_FOUND
            - EXTEND_NOT_SUPPORTED
            - MERCHANT_UNAVAILABLE
            - NO_ACCESS
            - TRANSACTION_NOT_FOUND
            - NO_TRANSACTIONS
            - SUBSCRIPTION_NOT_FOUND
            - CANCELLABLE_SUBSCRIPTION_NOT_FOUND
            - MULTIPLE_CANCELLABLE_SUBSCRIPTIONS_FOUND
            - ONGOING_OPERATION
            - CART_NOT_FOUND
            - FULFILLMENT_NOT_FOUND
            - INVALID_ACCESS_TOKEN
            - INSUFFICIENT_SCOPE
            - INSUFFICIENT_ROLE
            - WEBHOOK_ENDPOINT_NOT_FOUND
            - WEBHOOK_ENDPOINT_LIMIT_REACHED
            - WEBHOOK_ENDPOINT_ALREADY_EXISTS
            - RATE_LIMIT_EXCEEDED
            - ENVIRONMENT_MISMATCH
          example: INVALID_FIELD
        error_message:
          type: string
          description: Detailed error message.
          example: The limit may not be greater than 10.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication header of the form `Basic <encoded-value>`, where
        `<encoded-value>` is the base64-encoded string `username:password`. Use
        your `client_id` as the `username` and your `secret` as the `password`
        value.

````

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