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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://developers.fireblocks.com/feedback

```json
{
  "path": "/api-reference/tokenization/link-a-contract",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Link a contract

> Link an a contract



## OpenAPI

````yaml https://docs.fireblocks.com/api/v1/swagger.yaml post /tokenization/tokens/link
openapi: 3.0.0
info:
  title: Fireblocks API
  description: >
    Fireblocks provides a suite of applications to manage digital asset
    operations and a complete development platform to build your business on the
    blockchain.


    - Visit our website for more information: [Fireblocks
    Website](https://fireblocks.com)

    - Visit our developer docs: [Fireblocks
    DevPortal](https://developers.fireblocks.com)
  version: 1.6.2
  contact:
    email: developers@fireblocks.com
servers:
  - url: https://api.fireblocks.io/v1
    description: Fireblocks Production Environment Base URL
  - url: https://sandbox-api.fireblocks.io/v1
    description: Fireblocks Sandbox Environment Base URL
security: []
paths:
  /tokenization/tokens/link:
    post:
      tags:
        - Tokenization
      summary: Link a contract
      description: Link an a contract
      operationId: link
      parameters:
        - $ref: '#/components/parameters/X-Idempotency-Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenLinkRequestDto'
      responses:
        '200':
          description: Token linked successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenLinkDto'
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenLinkDto'
        '404':
          description: Could not find the underlying contract to link to
        '409':
          description: Token link for {refId} already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenLinkExistsHttpError'
        default:
          $ref: '#/components/responses/Error'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response: Promise<FireblocksResponse<TokenLinkDto>> =
            fireblocks.tokenization.link(tokenizationApiLinkRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<TokenLinkDto>> response =
            fireblocks.tokenization().link(tokenLinkRequestDto, idempotencyKey);
        - lang: Python
          source: >-
            response = fireblocks.tokenization.link(token_link_request_dto,
            idempotency_key);
components:
  parameters:
    X-Idempotency-Key:
      name: Idempotency-Key
      in: header
      description: >-
        A unique identifier for the request. If the request is sent multiple
        times with the same idempotency key, the server will return the same
        response as the first request. The idempotency key is valid for 24
        hours.
      required: false
      schema:
        type: string
  schemas:
    TokenLinkRequestDto:
      type: object
      properties:
        type:
          enum:
            - FUNGIBLE_TOKEN
            - NON_FUNGIBLE_TOKEN
            - TOKEN_UTILITY
            - TOKEN_EXTENSION
          type: string
          description: The type of token being linked
        refId:
          type: string
          description: "The Fireblocks' token link reference id. For example, 'BQ5R_BDESC_ABC' if it's a fungible \n\t\t\t\t\tasset"
          example: USDC_ETH_TEST3_1XF5
        displayName:
          type: string
          description: The token display name
          example: My Simple ERC20 Token
        baseAssetId:
          type: string
          description: The blockchain base assetId
          example: ETH_TEST3
        contractAddress:
          type: string
          description: The contract's onchain address
          example: '0xC2c4e1Db41F0bB97996D0eD0542D2170d146FB66'
      required:
        - type
    TokenLinkDto:
      type: object
      properties:
        id:
          type: string
          description: The token link id
          example: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb
        status:
          enum:
            - PENDING
            - COMPLETED
          type: string
          description: The token status
          example: COMPLETED
        type:
          enum:
            - FUNGIBLE_TOKEN
            - NON_FUNGIBLE_TOKEN
            - TOKEN_UTILITY
            - TOKEN_EXTENSION
          type: string
          description: The type of token
          example: NON_FUNGIBLE_TOKEN
        refId:
          type: string
          description: The Fireblocks' reference id
          example: BQ5R_MY_TOKEN
        displayName:
          type: string
          description: >-
            The token display name. If was not provided, would be taken from the
            contract template
          example: My Simple ERC20 Token
        tokenMetadata:
          description: The token's metadata
          oneOf:
            - $ref: '#/components/schemas/AssetMetadataDto'
            - $ref: '#/components/schemas/CollectionMetadataDto'
            - $ref: '#/components/schemas/ContractMetadataDto'
      required:
        - id
        - status
    TokenLinkExistsHttpError:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
          description: HTTP status code
          example: 409
        message:
          type: string
          description: Error message
        error:
          type: string
          description: Short description of the HTTP error
          example: Conflict
    AssetMetadataDto:
      type: object
      properties:
        assetId:
          type: string
          description: The Fireblocks` asset id
          example: BQ5R_MY_TOKEN
        name:
          type: string
          description: The name of the token
          example: MyToken
        symbol:
          type: string
          description: The symbol of the token
          example: MYT
        networkProtocol:
          type: string
          description: The network protocol of the token
          example: ETH
        totalSupply:
          type: string
          description: The total supply of the token
          example: '1000000000000000'
        holdersCount:
          type: number
          description: The number of holders of the token
          example: '6'
        type:
          type: string
          description: The type of the token
          example: ERC20
        contractAddress:
          type: string
          description: The address of the token contract
          example: '0x1234567890abcdef1234567890abcdef12345678'
        issuerAddress:
          type: string
          description: In case of Stellar or Ripple, the address of the issuer of the token
          example: rGyXjc5d7s17vvt3NtKKascvJrnSxV21kQ
        testnet:
          type: boolean
          description: Is it deployed on testnet or to mainnet
          example: true
        blockchain:
          type: string
          description: The blockchain native asset id which the token is deployed on
          example: ETH_TEST5
        decimals:
          type: number
          description: The number of decimals of the token
          example: 18
        vaultAccountId:
          type: string
          description: >-
            The id of the vault account that initiated the request to issue the
            token. Will be empty if token was issued outside of Fireblocks.
          example: '0'
      required:
        - assetId
    CollectionMetadataDto:
      type: object
      properties:
        fbCollectionId:
          type: string
          description: Fireblocks collection id
          example: 911fe739f0d4d123c98fd366c3bed35c6e30c00e
        name:
          type: string
          description: Collection name
          example: Rarible
        symbol:
          type: string
          description: Collection symbol
          example: RARI
        standard:
          type: string
          description: Collection contract standard
          example:
            - ERC721
            - ERC1155
            - FA2
        blockchainDescriptor:
          type: string
          description: Collection's blockchain
          example: ETH
        contractAddress:
          type: string
          description: Collection contract address
          example: '0x1723017329a804564bC8d215496C89eaBf1F3211'
      required:
        - fbCollectionId
        - blockchainDescriptor
    ContractMetadataDto:
      type: object
      properties:
        id:
          type: string
          description: The deployed contract ID
          example: fbfbfbfb-fbfb-fbfb-fbfb-fbfbfbfbfbfb
        blockchainId:
          type: string
          description: The blockchain ID
          example: B7QG017M
        contractAddress:
          type: string
          description: The address of the token contract
          example: '0x1234567890abcdef1234567890abcdef12345678'
        contractTemplateId:
          type: string
          description: The contract template ID
          example: b70701f4-d7b1-4795-a8ee-b09cdb5b850d
        vaultAccountId:
          type: string
          description: The vault account ID that initiated the request to issue the token
          example: '0'
      required:
        - id
        - blockchainId
        - contractAddress
        - contractTemplateId
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
  responses:
    Error:
      description: Error Response
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSchema'
  headers:
    X-Request-ID:
      schema:
        type: string
      description: >-
        Unique ID correlated to the API request. Please provide it in any
        support ticket you create or on Github issues related to Fireblocks SDKs

````