Skip to content

Contract Publishing

Example request:

{
"data": {
"type": "contract",
"attributes": {
"public_until": "2038-02-03T09:08:23Z"
}
}
}

Example response:

{
"data": {
"id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93",
"type": "contract",
"attributes": {
...
}
}
}

This endpoint publishes a contract. If the public_until attribute is not specified or null, the contract will be made public for seven days by default.

POST /api/v1/contracts/:contract_id/publish

ParameterDescription
contract_idThe ID of the contract to publish

Example request:

{
"data": {
"type": "contract",
"attributes": {
"public_until": "2038-02-03T09:08:23Z"
}
}
}

Example response:

{
"data": {
"type": "contract",
"attributes": {
...
}
}
}

This endpoint updates the time until which the contract is public.

PUT /api/v1/contracts/:contract_id/publish

ParameterDescription
contract_idThe ID of the contract to update

Example response:

{
"data": {
"id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93",
"type": "contract",
"attributes": {
...
}
}
}

This endpoint unpublishes a contract.

DELETE /api/v1/contracts/:contract_id/publish

ParameterDescription
contract_idThe ID of the contract to unpublish

Example response:

{
"data": {
"id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93",
"type": "published_contract",
"attributes": {
...
}
}
}

This endpoint returns the published contract.

GET /public/v1/published-contract/:contract_token

ParameterDescription
contract_tokenThe token of the published contract