---
title: "Create Contract In Registry"
method: POST
path: "/registries/{registry_id}/contracts/"
tags: ["CONTRACT"]
deprecated: true
---

# Create Contract In Registry

`POST /registries/{registry_id}/contracts/`

> **Deprecated.**

Create a contract in the registry and database.
1. Checks if the contract already exists in the registry.
2. Validates the contract. If invalid, raise exception
3. If it does not exist, creates the contract in the registry.
4. If it exists and is same do nothing. Else create a new version.


:param db: The database session for accessing the database.
:param contract_request: The contract creation request containing the contract definition and other metadata.
:param tenant: The tenant object for the tenant associated with the request.
:param registry: The registry the contract is being created in.
:param auth: The authorization token for the request.
:return: A contract creation response containing the contract ID, version, and a message.

## Path parameters

- `registry_id` integer, required

## Request body

- ContractCreationRequest
  - `name` string, required
  - `data_store_id` integer, required
  - `fqn` object, required
  - `contract_value` string, required
  - `raise_on_warnings` boolean

## Response `200`

Successful Response

- ContractCreationResponse
  - `id` integer, required
  - `name` string, required
  - `contract_location` string, required
  - `registry_name` string, required
  - `message` string, required
  - `version` string, required

## Other responses

- `400` — Not supported for public user
- `403` — Not supported for public user
- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/50769cbf05d5/schema)
