---
title: "Upload contract template"
method: POST
path: "/tokenization/templates"
tags: ["Contract Templates"]
---

# Upload contract template

`POST /tokenization/templates`

## Request

- Base URL: `https://api.fireblocks.io/v1`
- URL: `https://api.fireblocks.io/v1/tokenization/templates`
- Auth: none declared
- TypeScript: <https://skmtc.dev/fireblocks/apis/fireblocks-api/docs/tokenization/templates/post.ts> (a function with typed inputs; its response is checked against the schema)

Upload a new contract template. This contract template will be available for the workspace

## Headers

- `Idempotency-Key` string

## Request body

- ContractUploadRequest
  - `name` string, required: The name of the contract template
  - `description` string, required: A short description of the contract template
  - `longDescription` string: A full description of the contract template. May contain to break the lines
  - `bytecode` string, required: The compiled artifact of this smart contract. Used for deployment of this contract template
  - `sourcecode` string: The source code of the contract. Optional.
  - `type` 'FUNGIBLE_TOKEN' | 'NON_FUNGIBLE_TOKEN' | 'NON_TOKEN' | 'TOKEN_EXTENSION' | 'TOKEN_UTILITY', required: The type of the contract template
  - `docs` ContractDoc
    - `details` string: A description of the contract
    - `events` string: A description of the contract`s events
    - `kind` string, required: Is it devdoc or userdoc
    - `methods` object, required: The description of the contract functions
    - `version` number, required: The version of the contract
  - `abi` AbiFunction[], required: The abi of the contract template. Necessary for displaying and for after deployment encoding
    - `name` string: The name of the contract function as it appears in the ABI
    - `stateMutability` 'pure' | 'view' | 'nonpayable' | 'payable': The state mutability of the contract function as it appears in the ABI
    - `type` 'constructor' | 'function' | 'error' | 'event' | 'receive' | 'fallback', required: The type of the function
    - `inputs` Parameter[]: The parameters that this function/constructor posses
      - `name` string, required: The name of the parameter as it appears in the ABI
      - `description` string: A description of the parameter, fetched from the devdoc of this contract
      - `internalType` string: The internal type of the parameter as it appears in the ABI
      - `type` string, required: The type of the parameter as it appears in the ABI
      - `components` Parameter[]
    - `outputs` Parameter[]: The parameters that this 'read' function returns
      - `name` string, required: The name of the parameter as it appears in the ABI
      - `description` string: A description of the parameter, fetched from the devdoc of this contract
      - `internalType` string: The internal type of the parameter as it appears in the ABI
      - `type` string, required: The type of the parameter as it appears in the ABI
      - `components` Parameter[]
    - `description` string: The documentation of this function (if has any)
  - `attributes` ContractAttributes
    - `useCases` string[]
    - `standards` string[]: Token standards implemented by the contract (e.g. ERC-20, ERC-1400). Not returned for templates that do not follow ERC token standards, such as non-EVM templates (e.g. Stellar, Solana Token 2022)
    - `auditor` AuditorData
      - `name` string, required
      - `imageURL` string, required
      - `link` string, required
  - `protocol` 'ETH' | 'SOL': The protocol that the template will be used for

## Response `201`

Contract was uploaded successfully

- ContractTemplateDto
  - `id` string, required: The unique identifier of the contract template
  - `name` string, required: The name of the contract template
  - `description` string, required: A short description of the contract template
  - `longDescription` string: A full description of the contract template. May contain to break the lines
  - `abi` AbiFunction[], required: The abi of the contract template. Necessary for displaying and for after deployment encoding
    - `name` string: The name of the contract function as it appears in the ABI
    - `stateMutability` 'pure' | 'view' | 'nonpayable' | 'payable': The state mutability of the contract function as it appears in the ABI
    - `type` 'constructor' | 'function' | 'error' | 'event' | 'receive' | 'fallback', required: The type of the function
    - `inputs` Parameter[]: The parameters that this function/constructor posses
      - `name` string, required: The name of the parameter as it appears in the ABI
      - `description` string: A description of the parameter, fetched from the devdoc of this contract
      - `internalType` string: The internal type of the parameter as it appears in the ABI
      - `type` string, required: The type of the parameter as it appears in the ABI
      - `components` Parameter[]
    - `outputs` Parameter[]: The parameters that this 'read' function returns
      - `name` string, required: The name of the parameter as it appears in the ABI
      - `description` string: A description of the parameter, fetched from the devdoc of this contract
      - `internalType` string: The internal type of the parameter as it appears in the ABI
      - `type` string, required: The type of the parameter as it appears in the ABI
      - `components` Parameter[]
    - `description` string: The documentation of this function (if has any)
  - `attributes` ContractAttributes
    - `useCases` string[]
    - `standards` string[]: Token standards implemented by the contract (e.g. ERC-20, ERC-1400). Not returned for templates that do not follow ERC token standards, such as non-EVM templates (e.g. Stellar, Solana Token 2022)
    - `auditor` AuditorData
      - `name` string, required
      - `imageURL` string, required
      - `link` string, required
  - `docs` ContractDoc
    - `details` string: A description of the contract
    - `events` string: A description of the contract`s events
    - `kind` string, required: Is it devdoc or userdoc
    - `methods` object, required: The description of the contract functions
    - `version` number, required: The version of the contract
  - `owner` string: The workspace id of the owner of this contract template. If it's a private contract, only this workspace will be allowed to deploy it
  - `vendor` VendorDto
    - `id` string, required: The unique identifier of the vendor of this contract template
    - `name` string, required: The name of the vendor of this contract template
  - `isPublic` boolean, required: Is this a contract that is viewable by all fireblocks's users or is it visible only for this workspace
  - `canDeploy` boolean: True if the workspace allowed to deploy this contract, false otherwise
  - `type` 'FUNGIBLE_TOKEN' | 'NON_FUNGIBLE_TOKEN' | 'NON_TOKEN' | 'TOKEN_EXTENSION' | 'TOKEN_UTILITY': The type of the contract template
  - `implementationContractId` string
  - `initializationPhase` 'ON_DEPLOYMENT' | 'POST_DEPLOYMENT', required

## Other responses

- `default`: Error Response

---

[API](https://skmtc.dev/fireblocks/apis/fireblocks-api.md) - [All operations](https://skmtc.dev/fireblocks/apis/fireblocks-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fireblocks/apis/fireblocks-api/revisions/4eba9965659a?raw)
