> ## 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 MCP Token

> Create a short-lived token to connect your agent to the Supernova MCP for a given user.



## OpenAPI

````yaml POST /mcp/tokens/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:
  /mcp/tokens/create:
    post:
      summary: Create MCP Token
      description: >-
        Create a short-lived token to connect your agent to the Supernova MCP
        for a given user.
      operationId: mcp_token_create
      requestBody:
        description: >-
          The user to scope the token to, and optionally its lifetime and phone
          number.
        content:
          application/json:
            schema:
              type: object
              properties:
                external_user_id:
                  type: string
                  description: Your unique identifier for the user.
                  example: 123abc
                  maxLength: 256
                expires_in:
                  type: integer
                  minimum: 60
                  maximum: 2592000
                  default: 86400
                  description: >-
                    Seconds until the token expires. Defaults to 1 day; maximum
                    30 days.
                  example: 3600
                phone_number:
                  type: string
                  description: >-
                    User's phone number in E.164 format. Must be a valid US or
                    Canadian phone number. Required for the Supernova MCP to
                    create sign-in links (see [Knot Zero
                    links](/api-reference/products/card-switcher/create-knot-zero-link)).
                  example: '+12025550123'
              required:
                - external_user_id
            examples:
              CreateToken:
                summary: Token for a user
                value:
                  external_user_id: 123abc
                  expires_in: 3600
              CreateTokenWithPhone:
                summary: Token that can create Knot Zero links
                value:
                  external_user_id: 123abc
                  expires_in: 3600
                  phone_number: '+12025550123'
      responses:
        '200':
          description: Successful request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: The Supernova MCP token. Treat it as a secret.
                    example: sn_mcp_wyLZTDc3_HzXo5lcRkkbZpnmFfg5DU63nHnUsyPQbi0
                  expires_at:
                    type: string
                    format: date-time
                    description: When the token expires, in ISO 8601 UTC.
                    example: '2026-10-21T15:30:00Z'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                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.
                ExpiresInTooLong:
                  summary: expires_in exceeds 30 days
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The expires in field must not be greater than 2592000.
                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.
        '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.
        '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
            - REQUEST_LOG_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
            - REQUEST_LOG_NOT_FOUND
            - REQUEST_LOG_QUERY_TIMEOUT
          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.