API Quickstart
This guide walks you through creating a container, adding a document with clauses, publishing it, and sending a signing request — all via the REST API.
Prerequisites
Section titled “Prerequisites”- A TheTerms account with an organisation
- An API key (see Authentication)
curlor any HTTP client
Set your API key as an environment variable for the examples below:
export THETERMS_API_KEY="tt_your_api_key_here"export THETERMS_URL="https://app.theterms.app/api/v1"Walkthrough
Section titled “Walkthrough”-
Create a container
Containers group related documents. Create one for your Terms of Service:
Terminal window curl -X POST "$THETERMS_URL/containers" \-H "X-Api-Key: $THETERMS_API_KEY" \-H "Content-Type: application/json" \-d '{"name": "Website Agreements", "description": "All website legal documents"}'Response:
{"data": {"id": "clx1abc...","name": "Website Agreements","description": "All website legal documents","createdAt": "2026-02-21T10:00:00.000Z"}}Save the
id— you will need it in the next step. -
Create a document
Create a document inside the container. It starts as a draft (version 1):
Terminal window curl -X POST "$THETERMS_URL/containers/{containerId}/documents" \-H "X-Api-Key: $THETERMS_API_KEY" \-H "Content-Type: application/json" \-d '{"title": "Terms of Service"}'Save the document
idandactiveVersionIdfrom the response. -
Update the document version with clauses
Add clauses to the draft version:
Terminal window curl -X PUT "$THETERMS_URL/documents/{documentId}/versions/{versionId}" \-H "X-Api-Key: $THETERMS_API_KEY" \-H "Content-Type: application/json" \-d '{"clauses": [{"id": "clause-1","title": "Acceptable Use","content": {"type": "doc", "content": [{"type": "paragraph", "content": [{"type": "text", "text": "You agree to use the service only for lawful purposes."}]}]},"mandatory": true,"order": 0},{"id": "clause-2","title": "Marketing Communications","content": {"type": "doc", "content": [{"type": "paragraph", "content": [{"type": "text", "text": "We may send you promotional emails about new features."}]}]},"mandatory": false,"order": 1}]}' -
Publish the version
Publishing makes the document active and available for signing:
Terminal window curl -X POST "$THETERMS_URL/documents/{documentId}/versions/{versionId}/publish" \-H "X-Api-Key: $THETERMS_API_KEY" -
Send a signing request
Invite someone to sign the published document:
Terminal window curl -X POST "$THETERMS_URL/documents/{documentId}/signing-requests" \-H "X-Api-Key: $THETERMS_API_KEY" \-H "Content-Type: application/json" \-d '{"signerName": "Jane Doe","signerEmail": "jane@example.com"}'The signer receives an email with a unique link to review and sign the document. No account creation is required.
-
Check signing status
List signing requests for the document:
Terminal window curl "$THETERMS_URL/documents/{documentId}/signing-requests" \-H "X-Api-Key: $THETERMS_API_KEY"Each request includes a
statusfield (PENDING,VIEWED,COMPLETED,EXPIRED) and clause-level responses when completed.
Next Steps
Section titled “Next Steps”- Webhooks Guide — Get notified when a document is signed
- API Reference — Explore all endpoints interactively
- Authentication — API key management and security