API Reference
The reference below covers every endpoint in the Contracts API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.
/api/v1/contractsAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Query Parameters
Filter to contracts in this status.
Value in
- "DRAFT"
- "ACTIVE"
- "EXPIRED"
- "CANCELLED"
Filter to contracts held by this company.
Filter to the contract that came out of this deal.
Filter to contracts owned by this workspace user.
Only contracts whose term ends between now and this many days out. Deliberately
forward-looking: a term that already ran out is an EXPIRED status, not a
renewal to prepare for, and is excluded.
1 <= value <= 3650Only contracts updated at or after this ISO 8601 datetime.
date-timePage size.
1 <= value <= 1000100The nextCursor value from the previous page.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/contracts?expiringWithinDays=30"{ "contracts": [ { "id": "cmq2cont0alk34567890", "number": 12, "title": "Acme master agreement", "status": "DRAFT", "value": 12500.5, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "autoRenew": true, "renewalNotifiedAt": "2019-08-24T14:15:22Z", "notes": "string", "company": { "id": "cmq2comp0alk34567890", "name": "Acme Corp" }, "deal": { "id": "cmq2comp0alk34567890", "name": "Acme Corp" }, "owner": { "id": "cmq2comp0alk34567890", "name": "Acme Corp" }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "nextCursor": "string"}{ "error": "status must be one of: DRAFT, ACTIVE, EXPIRED, CANCELLED."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:contracts."}{ "error": "Rate limit exceeded."}/api/v1/contracts/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The agentlyleads contract ID.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/contracts/string"{ "contract": { "id": "cmq2cont0alk34567890", "number": 12, "title": "Acme master agreement", "status": "DRAFT", "value": 12500.5, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "autoRenew": true, "renewalNotifiedAt": "2019-08-24T14:15:22Z", "notes": "string", "company": { "id": "cmq2comp0alk34567890", "name": "Acme Corp" }, "deal": { "id": "cmq2comp0alk34567890", "name": "Acme Corp" }, "owner": { "id": "cmq2comp0alk34567890", "name": "Acme Corp" }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:contracts."}{ "error": "Contract not found."}