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

# CreateToken



## OpenAPI

````yaml sequence-metadata.json post /rpc/Collections/CreateToken
openapi: 3.0.0
info:
  title: Sequence Metadata
  version: 0.0.1
servers:
  - url: https://metadata.sequence.app/
    description: Metadata
security: []
tags:
  - name: public
    description: >-
      Endpoints accessible by passing your project-access-key in the header.
      This is injected whenever you login automatically.
  - name: secret
    description: >-
      Endpoints that require a Sequence service token intended to be secret. You
      can manually generate one on Sequence Builder and pass it as a Bearer
      Token.
paths:
  /rpc/Collections/CreateToken:
    post:
      tags:
        - secret
      summary: CreateToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Collections_CreateToken_Request'
            examples:
              '0':
                value:
                  projectId: 30957
                  collectionId: 888
                  private: false
                  token:
                    tokenId: '200'
                    name: Eclipse Dragon
                    description: >-
                      Forged from starlight and shadows, the Eclipse Dragon
                      emerges only during celestial alignments. Its obsidian
                      scales shimmer with constellations, and its breath holds
                      the power to bend time and space. Legends say that those
                      who possess its essence gain unparalleled wisdom—though at
                      the cost of fleeting moments lost to the void. Will you
                      dare wield its mystic force?
                    properties:
                      element: Shadow and Starlight
                      rarity: Legendary
                      alignment: Celestial
                      age: Ancient
                      size: Massive
                      breath_power: Time Distortion
                      temperament: Mysterious
                      constellations_on_scales: 42
                      last_seen: During the Last Solar Eclipse
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Collections_CreateToken_Response'
              examples:
                '0':
                  value:
                    token:
                      tokenId: '200'
                      name: Eclipse Dragon
                      description: >-
                        Forged from starlight and shadows, the Eclipse Dragon
                        emerges only during celestial alignments. Its obsidian
                        scales shimmer with constellations, and its breath holds
                        the power to bend time and space. Legends say that those
                        who possess its essence gain unparalleled wisdom—though
                        at the cost of fleeting moments lost to the void. Will
                        you dare wield its mystic force?
                      image: ''
                      properties:
                        age: Ancient
                        alignment: Celestial
                        breath_power: Time Distortion
                        constellations_on_scales: 42
                        element: Shadow and Starlight
                        last_seen: During the Last Solar Eclipse
                        rarity: Legendary
                        size: Massive
                        temperament: Mysterious
                      attributes: null
                      updatedAt: '0001-01-01T00:00:00Z'
                    assets: null
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcEndpoint'
                  - $ref: '#/components/schemas/ErrorWebrpcRequestFailed'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRoute'
                  - $ref: '#/components/schemas/ErrorWebrpcBadMethod'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRequest'
                  - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
                  - $ref: '#/components/schemas/ErrorWebrpcStreamLost'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorPermissionDenied'
                  - $ref: '#/components/schemas/ErrorSessionExpired'
                  - $ref: '#/components/schemas/ErrorMethodNotFound'
                  - $ref: '#/components/schemas/ErrorRequestConflict'
                  - $ref: '#/components/schemas/ErrorGeoblocked'
                  - $ref: '#/components/schemas/ErrorTimeout'
                  - $ref: '#/components/schemas/ErrorInvalidArgument'
                  - $ref: '#/components/schemas/ErrorRequiredArgument'
                  - $ref: '#/components/schemas/ErrorQueryFailed'
                  - $ref: '#/components/schemas/ErrorValidationFailed'
                  - $ref: '#/components/schemas/ErrorRateLimited'
                  - $ref: '#/components/schemas/ErrorNotFound'
                  - $ref: '#/components/schemas/ErrorProjectNotFound'
                  - $ref: '#/components/schemas/ErrorChainNotFound'
                  - $ref: '#/components/schemas/ErrorTokenDirectoryDisabled'
        5XX:
          description: Server error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcBadResponse'
                  - $ref: '#/components/schemas/ErrorWebrpcServerPanic'
                  - $ref: '#/components/schemas/ErrorWebrpcInternalError'
                  - $ref: '#/components/schemas/ErrorFail'
      security:
        - BearerAuth:
            - >-
              eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiMHhiZWU3NGU3ZmZkNzdkMThhZDJhOTg2ODEyZGE2MTc5ODk0MDY4ODZjIiwiaWF0IjoxNzQxNjg3NDg4LCJwcm9qZWN0IjoxNjgxNX0.LvTwKf0T6IBK9HuRFboXCNh2YY9d6EwDoQAlGYC80KQ
