Contracts
The Contracts API provides CRUD access to contracts (signable documents), plus ancillary actions for tags and cloning.New to the API? Start with Getting started (base URL, response envelope, errors, pagination) and Authentication (API keys). Those conventions apply to every endpoint below and are not repeated here.
Identifier note: contracts are addressed by their numericdoc_id. Wherever{id}appears below it is thedoc_id.
Scope: signing (team/client/guest/in-person), publishing & emailing, automation, estimate generation and the rich document editor are managed in-app and are not part of this API. Signature/automation state is exposed read-only where relevant.
The contract object
| Field | Type | Notes |
|---|---|---|
id | integer | Contract id. Used in all URLs. |
title | string | Contract title. |
status | string | Read-only, system-derived: draft, awaiting_signatures, active, expired (driven by signatures + dates). |
value | string|null | Contract value. |
body | string|null | Contract body (HTML). |
client | object | { id, name }. |
category | object | { id, name }. |
project_id | integer|null | Attached project id (managed in-app). |
dates | object | start, end, created, published. |
signing | object | Read-only signing state: client_status, provider_status. |
tags | array | Tag titles. |
List / search contracts
Query parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status. |
client_id | integer | Filter by client id. |
category_id | integer | Filter by category id. |
search | string | Free-text search on the title. |
sort | string | doc_title, doc_status, doc_date_start, doc_created, doc_value. |
order | string | asc or desc (default desc). |
limit | integer | Results per page (max 100). |
page | integer | Page number. |
Example request
Example response — 200 OK
Get a contract
200) with message “Contract retrieved successfully.”
Create a contract
doc_body to set the content
directly, or contract_template to seed the body from a template. (Automation is not
configurable via the API; new contracts are created with automation disabled.)
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
doc_client_id | integer | yes | Existing client id. |
doc_title | string | yes | |
doc_date_start | date | yes | YYYY-MM-DD. |
doc_categoryid | integer | yes | Existing (contract) category id. |
doc_date_end | date | no | Must be on/after the start date. |
doc_value | numeric | no | |
doc_project_id | integer | no | Existing project id. |
doc_lead_id | integer | no | Existing lead id. |
doc_body | string (HTML) | no | Contract content. Overrides contract_template. |
contract_template | integer | no | Template id used to seed the body when doc_body is omitted. |
Example request
Example response — 201 Created
Update a contract
| Parameter | Type | Required | Notes |
|---|---|---|---|
doc_title | string | yes | |
doc_date_start | date | yes | |
doc_categoryid | integer | yes | Existing category id. |
doc_date_end | date | no | Must be on/after the start date. |
doc_value | numeric | no | |
doc_body | string (HTML) | no | Replaces the contract content. |
200) with message “Contract updated successfully.”
Delete a contract
Example response — 200 OK
Set tags
tags array is the full set — it replaces existing tags; an empty array clears them.
| Parameter | Type | Required | Notes |
|---|---|---|---|
tags | array of strings | yes | Tag titles. Empty array clears all. |
200) with message “Contract tags updated successfully.”
Clone a contract
| Parameter | Type | Required | Notes |
|---|---|---|---|
doc_title | string | yes | Title of the new contract. |
doc_client_id | integer | yes | Client for the new contract. |
doc_categoryid | integer | yes | Category for the new contract. |
doc_date_start | date | yes | |
doc_date_end | date | no | |
doc_project_id | integer | no | |
doc_value | numeric | no |
201) with message “Contract cloned successfully.”
Errors
See Getting started for the shared error format. Contract-specific:| Status | Meaning |
|---|---|
404 Not Found | The contract id does not exist. |
422 Unprocessable Entity | Validation failed (e.g. missing client/title/date/category, or an invalid status). |