# Create contract

Creates a contract based on the provided contract type.

Endpoint: POST /v2/contracts

## Request fields (application/json):

  - `type` (object, required)
    The type of the contract

  - `type.id` (integer)
    The system identifier for the contract type
    Example: 1234

  - `name` (string,null)
    The user defined name of the contract
    Example: "My contract"

  - `owner` (object,null)
    The user assigned as the owner of the contract

  - `owner.id` (string)
    The identifier of the user
    Example: "f0f1e06e-3005-4093-af7f-1934d55617e1"

  - `document` (object,null)
    The contract document.

This is only optional if the contract type has a wizard

  - `document.id` (integer)
    The system identifier for the file
    Example: 9456

  - `expiry` (string,null)
    The expiry date of the contract. The date and time uses the ISO-8601 format and will be in the Local timezone of the organization
    Example: "2024-12-25T00:00:00"

  - `externalId` (string,null)
    A unique user defined identifier that can be used to reference another system
    Example: "external-01"

  - `fields` (object,null)
    The collection of fields associated with the contract
    Example: {"my_text_field":"my text value","my_decimal_field":78659.84,"my_boolean_field":true,"my_date_field":"2025-05-06","my_option_field":{"value":"option_1"},"my_multioption_field":[{"value":"option_a"},{"value":"option_d"}],"my_user_field":{"id":"f0f1e06e-3005-4093-af7f-1934d55617e1"}}

  - `restricted` (boolean,null)
    Is the contract only available to members.

An indicator where the contract requires membership to access

  - `teamAssigned` (object,null)
    The team which this contract is assigned to

  - `teamAssigned.id` (integer)
    The identifier of the team
    Example: 469

## Response 201 fields (application/json):

  - `id` (integer)
    The system identifier for the contract
    Example: 5348

## Response 400 fields (application/problem+json):

  - `detail` (string)
    More information about the problem.

  - `errors` (object)
    A dictionary of validation errors, where each key is a field api name and the value is a list of error messages.

  - `instance` (string)
    The URI of the resource which the error relates to.

  - `operationId` (string)
    A unique trace identifier for the request. This should be provided when requesting support.

  - `status` (integer)
    The HTTP status code for the problem.

  - `title` (string)
    A short description of the error.

  - `type` (string)
    A URI which can be followed to find out more about the problem.

## Response 409 fields (application/problem+json):

  - `detail` (string)
    More information about the problem.

  - `instance` (string)
    The URI of the resource which the error relates to.

  - `operationId` (string)
    A unique trace identifier for the request. This should be provided when requesting support.

  - `status` (integer)
    The HTTP status code for the problem.

  - `title` (string)
    A short description of the error.

  - `type` (string)
    A URI which can be followed to find out more about the problem.