components:
  schemas:
    Collections_CreateToken_Request:
      type: object
      properties:
        projectId:
          type: number
        collectionId:
          type: number
        token:
          $ref: '#/components/schemas/TokenMetadata'
        private:
          type: boolean
    Collections_CreateToken_Response:
      type: object
      properties:
        token:
          $ref: '#/components/schemas/TokenMetadata'
        assets:
          type: array
          description: '[]Asset'
          items:
            $ref: '#/components/schemas/Asset'
    ErrorWebrpcEndpoint:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcEndpoint
        code:
          type: number
          example: 0
        msg:
          type: string
          example: endpoint error
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcRequestFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcRequestFailed
        code:
          type: number
          example: -1
        msg:
          type: string
          example: request failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadRoute:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRoute
        code:
          type: number
          example: -2
        msg:
          type: string
          example: bad route
        cause:
          type: string
        status:
          type: number
          example: 404
    ErrorWebrpcBadMethod:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadMethod
        code:
          type: number
          example: -3
        msg:
          type: string
          example: bad method
        cause:
          type: string
        status:
          type: number
          example: 405
    ErrorWebrpcBadRequest:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRequest
        code:
          type: number
          example: -4
        msg:
          type: string
          example: bad request
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcClientDisconnected:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcClientDisconnected
        code:
          type: number
          example: -8
        msg:
          type: string
          example: client disconnected
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcStreamLost:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcStreamLost
        code:
          type: number
          example: -9
        msg:
          type: string
          example: stream lost
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnauthorized:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unauthorized
        code:
          type: number
          example: 1000
        msg:
          type: string
          example: Unauthorized access
        cause:
          type: string
        status:
          type: number
          example: 401
    ErrorPermissionDenied:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: PermissionDenied
        code:
          type: number
          example: 1001
        msg:
          type: string
          example: Permission denied
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorSessionExpired:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: SessionExpired
        code:
          type: number
          example: 1002
        msg:
          type: string
          example: Session expired
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorMethodNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: MethodNotFound
        code:
          type: number
          example: 1003
        msg:
          type: string
          example: Method not found
        cause:
          type: string
        status:
          type: number
          example: 404
    ErrorRequestConflict:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: RequestConflict
        code:
          type: number
          example: 1004
        msg:
          type: string
          example: Conflict with target resource
        cause:
          type: string
        status:
          type: number
          example: 409
    ErrorGeoblocked:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Geoblocked
        code:
          type: number
          example: 1006
        msg:
          type: string
          example: Geoblocked region
        cause:
          type: string
        status:
          type: number
          example: 451
    ErrorTimeout:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Timeout
        code:
          type: number
          example: 2000
        msg:
          type: string
          example: Request timed out
        cause:
          type: string
        status:
          type: number
          example: 408
    ErrorInvalidArgument:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: InvalidArgument
        code:
          type: number
          example: 2001
        msg:
          type: string
          example: Invalid argument
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorRequiredArgument:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: RequiredArgument
        code:
          type: number
          example: 2002
        msg:
          type: string
          example: Required argument missing
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorQueryFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: QueryFailed
        code:
          type: number
          example: 2003
        msg:
          type: string
          example: Query failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorValidationFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: ValidationFailed
        code:
          type: number
          example: 2004
        msg:
          type: string
          example: Validation failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorRateLimited:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: RateLimited
        code:
          type: number
          example: 2005
        msg:
          type: string
          example: Rate limited
        cause:
          type: string
        status:
          type: number
          example: 429
    ErrorNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: NotFound
        code:
          type: number
          example: 3000
        msg:
          type: string
          example: Resource not found
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorProjectNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: ProjectNotFound
        code:
          type: number
          example: 3002
        msg:
          type: string
          example: Project not found
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorChainNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: ChainNotFound
        code:
          type: number
          example: 3003
        msg:
          type: string
          example: Chain not found
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorTokenDirectoryDisabled:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: TokenDirectoryDisabled
        code:
          type: number
          example: 4001
        msg:
          type: string
          example: Token Directory is disabled
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadResponse:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadResponse
        code:
          type: number
          example: -5
        msg:
          type: string
          example: bad response
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcServerPanic:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcServerPanic
        code:
          type: number
          example: -6
        msg:
          type: string
          example: server panic
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcInternalError:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcInternalError
        code:
          type: number
          example: -7
        msg:
          type: string
          example: internal error
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorFail:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Fail
        code:
          type: number
          example: 1005
        msg:
          type: string
          example: Request Failed
        cause:
          type: string
        status:
          type: number
          example: 500
    TokenMetadata:
      type: object
      required:
        - tokenId
        - name
        - attributes
        - status
      properties:
        tokenId:
          type: string
        name:
          type: string
        description:
          type: string
        image:
          type: string
        video:
          type: string
        audio:
          type: string
        properties:
          type: object
          description: map<string,any>
          additionalProperties:
            type: object
        attributes:
          type: array
          description: '[]map<string,any>'
          items:
            type: object
            description: map<string,any>
            additionalProperties:
              type: object
        imageData:
          type: string
        externalUrl:
          type: string
        backgroundColor:
          type: string
        animationUrl:
          type: string
        decimals:
          type: number
        updatedAt:
          type: string
        assets:
          type: array
          description: '[]Asset'
          items:
            $ref: '#/components/schemas/Asset'
        status:
          $ref: '#/components/schemas/ResourceStatus'
        queuedAt:
          type: string
        lastFetched:
          type: string
    Asset:
      type: object
      required:
        - id
        - collectionId
        - metadataField
      properties:
        id:
          type: number
        collectionId:
          type: number
        tokenId:
          type: string
        url:
          type: string
        metadataField:
          type: string
        filename:
          type: string
        filesize:
          type: number
        mimeType:
          type: string
        width:
          type: number
        height:
          type: number
        updatedAt:
          type: string
    ResourceStatus:
      type: string
      description: Represented as uint32 on the server side
      enum:
        - NOT_AVAILABLE
        - STALE
        - AVAILABLE
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Secret JWT token for authenticating requests obtained from Sequence
        Builder - should not be exposed publicly.

````