User Contracts
List of valid attributes:
Attribute | Description | Specifics |
---|---|---|
discarded_at | Null or timestamp of removal | Cannot be set |
name | Name of the contract | Can only be updated |
status | Status of the contract | Cannot be set, is always one of: creating reviewing signing completed |
wording | Content of the contract | Can only be updated |
Meta data: Permissions
Group | Description |
---|---|
actions | Contains permissions to edit or delete a contract |
signing_process | Returns permissions if current user can create or delete a signing process |
Create
Example request:
{ "data": { "type": "contract", "attributes": { "contract_template_id": "70f2da60-67cf-4d6f-8f68-9a5d6e46df3d" } }}
Example response:
{ "data": { "id": "86d82a79-7c3a-4e6c-a1d5-2be1f9dbfe0a", "type": "contract", "attributes": { ... } }}
On success, this endpoint creates a new contract for a user, from the given template.
HTTP Request
POST /api/v1/users/:user_id/contracts
URL Parameters
Parameter | Description |
---|---|
user_id | ID of the user to whom the contract is attached |
Show
Example response:
{ "data": { "id": "11ed62a0-d0fb-4603-a1aa-60a8e2a4a12a", "type": "contract", "attributes": { ... } }}
This endpoint returns a single contract.
HTTP Request
GET /api/v1/users/:user_id/contracts/:contract_id
URL Parameters
Parameter | Description |
---|---|
contract_id | ID of the contract to return |
user_id | ID of the user to whom the contract is attached |
List
Example response:
{ "data": [ { "id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93", "type": "contract", "attributes": { ... } }, { ... } ]}
This endpoint returns a list of contracts.
HTTP Request
GET /api/v1/users/:user_id/contracts
URL Parameters
Parameter | Description |
---|---|
user_id | ID of the user to whom the contract is attached |
Update
Example request:
{ "data": { "type": "contract", "attributes": { "name": "Updated contract" "wording": "Updated contract content" } }}
Example response:
{ "data": { "id": "41206789-af28-4b29-bc57-3e9fbb2bc389", "type": "contract", "attributes": { ... } }}
This endpoint updates a contract.
HTTP Request
PUT /api/v1/users/:user_id/contracts/:contract_id
URL Parameters
Parameter | Description |
---|---|
contract_id | ID of the contract to be updated |
user_id | ID of the user to whom the contract is attached |
Delete
Example response:
{ "data": { "id": "41206789-af28-4b29-bc57-3e9fbb2bc389", "type": "contract", "attributes": { ... } }}
This endpoint deletes a contract.
HTTP Request
DELETE /api/v1/users/:user_id/contracts/:contract_id
URL Parameters
Parameter | Description |
---|---|
contract_id | ID of the contract to be deleted |
user_id | ID of the user to whom the contract is attached |