A contract can have multiple source apps. One of them can be selected as the default app. This app will be used for system operations, for example, when a contract item needs to be created. The default app can be selected in the contract’s source settings.
You can make a request to create a new item of the default app for the contract.
The request address will include the code of the workspace the contract is located in ({namespace}) and the code of the contract ({code}). In the request body, pass the data of the item that is going to be created. The new item will be added to the source app. It will also be available in the contract.
If a contract has no default source app, the item will not be created. In the error field of the response there will be a message saying that no default source is selected.

Request

POST /pub/v1/contracts/{namespace}/{code}/create

Path parameters

Parameter name Value Description Additional
namespace string

Workspace code

Required
code string

Contract code

Required

Request body

The resource sent in the request body is  Create an item of the default app of a contract — Request. It contains the following writable properties:

{
    "context": {
        "<key>": {}
    }
}

Properties

Name Type Description Additional
context object

Fields of the new app item

Optional
context.<key> map of object Optional

Authorization

This request requires the use of one of following authorisation methods: API key

Response

The following HTTP status codes may be returned:

Status code Description Resource
200 OK

Response model for creating an item

Response model for creating an item (Create an item of the default app of a contract)
400 Bad Request

The contract doesn't have a default source