---
title: "Create contract template"
method: POST
path: "/api/v1/contract-templates"
tags: ["contract-templates"]
---

# Create contract template

`POST /api/v1/contract-templates`

Create a new contract template (ABI, bytecode, metadata).

## Headers

- `x-sdk-version` string, required

## Request body

- CreateContractRequestBodyDTO
  - `name` string, required
  - `description` string, required
  - `bytecode` string, required
  - `abi` ContractFunDto[], required
    - `name` string
    - `stateMutability` 'pure' | 'view' | 'nonpayable' | 'payable'
    - `type` 'function' | 'constructor' | 'event' | 'error' | 'fallback' | 'receive', required
    - `inputs` InputOutputDto[], required
      - `name` string, required
      - `description` string
      - `internalType` string
      - `type` string, required
      - `value` object, required
      - `components` ComponentDto[]
        - `name` string, required
        - `description` string
        - `internalType` string
        - `type` string, required
      - `indexed` boolean
    - `outputs` InputOutputDto[]
      - `name` string, required
      - `description` string
      - `internalType` string
      - `type` string, required
      - `value` object, required
      - `components` ComponentDto[]
        - `name` string, required
        - `description` string
        - `internalType` string
        - `type` string, required
      - `indexed` boolean
    - `description` string
    - `anonymous` boolean
  - `longDescription` string
  - `sourceCode` string
  - `type` string
  - `docs` DocsDto
    - `details` string
    - `events` string
    - `kind` 'dev' | 'user', required
    - `methods` MethodDto[], required
      - `name` string, required
      - `description` string
      - `params` object
      - `returns` object
    - `version` string, required
  - `attributes` AttributeDtoContract
    - `useCases` string[]
    - `standards` string[]
    - `auditor` AuditorDto
      - `name` string, required
      - `imageURL` string, required
      - `link` string, required

## Response `200`

Contract template created

- CreateContractResponseDto
  - `contract` CreateContractResultDto
    - `id` string
    - `name` string
    - `description` string
    - `longDescription` string
    - `bytecode` string
    - `sourceCode` string
    - `type` string
    - `docs` object

## Other responses

- `400` — Bad request or validation failed. **Applicable error codes and client messages** The response body contains one of the following error codes and the corresponding client-facing message. | Code | Client message | |------|----------------| | ERR-010 | The request could not be processed. | | ERR-300 | Invalid input provided. |
- `401` — Unauthorized – invalid or missing token. **Applicable error codes and client messages** The response body contains one of the following error codes and the corresponding client-facing message. | Code | Client message | |------|----------------| | ERR-008 | You need to sign in to continue. | | ERR-011 | Your session is invalid or expired. Please sign in again. |
- `403` — Forbidden – insufficient permissions. **Applicable error codes and client messages** The response body contains one of the following error codes and the corresponding client-facing message. | Code | Client message | |------|----------------| | ERR-009 | You don't have permission to do that. | | ERR-410 | Error occurred |
- `409` — Conflict – resource already exists or state conflict. **Applicable error codes and client messages** The response body contains one of the following error codes and the corresponding client-facing message. | Code | Client message | |------|----------------| | ERR-501 | Resource conflict |
- `500` — Internal server error. **Applicable error codes and client messages** The response body contains one of the following error codes and the corresponding client-facing message. | Code | Client message | |------|----------------| | ERR-019 | Something went wrong on our side. | | ERR-999 | An unexpected error occurred. Please try again. |

---

[API](https://skmtc.net/oumla/apis/oumla-core-server.md) · [All operations](https://skmtc.net/oumla/apis/oumla-core-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oumla/oumla-core-server/revisions/2154835230b5/schema)
