---
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. |

## Changes

- **2026-04-21** `bdac7e47d1c2` — 35 warning
  - added the new `ERR_147` enum value to the `allOf[#/components/schemas/ApiErrorResponseDto]/code` response property for the response status `400`
  - added the new `ERR_147` enum value to the `allOf[#/components/schemas/ApiErrorResponseDto]/code` response property for the response status `401`
  - added the new `ERR_147` enum value to the `allOf[#/components/schemas/ApiErrorResponseDto]/code` response property for the response status `403`
  - added the new `ERR_147` enum value to the `allOf[#/components/schemas/ApiErrorResponseDto]/code` response property for the response status `409`
  - …31 more
- **2026-03-13** `86f37d72f0a0` — 42 breaking, 19 warning, 13 info
  - the `header` request parameter `x-sdk-version` became required
  - added `#/components/schemas/AttributeDtoContract` to the `attributes` request property `allOf` list
  - added `#/components/schemas/ContractFunDto` to the `abi/items/` request property `allOf` list
  - added `#/components/schemas/DocsDto` to the `docs` request property `allOf` list
  - …70 more
- **2026-01-31** `13aade479509` — 1 breaking, 8 warning, 12 info
  - removed the success response with the status `201`
  - removed the request property `attributes/auditor`
  - removed the request property `attributes/standards`
  - removed the request property `attributes/useCases`
  - …17 more

[Change history](https://skmtc.dev/oumla/apis/oumla-core-server/changes/api/v1/contract-templates/post.md)

---

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