{"openapi":"3.1.0","info":{"title":"Specular API","version":"1.0.0","termsOfService":"https://hispecular.com/terms","description":"Authenticate with `Authorization: Bearer <API key>`. Keys are created in Settings → API.\n\nEvery response carries `X-Request-Id` and RateLimit headers. Errors are `{ error: { code, message, requestId, details? } }`.\n\nLists return `{ data, pagination: { nextCursor, hasMore } }`; pass `cursor=<nextCursor>` for the next page.\n\nA key reads exactly what its role-equivalent (or the member it acts as) may read: hidden fields are absent, invisible records do not exist.\n\nScopes: `people:read` (Read customers), `people:write` (Create and change customers), `companies:read` (Read companies), `companies:write` (Create and change companies), `leads:read` (Read leads), `leads:write` (Create and change leads), `opportunities:read` (Read opportunities), `opportunities:write` (Create and change opportunities), `tasks:read` (Read tasks), `tasks:write` (Create and change tasks), `notes:read` (Read notes), `notes:write` (Create and change notes), `records:read` (Read custom object records), `records:write` (Create and change custom object records), `pipelines:read` (Read pipelines and stages), `evidence:read` (Read evidence), `reports:read` (Run reports), `webhooks:read` (Read webhook endpoints), `webhooks:write` (Manage webhook endpoints), `team:read` (Read teammates), `tickets:read` (Read support tickets), `tickets:write` (Open and change support tickets), `meetings:read` (Read meetings), `meetings:write` (Schedule, change and cancel meetings), `conversations:read` (Read live chat conversations), `conversations:write` (Reply in, assign and manage live chat conversations)."},"servers":[{"url":"https://hispecular.com","description":"Production"}],"externalDocs":{"description":"Guides, recipes and the reference, as web pages","url":"https://hispecular.com/docs/public-api"},"tags":[{"name":"Companies","description":"Accounts: the organisations you sell to or support."},{"name":"Custom objects","description":"Records of the objects your workspace defines for itself."},{"name":"Evidence","description":"What the workspace knows about a record, and where it came from."},{"name":"Inbox","description":"The live chat inbox: read conversations, take them over from the AI agent, reply, hand back."},{"name":"Leads","description":"People or companies that have shown interest and are not yet customers."},{"name":"Meetings","description":"Schedule, move, cancel and list meetings. They reach calendars and invite attendees."},{"name":"Notes","description":"Notes on customers, companies, leads and deals."},{"name":"Opportunities","description":"Deals moving through a pipeline."},{"name":"People","description":"Customers and contacts."},{"name":"Pipelines","description":"Pipelines and their stages, for moving deals."},{"name":"Reports","description":"Run saved reports."},{"name":"Tasks","description":"Work for your team, optionally linked to a record."},{"name":"Team","description":"The people in the workspace, for owners and assignees."},{"name":"Tickets","description":"Support tickets, addressed by their number."},{"name":"Webhooks","description":"Subscribe an address to events, rotate its secret and read delivery history."}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_…"}},"schemas":{"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","validation_failed","rate_limited","idempotency_key_reused","idempotency_in_progress","approval_required","conflict","internal"]},"message":{"type":"string"},"requestId":{"type":"string"},"details":{}},"required":["code","message","requestId"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"Pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false}}},"security":[{"bearerAuth":[]}],"paths":{"/api/v1/webhooks/events":{"get":{"operationId":"list_webhook_events","summary":"List webhook events","description":"The events a subscription can receive.\n\nRequires scope `webhooks:read`.","tags":["Webhooks"],"x-required-scope":"webhooks:read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"object":{"type":"string","const":"webhook_event"},"label":{"type":"string"},"description":{"type":"string"},"emitted":{"type":"boolean","description":"False for events that are listed but not sent yet."}},"required":["name","object","label","description","emitted"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/webhooks":{"get":{"operationId":"list_webhooks","summary":"List webhook subscriptions","description":"Never includes a signing secret.\n\nRequires scope `webhooks:read`.","tags":["Webhooks"],"x-required-scope":"webhooks:read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Id of the subscription."},"object":{"type":"string","const":"webhook"},"url":{"type":"string","description":"Where deliveries are sent."},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"description":"The events it receives."},"status":{"type":"string","enum":["active","disabled"]},"last_delivery_at":{"type":["string","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","url","description","events","status","last_delivery_at","last_error","created_at","updated_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_webhook","summary":"Subscribe a URL to events","description":"The response carries the signing secret once. Not idempotent on purpose: a replayed response would store the secret.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"x-required-scope":"webhooks:write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"description":"An https address (https is required in production). Private addresses are refused."},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["record.created","record.updated","record.deleted","opportunity.stage_changed","opportunity.won","opportunity.lost","task.completed","email.received","meeting.analyzed","forecast.snapshot_created","conversation.created","conversation.message_received","conversation.handoff_requested","meeting.booked","task.created","note.created"]},"description":"The events to receive, from GET /webhooks/events."},"description":{"type":"string","maxLength":200}},"required":["url","events"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Id of the subscription."},"object":{"type":"string","const":"webhook"},"url":{"type":"string","description":"Where deliveries are sent."},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"description":"The events it receives."},"status":{"type":"string","enum":["active","disabled"]},"last_delivery_at":{"type":["string","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string","description":"The signing secret. Shown once, here, and never again; store it. Deliveries are signed with it (HMAC-SHA256 in the x-syncon-signature header)."}},"required":["id","object","url","description","events","status","last_delivery_at","last_error","created_at","updated_at","secret"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/webhooks/{id}":{"get":{"operationId":"get_webhook","summary":"Get a webhook subscription","description":"Requires scope `webhooks:read`.","tags":["Webhooks"],"x-required-scope":"webhooks:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The subscription's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Id of the subscription."},"object":{"type":"string","const":"webhook"},"url":{"type":"string","description":"Where deliveries are sent."},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"description":"The events it receives."},"status":{"type":"string","enum":["active","disabled"]},"last_delivery_at":{"type":["string","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","url","description","events","status","last_delivery_at","last_error","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_webhook","summary":"Change a webhook subscription","description":"Only the keys sent are changed. A new url is checked the same way as on create.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"x-required-scope":"webhooks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The subscription's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["record.created","record.updated","record.deleted","opportunity.stage_changed","opportunity.won","opportunity.lost","task.completed","email.received","meeting.analyzed","forecast.snapshot_created","conversation.created","conversation.message_received","conversation.handoff_requested","meeting.booked","task.created","note.created"]}},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"status":{"description":"Disabling stops deliveries and cancels the ones waiting.","type":"string","enum":["active","disabled"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Id of the subscription."},"object":{"type":"string","const":"webhook"},"url":{"type":"string","description":"Where deliveries are sent."},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"description":"The events it receives."},"status":{"type":"string","enum":["active","disabled"]},"last_delivery_at":{"type":["string","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","url","description","events","status","last_delivery_at","last_error","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"delete_webhook","summary":"Unsubscribe","description":"Deletes the subscription and its delivery history. This cannot be undone.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"x-required-scope":"webhooks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The subscription's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"rotate_webhook_secret","summary":"Replace the signing secret","description":"The old secret stops signing at once, with no overlap. The new one is returned once.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"x-required-scope":"webhooks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The subscription's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Id of the subscription."},"object":{"type":"string","const":"webhook"},"url":{"type":"string","description":"Where deliveries are sent."},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"description":"The events it receives."},"status":{"type":"string","enum":["active","disabled"]},"last_delivery_at":{"type":["string","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string","description":"The signing secret. Shown once, here, and never again; store it. Deliveries are signed with it (HMAC-SHA256 in the x-syncon-signature header)."}},"required":["id","object","url","description","events","status","last_delivery_at","last_error","created_at","updated_at","secret"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/webhooks/{id}/deliveries":{"get":{"operationId":"list_webhook_deliveries","summary":"List deliveries","description":"Newest first: what was sent, to where it got, and how it went.\n\nRequires scope `webhooks:read`.","tags":["Webhooks"],"x-required-scope":"webhooks:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The subscription's id.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_delivery"},"event":{"type":"string"},"event_id":{"type":"string","description":"The id a receiver dedupes on; stable across retries."},"status":{"type":"string","enum":["pending","sending","delivered","dead","cancelled"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"type":["string","null"]},"delivered_at":{"type":["string","null"]},"next_attempt_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","event","event_id","status","attempts","response_status","last_error","delivered_at","next_attempt_at","created_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/team/members":{"get":{"operationId":"list_team_members","summary":"List teammates","description":"Everyone in the workspace. Use the id as the owner of a customer, company, lead, deal or task.\n\nRequires scope `team:read`.","tags":["Team"],"x-required-scope":"team:read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The member's user id, the value an owner field takes."},"object":{"type":"string","const":"team_member"},"name":{"type":"string"},"email":{"description":"Only returned to keys that act with the admin or manager role; null otherwise.","type":["string","null"]},"role":{"type":"string","enum":["owner","admin","manager","member","viewer"]},"joined_at":{"type":"string"},"last_active_at":{"type":["string","null"]}},"required":["id","object","name","email","role","joined_at","last_active_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tickets":{"get":{"operationId":"list_tickets","summary":"List tickets","description":"Newest ticket number first.\n\nRequires scope `tickets:read`.","tags":["Tickets"],"x-required-scope":"tickets:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","open","waiting_customer","waiting_internal","resolved","closed"]}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","enum":["low","medium","high","urgent"]}},{"name":"assignee","in":"query","required":false,"description":"Member user id.","schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"q","in":"query","required":false,"description":"Search the subject and summary.","schema":{"type":"string","minLength":1,"maxLength":120}},{"name":"updated_since","in":"query","required":false,"description":"Only tickets changed at or after this time.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The ticket number as text. Stable, and the value a path takes."},"object":{"type":"string","const":"ticket"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"},"summary":{"type":["string","null"]},"status":{"type":"string","enum":["new","open","waiting_customer","waiting_internal","resolved","closed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"source":{"type":"string","description":"Where it was raised: chat, email, a record or a workflow."},"assignee":{"description":"Member user id of whoever holds it.","type":["string","null"]},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"conversation":{"description":"Public id of the chat it came from, if any.","type":["string","null"]},"first_responded_at":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","number","subject","summary","status","priority","source","assignee","person","company","lead","opportunity","conversation","first_responded_at","resolved_at","closed_at","created_at","updated_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_ticket","summary":"Open a ticket about a record","description":"Needs at least one of person, company, lead or opportunity, each a record the key can see.\n\nRequires scope `tickets:write`.","tags":["Tickets"],"x-required-scope":"tickets:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":120},"summary":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"priority":{"description":"Defaults to medium. SLA targets follow it.","type":"string","enum":["low","medium","high","urgent"]},"assignee":{"description":"Member user id.","anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"person":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"company":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"lead":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"opportunity":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},"required":["subject"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The ticket number as text. Stable, and the value a path takes."},"object":{"type":"string","const":"ticket"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"},"summary":{"type":["string","null"]},"status":{"type":"string","enum":["new","open","waiting_customer","waiting_internal","resolved","closed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"source":{"type":"string","description":"Where it was raised: chat, email, a record or a workflow."},"assignee":{"description":"Member user id of whoever holds it.","type":["string","null"]},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"conversation":{"description":"Public id of the chat it came from, if any.","type":["string","null"]},"first_responded_at":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","number","subject","summary","status","priority","source","assignee","person","company","lead","opportunity","conversation","first_responded_at","resolved_at","closed_at","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tickets/{id}":{"get":{"operationId":"get_ticket","summary":"Get a ticket","description":"Requires scope `tickets:read`.","tags":["Tickets"],"x-required-scope":"tickets:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The ticket number.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The ticket number as text. Stable, and the value a path takes."},"object":{"type":"string","const":"ticket"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"},"summary":{"type":["string","null"]},"status":{"type":"string","enum":["new","open","waiting_customer","waiting_internal","resolved","closed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"source":{"type":"string","description":"Where it was raised: chat, email, a record or a workflow."},"assignee":{"description":"Member user id of whoever holds it.","type":["string","null"]},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"conversation":{"description":"Public id of the chat it came from, if any.","type":["string","null"]},"first_responded_at":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","number","subject","summary","status","priority","source","assignee","person","company","lead","opportunity","conversation","first_responded_at","resolved_at","closed_at","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_ticket","summary":"Change a ticket","description":"Move it along its lifecycle, change its priority or reassign it. A status the ticket cannot move to from where it is answers 409.\n\nRequires scope `tickets:write`.","tags":["Tickets"],"x-required-scope":"tickets:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The ticket number.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","open","waiting_customer","waiting_internal","resolved","closed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"assignee":{"description":"Member user id; null unassigns.","anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The ticket number as text. Stable, and the value a path takes."},"object":{"type":"string","const":"ticket"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"},"summary":{"type":["string","null"]},"status":{"type":"string","enum":["new","open","waiting_customer","waiting_internal","resolved","closed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"source":{"type":"string","description":"Where it was raised: chat, email, a record or a workflow."},"assignee":{"description":"Member user id of whoever holds it.","type":["string","null"]},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"conversation":{"description":"Public id of the chat it came from, if any.","type":["string","null"]},"first_responded_at":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","number","subject","summary","status","priority","source","assignee","person","company","lead","opportunity","conversation","first_responded_at","resolved_at","closed_at","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/meetings":{"get":{"operationId":"list_meetings","summary":"List meetings","description":"Soonest first for upcoming, most recent first for past. Not pageable: `pagination.hasMore` says whether more exist beyond `limit`.\n\nRequires scope `meetings:read`.","tags":["Meetings"],"x-required-scope":"meetings:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"window","in":"query","required":false,"schema":{"default":"upcoming","type":"string","enum":["upcoming","past","all"]}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"meeting"},"title":{"type":"string"},"status":{"type":"string","description":"booked, cancelled, completed or another lifecycle state."},"source":{"type":"string","enum":["agent","teammate"],"description":"Booked by the AI agent or made by a teammate."},"starts_at":{"type":["string","null"]},"ends_at":{"type":["string","null"]},"time_zone":{"type":"string"},"location":{"type":"string"},"meeting_url":{"type":["string","null"]},"description":{"type":["string","null"]},"owner":{"type":"string","description":"Member user id of whoever holds the meeting."},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"person":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"description":"Only for attendees who are not a customer.","type":["string","null"]}},"required":["person","name","email"],"additionalProperties":false}},"notice":{"description":"On create, change and cancel: who was told, or why nobody was.","type":["string","null"]},"updated_at":{"type":"string"}},"required":["id","object","title","status","source","starts_at","ends_at","time_zone","location","meeting_url","description","owner","person","company","lead","opportunity","attendees","notice","updated_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_meeting","summary":"Schedule a meeting","description":"Lands on the owner's connected calendar and invites the attendees, as in the app. Send `notify: false` to save it without telling anyone.\n\nRequires scope `meetings:write`.","tags":["Meetings"],"x-required-scope":"meetings:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"ends_at":{"description":"Defaults to starts_at plus duration_minutes.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"duration_minutes":{"default":30,"type":"integer","minimum":5,"maximum":1440},"time_zone":{"default":"UTC","type":"string","maxLength":64},"meeting_url":{"type":"string","maxLength":2000},"location":{"type":"string","maxLength":300},"description":{"type":"string","maxLength":5000},"owner":{"description":"Member user id. Defaults to the key's creator.","type":"string","minLength":1,"maxLength":128},"person":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"company":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"lead":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"opportunity":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"attendees":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"person":{"description":"A customer in this workspace.","type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":200}},"additionalProperties":false}},"notify":{"default":true,"description":"Put it on the owner's calendar and invite the attendees. False saves it quietly.","type":"boolean"}},"required":["title","starts_at"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"meeting"},"title":{"type":"string"},"status":{"type":"string","description":"booked, cancelled, completed or another lifecycle state."},"source":{"type":"string","enum":["agent","teammate"],"description":"Booked by the AI agent or made by a teammate."},"starts_at":{"type":["string","null"]},"ends_at":{"type":["string","null"]},"time_zone":{"type":"string"},"location":{"type":"string"},"meeting_url":{"type":["string","null"]},"description":{"type":["string","null"]},"owner":{"type":"string","description":"Member user id of whoever holds the meeting."},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"person":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"description":"Only for attendees who are not a customer.","type":["string","null"]}},"required":["person","name","email"],"additionalProperties":false}},"notice":{"description":"On create, change and cancel: who was told, or why nobody was.","type":["string","null"]},"updated_at":{"type":"string"}},"required":["id","object","title","status","source","starts_at","ends_at","time_zone","location","meeting_url","description","owner","person","company","lead","opportunity","attendees","notice","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/meetings/{id}":{"get":{"operationId":"get_meeting","summary":"Get a meeting","description":"Requires scope `meetings:read`.","tags":["Meetings"],"x-required-scope":"meetings:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the meeting.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"meeting"},"title":{"type":"string"},"status":{"type":"string","description":"booked, cancelled, completed or another lifecycle state."},"source":{"type":"string","enum":["agent","teammate"],"description":"Booked by the AI agent or made by a teammate."},"starts_at":{"type":["string","null"]},"ends_at":{"type":["string","null"]},"time_zone":{"type":"string"},"location":{"type":"string"},"meeting_url":{"type":["string","null"]},"description":{"type":["string","null"]},"owner":{"type":"string","description":"Member user id of whoever holds the meeting."},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"person":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"description":"Only for attendees who are not a customer.","type":["string","null"]}},"required":["person","name","email"],"additionalProperties":false}},"notice":{"description":"On create, change and cancel: who was told, or why nobody was.","type":["string","null"]},"updated_at":{"type":"string"}},"required":["id","object","title","status","source","starts_at","ends_at","time_zone","location","meeting_url","description","owner","person","company","lead","opportunity","attendees","notice","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_meeting","summary":"Change a meeting","description":"Only the keys sent change. Moving it or changing the attendees tells them, unless `notify` is false. A cancelled meeting cannot be changed.\n\nRequires scope `meetings:write`.","tags":["Meetings"],"x-required-scope":"meetings:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the meeting.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"ends_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"time_zone":{"type":"string","maxLength":64},"meeting_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"location":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"owner":{"type":"string","minLength":1,"maxLength":128},"attendees":{"description":"Replaces the whole list.","maxItems":20,"type":"array","items":{"type":"object","properties":{"person":{"description":"A customer in this workspace.","type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":200}},"additionalProperties":false}},"notify":{"default":true,"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"meeting"},"title":{"type":"string"},"status":{"type":"string","description":"booked, cancelled, completed or another lifecycle state."},"source":{"type":"string","enum":["agent","teammate"],"description":"Booked by the AI agent or made by a teammate."},"starts_at":{"type":["string","null"]},"ends_at":{"type":["string","null"]},"time_zone":{"type":"string"},"location":{"type":"string"},"meeting_url":{"type":["string","null"]},"description":{"type":["string","null"]},"owner":{"type":"string","description":"Member user id of whoever holds the meeting."},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"person":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"description":"Only for attendees who are not a customer.","type":["string","null"]}},"required":["person","name","email"],"additionalProperties":false}},"notice":{"description":"On create, change and cancel: who was told, or why nobody was.","type":["string","null"]},"updated_at":{"type":"string"}},"required":["id","object","title","status","source","starts_at","ends_at","time_zone","location","meeting_url","description","owner","person","company","lead","opportunity","attendees","notice","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"delete_meeting","summary":"Delete a meeting","description":"Removes it from every list and timeline. A meeting the AI agent booked with a visitor can be cancelled but not deleted.\n\nRequires scope `meetings:write`.","tags":["Meetings"],"x-required-scope":"meetings:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the meeting.","schema":{"type":"string"}},{"name":"notify","in":"query","required":false,"description":"Tell the attendees it is off. Only a meeting a teammate made can be deleted.","schema":{"default":"true","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"meeting"},"deleted":{"type":"boolean","const":true},"notice":{"type":["string","null"]}},"required":["id","object","deleted","notice"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/meetings/{id}/cancel":{"post":{"operationId":"cancel_meeting","summary":"Cancel a meeting","description":"The meeting stays on the record, marked cancelled. Cancelling twice changes nothing.\n\nRequires scope `meetings:write`.","tags":["Meetings"],"x-required-scope":"meetings:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the meeting.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notify":{"default":true,"description":"Tell the attendees it is off.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"meeting"},"title":{"type":"string"},"status":{"type":"string","description":"booked, cancelled, completed or another lifecycle state."},"source":{"type":"string","enum":["agent","teammate"],"description":"Booked by the AI agent or made by a teammate."},"starts_at":{"type":["string","null"]},"ends_at":{"type":["string","null"]},"time_zone":{"type":"string"},"location":{"type":"string"},"meeting_url":{"type":["string","null"]},"description":{"type":["string","null"]},"owner":{"type":"string","description":"Member user id of whoever holds the meeting."},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"person":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"description":"Only for attendees who are not a customer.","type":["string","null"]}},"required":["person","name","email"],"additionalProperties":false}},"notice":{"description":"On create, change and cancel: who was told, or why nobody was.","type":["string","null"]},"updated_at":{"type":"string"}},"required":["id","object","title","status","source","starts_at","ends_at","time_zone","location","meeting_url","description","owner","person","company","lead","opportunity","attendees","notice","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations":{"get":{"operationId":"list_conversations","summary":"List conversations in the inbox","description":"The live chat queue, most recently active first. Not pageable: narrow with view, q, responder, priority or tag.\n\nRequires scope `conversations:read`.","tags":["Inbox"],"x-required-scope":"conversations:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"view","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","everything","resolved","mine","unassigned","team","my_teams","needs_person","waiting_customer","waiting_teammate","ai","human","unread","closed","sla_risk"]}},{"name":"q","in":"query","required":false,"description":"Search the visitor, site and messages.","schema":{"type":"string","minLength":1,"maxLength":120}},{"name":"responder","in":"query","required":false,"schema":{"type":"string","enum":["ai","human"]}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","enum":["none","low","medium","high","urgent"]}},{"name":"tag","in":"query","required":false,"description":"A tag name.","schema":{"type":"string","minLength":1,"maxLength":60}},{"name":"limit","in":"query","required":false,"description":"Page size, at most 80.","schema":{"default":25,"type":"integer","minimum":1,"maximum":80}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the conversation, conv_…"},"object":{"type":"string","const":"conversation"},"visitor_name":{"type":["string","null"]},"visitor_email":{"type":["string","null"]},"site":{"type":"string","description":"The website the visitor is on."},"channel":{"type":"string","description":"web chat, email, WhatsApp or another channel."},"status":{"type":"string"},"responder":{"type":"string","enum":["ai","human"],"description":"Who is answering: the AI agent, or a teammate who has taken over."},"handoff_state":{"type":["string","null"]},"assignee":{"description":"Member user id of the owner.","type":["string","null"]},"priority":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"intent":{"type":["string","null"]},"score_band":{"type":["string","null"]},"sla_at_risk":{"type":"boolean"},"page_path":{"type":["string","null"]},"last_message":{"type":["string","null"]},"updated_at":{"type":"string"}},"required":["id","object","visitor_name","visitor_email","site","channel","status","responder","handoff_state","assignee","priority","tags","intent","score_band","sla_at_risk","page_path","last_message","updated_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations/{id}":{"get":{"operationId":"get_conversation","summary":"Get a conversation","description":"Who is answering, who holds it, and whether the acting teammate may reply.\n\nRequires scope `conversations:read`.","tags":["Inbox"],"x-required-scope":"conversations:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the conversation, conv_…"},"object":{"type":"string","const":"conversation"},"visitor_name":{"type":["string","null"]},"visitor_email":{"type":["string","null"]},"site":{"type":"string","description":"The website the visitor is on."},"channel":{"type":"string","description":"web chat, email, WhatsApp or another channel."},"status":{"type":"string"},"responder":{"type":"string","enum":["ai","human"],"description":"Who is answering: the AI agent, or a teammate who has taken over."},"handoff_state":{"type":["string","null"]},"assignee":{"description":"Member user id of the owner.","type":["string","null"]},"priority":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"intent":{"type":["string","null"]},"score_band":{"type":["string","null"]},"sla_at_risk":{"type":"boolean"},"page_path":{"type":["string","null"]},"last_message":{"type":["string","null"]},"updated_at":{"type":"string"},"person":{"description":"The customer record, when the key can see it.","type":["string","null"]},"visitor_online":{"type":"boolean"},"held_by":{"description":"Name of the teammate who has taken over, if any.","type":["string","null"]},"held_by_you":{"type":"boolean","description":"Whether the acting teammate holds it and may reply."},"can_reply":{"type":"boolean"}},"required":["id","object","visitor_name","visitor_email","site","channel","status","responder","handoff_state","assignee","priority","tags","intent","score_band","sla_at_risk","page_path","last_message","updated_at","person","visitor_online","held_by","held_by_you","can_reply"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_conversation","summary":"Change a conversation's owner, priority or tags","description":"Requires scope `conversations:write`.","tags":["Inbox"],"x-required-scope":"conversations:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"priority":{"type":"string","enum":["none","low","medium","high","urgent"]},"assignee":{"description":"Member user id; null unassigns.","anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"add_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"remove_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the conversation, conv_…"},"object":{"type":"string","const":"conversation"},"visitor_name":{"type":["string","null"]},"visitor_email":{"type":["string","null"]},"site":{"type":"string","description":"The website the visitor is on."},"channel":{"type":"string","description":"web chat, email, WhatsApp or another channel."},"status":{"type":"string"},"responder":{"type":"string","enum":["ai","human"],"description":"Who is answering: the AI agent, or a teammate who has taken over."},"handoff_state":{"type":["string","null"]},"assignee":{"description":"Member user id of the owner.","type":["string","null"]},"priority":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"intent":{"type":["string","null"]},"score_band":{"type":["string","null"]},"sla_at_risk":{"type":"boolean"},"page_path":{"type":["string","null"]},"last_message":{"type":["string","null"]},"updated_at":{"type":"string"},"person":{"description":"The customer record, when the key can see it.","type":["string","null"]},"visitor_online":{"type":"boolean"},"held_by":{"description":"Name of the teammate who has taken over, if any.","type":["string","null"]},"held_by_you":{"type":"boolean","description":"Whether the acting teammate holds it and may reply."},"can_reply":{"type":"boolean"}},"required":["id","object","visitor_name","visitor_email","site","channel","status","responder","handoff_state","assignee","priority","tags","intent","score_band","sla_at_risk","page_path","last_message","updated_at","person","visitor_online","held_by","held_by_you","can_reply"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations/{id}/messages":{"get":{"operationId":"list_conversation_messages","summary":"Read a conversation's messages","description":"The thread as the team sees it, oldest first, with system lines such as joins. Poll with `after` set to the last cursor to follow it live. Reading does not mark it read.\n\nRequires scope `conversations:read`.","tags":["Inbox"],"x-required-scope":"conversations:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"Only messages after this cursor. 0 starts at the beginning.","schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"description":"At most 100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Position in the thread. Pass the last one as `after`."},"object":{"type":"string","const":"conversation_message"},"role":{"type":"string","enum":["visitor","agent","human","system"]},"kind":{"type":"string"},"body":{"type":"string"},"sender":{"type":["string","null"]},"event":{"description":"For system lines: joined, returned, booked and so on.","type":["string","null"]},"reply_to":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["kind","name","url"],"additionalProperties":false}},"created_at":{"type":"string"},"edited_at":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["cursor","object","role","kind","body","sender","event","reply_to","attachments","created_at","edited_at","deleted"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations/{id}/join":{"post":{"operationId":"join_conversation","summary":"Take a conversation over from the AI agent","description":"The visitor sees a teammate arrive. Refused with 409 when another teammate already has it. Do this before replying.\n\nRequires scope `conversations:write`.","tags":["Inbox"],"x-required-scope":"conversations:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"conversation"},"responder":{"type":"string","enum":["ai","human"]},"cursor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Cursor of the message this wrote, if it wrote one."}},"required":["id","object","responder","cursor"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations/{id}/reply":{"post":{"operationId":"reply_to_conversation","summary":"Reply to the visitor","description":"Sends a message the visitor reads at once, as the teammate the key stands for. The conversation must be joined first (409 otherwise). Sending the same client_message_id twice posts once.\n\nRequires scope `conversations:write`.","tags":["Inbox"],"x-required-scope":"conversations:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4000,"description":"What the visitor will read."},"reply_to":{"description":"Cursor of the message being answered.","type":"integer","minimum":1,"maximum":9007199254740991},"client_message_id":{"description":"Your own id for this message. Sending it again returns the first instead of posting twice.","type":"string","minLength":1,"maxLength":100}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"conversation"},"responder":{"type":"string","enum":["ai","human"]},"cursor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Cursor of the message this wrote, if it wrote one."}},"required":["id","object","responder","cursor"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations/{id}/return-to-ai":{"post":{"operationId":"return_conversation_to_ai","summary":"Hand a conversation back to the AI agent","description":"Only the teammate who holds it can. The agent carries on from where the human left off.\n\nRequires scope `conversations:write`.","tags":["Inbox"],"x-required-scope":"conversations:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"conversation"},"responder":{"type":"string","enum":["ai","human"]},"cursor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Cursor of the message this wrote, if it wrote one."}},"required":["id","object","responder","cursor"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/conversations/{id}/notes":{"get":{"operationId":"list_conversation_notes","summary":"List a conversation's internal notes","description":"Notes only the team sees, newest first.\n\nRequires scope `conversations:read`.","tags":["Inbox"],"x-required-scope":"conversations:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"conversation_note"},"body":{"type":"string"},"author":{"type":["string","null"]},"author_name":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","body","author","author_name","created_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"add_conversation_note","summary":"Add an internal note to a conversation","description":"The visitor never sees it.\n\nRequires scope `conversations:write`.","tags":["Inbox"],"x-required-scope":"conversations:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the conversation, conv_…","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000,"description":"Only the team sees this. @mentions notify."}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"conversation_note"},"body":{"type":"string"},"author":{"type":["string","null"]},"author_name":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","body","author","author_name","created_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/people":{"get":{"operationId":"list_people","summary":"List people","description":"Requires scope `people:read`.","tags":["People"],"x-required-scope":"people:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"sort","in":"query","required":false,"description":"Sort order. A leading minus sorts descending.","schema":{"default":"-updated_at","type":"string","enum":["-updated_at","updated_at","-created_at","created_at"]}},{"name":"updated_since","in":"query","required":false,"description":"Only records updated at or after this instant.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"q","in":"query","required":false,"description":"Free-text search over the object's main columns.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"email","in":"query","required":false,"description":"Only records whose email equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"lifecycle_stage","in":"query","required":false,"description":"Only records whose lifecycle_stage equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"owner","in":"query","required":false,"description":"Only records whose owner equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"company","in":"query","required":false,"description":"Only records linked to this company (public id).","schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"lead_source","in":"query","required":false,"description":"Only records whose lead_source equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"country","in":"query","required":false,"description":"Only records whose country equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"city","in":"query","required":false,"description":"Only records whose city equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"title","in":"query","required":false,"description":"Only records whose title equals this.","schema":{"type":"string","minLength":1,"maxLength":320}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the person."},"object":{"type":"string","description":"The record's object type."},"display_name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"first_name":{"description":"First name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_name":{"description":"Last name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"email":{"description":"Email","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"whatsapp":{"description":"WhatsApp","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"title":{"description":"Job title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"department":{"description":"Department","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"lead_source":{"description":"Lead source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"original_source":{"description":"First touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"current_source":{"description":"Latest touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"linkedin_url":{"description":"LinkedIn","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"language":{"description":"Language","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lead_score":{"description":"Lead score","type":["number","null"]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"do_not_contact":{"description":"Do not contact","type":["boolean","null"]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"last_contacted_at":{"description":"Last contacted","anyOf":[{"type":"string","maxLength":40,"description":"Last contacted, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A person. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_person","summary":"Create a person","description":"Built-in and custom fields by key. Relations take public ids.\n\nRequires scope `people:write`.","tags":["People"],"x-required-scope":"people:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"first_name":{"description":"First name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_name":{"description":"Last name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"email":{"description":"Email","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"whatsapp":{"description":"WhatsApp","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"title":{"description":"Job title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"department":{"description":"Department","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"lead_source":{"description":"Lead source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"linkedin_url":{"description":"LinkedIn","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"language":{"description":"Language","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"do_not_contact":{"description":"Do not contact","type":["boolean","null"]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the person."},"object":{"type":"string","description":"The record's object type."},"display_name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"first_name":{"description":"First name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_name":{"description":"Last name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"email":{"description":"Email","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"whatsapp":{"description":"WhatsApp","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"title":{"description":"Job title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"department":{"description":"Department","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"lead_source":{"description":"Lead source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"original_source":{"description":"First touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"current_source":{"description":"Latest touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"linkedin_url":{"description":"LinkedIn","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"language":{"description":"Language","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lead_score":{"description":"Lead score","type":["number","null"]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"do_not_contact":{"description":"Do not contact","type":["boolean","null"]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"last_contacted_at":{"description":"Last contacted","anyOf":[{"type":"string","maxLength":40,"description":"Last contacted, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A person. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/people/{id}":{"get":{"operationId":"get_person","summary":"Get a person","description":"Requires scope `people:read`.","tags":["People"],"x-required-scope":"people:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the person.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the person."},"object":{"type":"string","description":"The record's object type."},"display_name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"first_name":{"description":"First name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_name":{"description":"Last name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"email":{"description":"Email","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"whatsapp":{"description":"WhatsApp","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"title":{"description":"Job title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"department":{"description":"Department","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"lead_source":{"description":"Lead source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"original_source":{"description":"First touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"current_source":{"description":"Latest touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"linkedin_url":{"description":"LinkedIn","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"language":{"description":"Language","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lead_score":{"description":"Lead score","type":["number","null"]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"do_not_contact":{"description":"Do not contact","type":["boolean","null"]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"last_contacted_at":{"description":"Last contacted","anyOf":[{"type":"string","maxLength":40,"description":"Last contacted, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A person. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_person","summary":"Update a person","description":"Only the keys sent are changed. Fields are applied in order; the first refusal stops the request and `details.applied` lists what was already changed.\n\nRequires scope `people:write`.","tags":["People"],"x-required-scope":"people:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the person.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"first_name":{"description":"First name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_name":{"description":"Last name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"email":{"description":"Email","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"whatsapp":{"description":"WhatsApp","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"title":{"description":"Job title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"department":{"description":"Department","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"lead_source":{"description":"Lead source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"linkedin_url":{"description":"LinkedIn","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"language":{"description":"Language","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"do_not_contact":{"description":"Do not contact","type":["boolean","null"]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the person."},"object":{"type":"string","description":"The record's object type."},"display_name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"first_name":{"description":"First name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_name":{"description":"Last name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"email":{"description":"Email","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"whatsapp":{"description":"WhatsApp","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"title":{"description":"Job title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"department":{"description":"Department","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"lead_source":{"description":"Lead source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"original_source":{"description":"First touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"current_source":{"description":"Latest touch","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"linkedin_url":{"description":"LinkedIn","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"language":{"description":"Language","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lead_score":{"description":"Lead score","type":["number","null"]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"do_not_contact":{"description":"Do not contact","type":["boolean","null"]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"last_contacted_at":{"description":"Last contacted","anyOf":[{"type":"string","maxLength":40,"description":"Last contacted, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A person. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"archive_person","summary":"Archive a person","description":"Archives the record (it can be restored in the app). Nothing is destroyed.\n\nRequires scope `people:write`.","tags":["People"],"x-required-scope":"people:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the person.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"archived":{"type":"boolean","const":true}},"required":["id","object","archived"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/companies":{"get":{"operationId":"list_companies","summary":"List companies","description":"Requires scope `companies:read`.","tags":["Companies"],"x-required-scope":"companies:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"sort","in":"query","required":false,"description":"Sort order. A leading minus sorts descending.","schema":{"default":"-updated_at","type":"string","enum":["-updated_at","updated_at","-created_at","created_at"]}},{"name":"updated_since","in":"query","required":false,"description":"Only records updated at or after this instant.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"q","in":"query","required":false,"description":"Free-text search over the object's main columns.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"domain","in":"query","required":false,"description":"Only records whose domain equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"industry","in":"query","required":false,"description":"Only records whose industry equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"lifecycle_stage","in":"query","required":false,"description":"Only records whose lifecycle_stage equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"owner","in":"query","required":false,"description":"Only records whose owner equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"country","in":"query","required":false,"description":"Only records whose country equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"tier","in":"query","required":false,"description":"Only records whose tier equals this.","schema":{"type":"string","minLength":1,"maxLength":320}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the company."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"domain":{"description":"Domain","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"website":{"description":"Website","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"industry":{"description":"Industry","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"employee_count":{"description":"Employees","type":["number","null"]},"annual_revenue_cents":{"description":"Annual revenue","anyOf":[{"type":"number","description":"Annual revenue, in minor units (cents)."},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"tier":{"description":"Tier","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"address_line":{"description":"Address","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A company. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_company","summary":"Create a company","description":"Built-in and custom fields by key. Relations take public ids.\n\nRequires scope `companies:write`.","tags":["Companies"],"x-required-scope":"companies:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"domain":{"description":"Domain","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"website":{"description":"Website","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"industry":{"description":"Industry","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"employee_count":{"description":"Employees","type":["number","null"]},"annual_revenue_cents":{"description":"Annual revenue","anyOf":[{"type":"number","description":"Annual revenue, in minor units (cents)."},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"tier":{"description":"Tier","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"address_line":{"description":"Address","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the company."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"domain":{"description":"Domain","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"website":{"description":"Website","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"industry":{"description":"Industry","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"employee_count":{"description":"Employees","type":["number","null"]},"annual_revenue_cents":{"description":"Annual revenue","anyOf":[{"type":"number","description":"Annual revenue, in minor units (cents)."},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"tier":{"description":"Tier","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"address_line":{"description":"Address","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A company. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/companies/{id}":{"get":{"operationId":"get_company","summary":"Get a company","description":"Requires scope `companies:read`.","tags":["Companies"],"x-required-scope":"companies:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the company.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the company."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"domain":{"description":"Domain","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"website":{"description":"Website","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"industry":{"description":"Industry","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"employee_count":{"description":"Employees","type":["number","null"]},"annual_revenue_cents":{"description":"Annual revenue","anyOf":[{"type":"number","description":"Annual revenue, in minor units (cents)."},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"tier":{"description":"Tier","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"address_line":{"description":"Address","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A company. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_company","summary":"Update a company","description":"Only the keys sent are changed. Fields are applied in order; the first refusal stops the request and `details.applied` lists what was already changed.\n\nRequires scope `companies:write`.","tags":["Companies"],"x-required-scope":"companies:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the company.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"domain":{"description":"Domain","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"website":{"description":"Website","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"industry":{"description":"Industry","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"employee_count":{"description":"Employees","type":["number","null"]},"annual_revenue_cents":{"description":"Annual revenue","anyOf":[{"type":"number","description":"Annual revenue, in minor units (cents)."},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"tier":{"description":"Tier","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"address_line":{"description":"Address","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the company."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"domain":{"description":"Domain","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"website":{"description":"Website","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"industry":{"description":"Industry","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"employee_count":{"description":"Employees","type":["number","null"]},"annual_revenue_cents":{"description":"Annual revenue","anyOf":[{"type":"number","description":"Annual revenue, in minor units (cents)."},{"type":"null"}]},"phone":{"description":"Phone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lifecycle_stage":{"description":"Lifecycle stage","anyOf":[{"type":"string","enum":["lead","prospect","customer","churned"]},{"type":"null"}]},"tier":{"description":"Tier","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"address_line":{"description":"Address","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"city":{"description":"City","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"region":{"description":"Region","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"country":{"description":"Country","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"time_zone":{"description":"Time zone","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"tags":{"description":"Tags","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"description":{"description":"About","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"next_activity_at":{"description":"Next activity","anyOf":[{"type":"string","maxLength":40,"description":"Next activity, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A company. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"archive_company","summary":"Archive a company","description":"Archives the record (it can be restored in the app). Nothing is destroyed.\n\nRequires scope `companies:write`.","tags":["Companies"],"x-required-scope":"companies:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the company.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"archived":{"type":"boolean","const":true}},"required":["id","object","archived"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/leads":{"get":{"operationId":"list_leads","summary":"List leads","description":"Requires scope `leads:read`.","tags":["Leads"],"x-required-scope":"leads:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"sort","in":"query","required":false,"description":"Sort order. A leading minus sorts descending.","schema":{"default":"-updated_at","type":"string","enum":["-updated_at","updated_at","-created_at","created_at"]}},{"name":"updated_since","in":"query","required":false,"description":"Only records updated at or after this instant.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"q","in":"query","required":false,"description":"Free-text search over the object's main columns.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"description":"Only records whose status equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"source","in":"query","required":false,"description":"Only records whose source equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"owner","in":"query","required":false,"description":"Only records whose owner equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"person","in":"query","required":false,"description":"Only records linked to this person (public id).","schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"company","in":"query","required":false,"description":"Only records linked to this company (public id).","schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the lead."},"object":{"type":"string","description":"The record's object type."},"person":{"description":"Customer","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Customer: public id of the person."},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"title":{"description":"Title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string","enum":["new","working","qualified","meeting","converted","disqualified"]},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","enum":["website","manual","import","conversation"]},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"score_total":{"description":"Score","type":["number","null"]},"estimated_value_cents":{"description":"Estimated value","anyOf":[{"type":"number","description":"Estimated value, in minor units (cents)."},{"type":"null"}]},"requirements":{"description":"What they need","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"campaign":{"description":"Campaign","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_action_at":{"description":"Next action","anyOf":[{"type":"string","maxLength":40,"description":"Next action, ISO 8601."},{"type":"null"}]},"last_engaged_at":{"description":"Last engaged","anyOf":[{"type":"string","maxLength":40,"description":"Last engaged, ISO 8601."},{"type":"null"}]},"lost_reason":{"description":"Reason","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A lead. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_lead","summary":"Create a lead","description":"Built-in and custom fields by key. Relations take public ids.\n\nRequires scope `leads:write`.","tags":["Leads"],"x-required-scope":"leads:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"person":{"description":"Customer","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Customer: public id of the person."},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"title":{"description":"Title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string","enum":["new","working","qualified","meeting","converted","disqualified"]},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","enum":["website","manual","import","conversation"]},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"estimated_value_cents":{"description":"Estimated value","anyOf":[{"type":"number","description":"Estimated value, in minor units (cents)."},{"type":"null"}]},"requirements":{"description":"What they need","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"campaign":{"description":"Campaign","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_action_at":{"description":"Next action","anyOf":[{"type":"string","maxLength":40,"description":"Next action, ISO 8601."},{"type":"null"}]},"lost_reason":{"description":"Reason","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the lead."},"object":{"type":"string","description":"The record's object type."},"person":{"description":"Customer","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Customer: public id of the person."},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"title":{"description":"Title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string","enum":["new","working","qualified","meeting","converted","disqualified"]},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","enum":["website","manual","import","conversation"]},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"score_total":{"description":"Score","type":["number","null"]},"estimated_value_cents":{"description":"Estimated value","anyOf":[{"type":"number","description":"Estimated value, in minor units (cents)."},{"type":"null"}]},"requirements":{"description":"What they need","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"campaign":{"description":"Campaign","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_action_at":{"description":"Next action","anyOf":[{"type":"string","maxLength":40,"description":"Next action, ISO 8601."},{"type":"null"}]},"last_engaged_at":{"description":"Last engaged","anyOf":[{"type":"string","maxLength":40,"description":"Last engaged, ISO 8601."},{"type":"null"}]},"lost_reason":{"description":"Reason","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A lead. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/leads/{id}":{"get":{"operationId":"get_lead","summary":"Get a lead","description":"Requires scope `leads:read`.","tags":["Leads"],"x-required-scope":"leads:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the lead.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the lead."},"object":{"type":"string","description":"The record's object type."},"person":{"description":"Customer","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Customer: public id of the person."},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"title":{"description":"Title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string","enum":["new","working","qualified","meeting","converted","disqualified"]},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","enum":["website","manual","import","conversation"]},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"score_total":{"description":"Score","type":["number","null"]},"estimated_value_cents":{"description":"Estimated value","anyOf":[{"type":"number","description":"Estimated value, in minor units (cents)."},{"type":"null"}]},"requirements":{"description":"What they need","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"campaign":{"description":"Campaign","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_action_at":{"description":"Next action","anyOf":[{"type":"string","maxLength":40,"description":"Next action, ISO 8601."},{"type":"null"}]},"last_engaged_at":{"description":"Last engaged","anyOf":[{"type":"string","maxLength":40,"description":"Last engaged, ISO 8601."},{"type":"null"}]},"lost_reason":{"description":"Reason","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A lead. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_lead","summary":"Update a lead","description":"Only the keys sent are changed. Fields are applied in order; the first refusal stops the request and `details.applied` lists what was already changed.\n\nRequires scope `leads:write`.","tags":["Leads"],"x-required-scope":"leads:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the lead.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"title":{"description":"Title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string","enum":["new","working","qualified","meeting","converted","disqualified"]},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","enum":["website","manual","import","conversation"]},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"estimated_value_cents":{"description":"Estimated value","anyOf":[{"type":"number","description":"Estimated value, in minor units (cents)."},{"type":"null"}]},"requirements":{"description":"What they need","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"campaign":{"description":"Campaign","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_action_at":{"description":"Next action","anyOf":[{"type":"string","maxLength":40,"description":"Next action, ISO 8601."},{"type":"null"}]},"lost_reason":{"description":"Reason","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the lead."},"object":{"type":"string","description":"The record's object type."},"person":{"description":"Customer","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Customer: public id of the person."},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"title":{"description":"Title","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string","enum":["new","working","qualified","meeting","converted","disqualified"]},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","enum":["website","manual","import","conversation"]},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"score_band":{"description":"Score band","anyOf":[{"type":"string","enum":["hot","warm","low","disqualified"]},{"type":"null"}]},"score_total":{"description":"Score","type":["number","null"]},"estimated_value_cents":{"description":"Estimated value","anyOf":[{"type":"number","description":"Estimated value, in minor units (cents)."},{"type":"null"}]},"requirements":{"description":"What they need","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"campaign":{"description":"Campaign","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_action_at":{"description":"Next action","anyOf":[{"type":"string","maxLength":40,"description":"Next action, ISO 8601."},{"type":"null"}]},"last_engaged_at":{"description":"Last engaged","anyOf":[{"type":"string","maxLength":40,"description":"Last engaged, ISO 8601."},{"type":"null"}]},"lost_reason":{"description":"Reason","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A lead. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"archive_lead","summary":"Archive a lead","description":"Archives the record (it can be restored in the app). Nothing is destroyed.\n\nRequires scope `leads:write`.","tags":["Leads"],"x-required-scope":"leads:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the lead.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"archived":{"type":"boolean","const":true}},"required":["id","object","archived"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/opportunities":{"get":{"operationId":"list_opportunities","summary":"List opportunities","description":"Requires scope `opportunities:read`.","tags":["Opportunities"],"x-required-scope":"opportunities:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"sort","in":"query","required":false,"description":"Sort order. A leading minus sorts descending.","schema":{"default":"-updated_at","type":"string","enum":["-updated_at","updated_at","-created_at","created_at"]}},{"name":"updated_since","in":"query","required":false,"description":"Only records updated at or after this instant.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"q","in":"query","required":false,"description":"Free-text search over the object's main columns.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"owner","in":"query","required":false,"description":"Only records whose owner equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"pipeline","in":"query","required":false,"description":"Only records whose pipeline id equals this.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"stage","in":"query","required":false,"description":"Only records whose stage id equals this.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"stage_kind","in":"query","required":false,"description":"Only records whose stage_kind equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"currency","in":"query","required":false,"description":"Only records whose currency equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"source","in":"query","required":false,"description":"Only records whose source equals this.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"person","in":"query","required":false,"description":"Only records linked to this person (public id).","schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"company","in":"query","required":false,"description":"Only records linked to this company (public id).","schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the opportunity."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"person":{"description":"Primary contact","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Primary contact: public id of the person."},{"type":"null"}]},"pipeline":{"description":"Pipeline","anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"stage":{"description":"Stage","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Stage id from GET /api/v1/pipelines."},{"type":"null"}]},"stage_kind":{"description":"Status","anyOf":[{"type":"string","enum":["open","won","lost"]},{"type":"null"}]},"amount":{"description":"Amount","anyOf":[{"type":"number","description":"Amount, in minor units (cents)."},{"type":"null"}]},"currency":{"description":"Currency","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"probability":{"description":"Probability","type":["number","null"]},"close_date":{"description":"Expected close","anyOf":[{"type":"string","maxLength":40,"description":"Expected close, ISO 8601."},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"next_step":{"description":"Next step","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_step_due_at":{"description":"Next step due","anyOf":[{"type":"string","maxLength":40,"description":"Next step due, ISO 8601."},{"type":"null"}]},"competitor":{"description":"Competitor","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"win_reason":{"description":"Why we won","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lost_reason":{"description":"Why we lost","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"stage_entered_at":{"description":"In stage since","anyOf":[{"type":"string","maxLength":40,"description":"In stage since, ISO 8601."},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"closed_at":{"description":"Closed","anyOf":[{"type":"string","maxLength":40,"description":"Closed, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"An opportunity. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_deal","summary":"Create an opportunity","description":"Built-in and custom fields by key. Relations take public ids. Changing `stage` moves the opportunity through the pipeline's rules; when an approval policy applies the response is 409 `approval_required` and the opportunity does not move. `lost_reason` / `win_reason` in the same body travel with the move.\n\nRequires scope `opportunities:write`.","tags":["Opportunities"],"x-required-scope":"opportunities:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"person":{"description":"Primary contact","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Primary contact: public id of the person."},{"type":"null"}]},"stage":{"description":"Stage","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Stage id from GET /api/v1/pipelines."},{"type":"null"}]},"amount":{"description":"Amount","anyOf":[{"type":"number","description":"Amount, in minor units (cents)."},{"type":"null"}]},"currency":{"description":"Currency","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"probability":{"description":"Probability","type":["number","null"]},"close_date":{"description":"Expected close","anyOf":[{"type":"string","maxLength":40,"description":"Expected close, ISO 8601."},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"next_step":{"description":"Next step","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_step_due_at":{"description":"Next step due","anyOf":[{"type":"string","maxLength":40,"description":"Next step due, ISO 8601."},{"type":"null"}]},"competitor":{"description":"Competitor","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"win_reason":{"description":"Why we won","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lost_reason":{"description":"Why we lost","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the opportunity."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"person":{"description":"Primary contact","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Primary contact: public id of the person."},{"type":"null"}]},"pipeline":{"description":"Pipeline","anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"stage":{"description":"Stage","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Stage id from GET /api/v1/pipelines."},{"type":"null"}]},"stage_kind":{"description":"Status","anyOf":[{"type":"string","enum":["open","won","lost"]},{"type":"null"}]},"amount":{"description":"Amount","anyOf":[{"type":"number","description":"Amount, in minor units (cents)."},{"type":"null"}]},"currency":{"description":"Currency","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"probability":{"description":"Probability","type":["number","null"]},"close_date":{"description":"Expected close","anyOf":[{"type":"string","maxLength":40,"description":"Expected close, ISO 8601."},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"next_step":{"description":"Next step","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_step_due_at":{"description":"Next step due","anyOf":[{"type":"string","maxLength":40,"description":"Next step due, ISO 8601."},{"type":"null"}]},"competitor":{"description":"Competitor","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"win_reason":{"description":"Why we won","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lost_reason":{"description":"Why we lost","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"stage_entered_at":{"description":"In stage since","anyOf":[{"type":"string","maxLength":40,"description":"In stage since, ISO 8601."},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"closed_at":{"description":"Closed","anyOf":[{"type":"string","maxLength":40,"description":"Closed, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"An opportunity. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/opportunities/{id}":{"get":{"operationId":"get_deal","summary":"Get an opportunity","description":"Requires scope `opportunities:read`.","tags":["Opportunities"],"x-required-scope":"opportunities:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the opportunity.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the opportunity."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"person":{"description":"Primary contact","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Primary contact: public id of the person."},{"type":"null"}]},"pipeline":{"description":"Pipeline","anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"stage":{"description":"Stage","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Stage id from GET /api/v1/pipelines."},{"type":"null"}]},"stage_kind":{"description":"Status","anyOf":[{"type":"string","enum":["open","won","lost"]},{"type":"null"}]},"amount":{"description":"Amount","anyOf":[{"type":"number","description":"Amount, in minor units (cents)."},{"type":"null"}]},"currency":{"description":"Currency","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"probability":{"description":"Probability","type":["number","null"]},"close_date":{"description":"Expected close","anyOf":[{"type":"string","maxLength":40,"description":"Expected close, ISO 8601."},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"next_step":{"description":"Next step","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_step_due_at":{"description":"Next step due","anyOf":[{"type":"string","maxLength":40,"description":"Next step due, ISO 8601."},{"type":"null"}]},"competitor":{"description":"Competitor","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"win_reason":{"description":"Why we won","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lost_reason":{"description":"Why we lost","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"stage_entered_at":{"description":"In stage since","anyOf":[{"type":"string","maxLength":40,"description":"In stage since, ISO 8601."},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"closed_at":{"description":"Closed","anyOf":[{"type":"string","maxLength":40,"description":"Closed, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"An opportunity. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_deal","summary":"Update an opportunity","description":"Only the keys sent are changed. Fields are applied in order; the first refusal stops the request and `details.applied` lists what was already changed. Changing `stage` moves the opportunity through the pipeline's rules; when an approval policy applies the response is 409 `approval_required` and the opportunity does not move. `lost_reason` / `win_reason` in the same body travel with the move.\n\nRequires scope `opportunities:write`.","tags":["Opportunities"],"x-required-scope":"opportunities:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the opportunity.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"stage":{"description":"Stage","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Stage id from GET /api/v1/pipelines."},{"type":"null"}]},"amount":{"description":"Amount","anyOf":[{"type":"number","description":"Amount, in minor units (cents)."},{"type":"null"}]},"currency":{"description":"Currency","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"probability":{"description":"Probability","type":["number","null"]},"close_date":{"description":"Expected close","anyOf":[{"type":"string","maxLength":40,"description":"Expected close, ISO 8601."},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"next_step":{"description":"Next step","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_step_due_at":{"description":"Next step due","anyOf":[{"type":"string","maxLength":40,"description":"Next step due, ISO 8601."},{"type":"null"}]},"competitor":{"description":"Competitor","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"win_reason":{"description":"Why we won","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lost_reason":{"description":"Why we lost","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the opportunity."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"company":{"description":"Company","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Company: public id of the company."},{"type":"null"}]},"person":{"description":"Primary contact","anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$","description":"Primary contact: public id of the person."},{"type":"null"}]},"pipeline":{"description":"Pipeline","anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"stage":{"description":"Stage","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Stage id from GET /api/v1/pipelines."},{"type":"null"}]},"stage_kind":{"description":"Status","anyOf":[{"type":"string","enum":["open","won","lost"]},{"type":"null"}]},"amount":{"description":"Amount","anyOf":[{"type":"number","description":"Amount, in minor units (cents)."},{"type":"null"}]},"currency":{"description":"Currency","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"probability":{"description":"Probability","type":["number","null"]},"close_date":{"description":"Expected close","anyOf":[{"type":"string","maxLength":40,"description":"Expected close, ISO 8601."},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"next_step":{"description":"Next step","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"next_step_due_at":{"description":"Next step due","anyOf":[{"type":"string","maxLength":40,"description":"Next step due, ISO 8601."},{"type":"null"}]},"competitor":{"description":"Competitor","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"source":{"description":"Source","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"description":{"description":"Notes","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"win_reason":{"description":"Why we won","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"lost_reason":{"description":"Why we lost","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"stage_entered_at":{"description":"In stage since","anyOf":[{"type":"string","maxLength":40,"description":"In stage since, ISO 8601."},{"type":"null"}]},"last_activity_at":{"description":"Last activity","anyOf":[{"type":"string","maxLength":40,"description":"Last activity, ISO 8601."},{"type":"null"}]},"closed_at":{"description":"Closed","anyOf":[{"type":"string","maxLength":40,"description":"Closed, ISO 8601."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"An opportunity. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"archive_deal","summary":"Archive an opportunity","description":"Archives the record (it can be restored in the app). Nothing is destroyed.\n\nRequires scope `opportunities:write`.","tags":["Opportunities"],"x-required-scope":"opportunities:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the opportunity.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"archived":{"type":"boolean","const":true}},"required":["id","object","archived"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/objects/{slug}/records":{"get":{"operationId":"list_object_records","summary":"List records of a custom object","description":"Requires scope `records:read`.","tags":["Custom objects"],"x-required-scope":"records:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The custom object's slug, as shown in CRM settings.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"sort","in":"query","required":false,"description":"Sort order. A leading minus sorts descending.","schema":{"default":"-updated_at","type":"string","enum":["-updated_at","updated_at","-created_at","created_at"]}},{"name":"updated_since","in":"query","required":false,"description":"Only records updated at or after this instant.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"q","in":"query","required":false,"description":"Free-text search over the object's main columns.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"owner","in":"query","required":false,"description":"Only records whose owner equals this.","schema":{"type":"string","minLength":1,"maxLength":320}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the custom object record."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A custom object record. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_object_record","summary":"Create a custom object record","description":"Requires scope `records:write`.","tags":["Custom objects"],"x-required-scope":"records:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The custom object's slug, as shown in CRM settings.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the custom object record."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A custom object record. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/objects/{slug}/records/{id}":{"get":{"operationId":"get_object_record","summary":"Get a custom object record","description":"Requires scope `records:read`.","tags":["Custom objects"],"x-required-scope":"records:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The custom object's slug, as shown in CRM settings.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Public id of the record.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the custom object record."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A custom object record. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_object_record","summary":"Update a custom object record","description":"Requires scope `records:write`.","tags":["Custom objects"],"x-required-scope":"records:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The custom object's slug, as shown in CRM settings.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Public id of the record.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":200,"type":"array","items":{"type":"string","maxLength":500}}],"description":"A custom field value. Validated against the workspace's field definition."}}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the custom object record."},"object":{"type":"string","description":"The record's object type."},"name":{"description":"Name","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner":{"description":"Owner","anyOf":[{"type":"string","maxLength":128,"description":"Owner: a member's user id."},{"type":"null"}]},"created_at":{"description":"Created","anyOf":[{"type":"string","maxLength":40,"description":"Created, ISO 8601."},{"type":"null"}]},"updated_at":{"description":"Updated","anyOf":[{"type":"string","maxLength":40,"description":"Updated, ISO 8601."},{"type":"null"}]}},"required":["id","object"],"additionalProperties":{},"description":"A custom object record. Fields the key may not read are absent. Custom fields appear under their keys. Relations are public ids."}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"archive_object_record","summary":"Archive a custom object record","description":"Requires scope `records:write`.","tags":["Custom objects"],"x-required-scope":"records:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The custom object's slug, as shown in CRM settings.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Public id of the record.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"archived":{"type":"boolean","const":true}},"required":["id","object","archived"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tasks":{"get":{"operationId":"list_tasks","summary":"List tasks","description":"Ordered by due date (soonest first; completed tasks by completion, newest first).\n\nRequires scope `tasks:read`.","tags":["Tasks"],"x-required-scope":"tasks:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}},{"name":"window","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["today","overdue","upcoming","completed","all"]}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"person","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"company","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"lead","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"opportunity","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"task"},"title":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"status":{"type":"string","enum":["open","completed","cancelled"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"description":"ISO 8601.","type":["string","null"]},"all_day":{"type":"boolean"},"owner":{"description":"Member user id.","type":["string","null"]},"completed_at":{"type":["string","null"]},"overdue":{"type":"boolean"},"person":{"description":"Public id, or null when unlinked or not visible to the key.","type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","title","description","kind","status","priority","due_at","all_day","owner","completed_at","overdue","person","company","lead","opportunity","created_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_task","summary":"Create a task","description":"Requires scope `tasks:write`.","tags":["Tasks"],"x-required-scope":"tasks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"all_day":{"type":"boolean"},"owner":{"description":"Member user id. Defaults to the key's creator.","anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"person":{"anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},{"type":"null"}]},"company":{"anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},{"type":"null"}]},"lead":{"anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},{"type":"null"}]},"opportunity":{"anyOf":[{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},{"type":"null"}]}},"required":["title"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"task"},"title":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"status":{"type":"string","enum":["open","completed","cancelled"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"description":"ISO 8601.","type":["string","null"]},"all_day":{"type":"boolean"},"owner":{"description":"Member user id.","type":["string","null"]},"completed_at":{"type":["string","null"]},"overdue":{"type":"boolean"},"person":{"description":"Public id, or null when unlinked or not visible to the key.","type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","title","description","kind","status","priority","due_at","all_day","owner","completed_at","overdue","person","company","lead","opportunity","created_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tasks/{id}":{"get":{"operationId":"get_task","summary":"Get a task","description":"Requires scope `tasks:read`.","tags":["Tasks"],"x-required-scope":"tasks:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the task.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"task"},"title":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"status":{"type":"string","enum":["open","completed","cancelled"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"description":"ISO 8601.","type":["string","null"]},"all_day":{"type":"boolean"},"owner":{"description":"Member user id.","type":["string","null"]},"completed_at":{"type":["string","null"]},"overdue":{"type":"boolean"},"person":{"description":"Public id, or null when unlinked or not visible to the key.","type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","title","description","kind","status","priority","due_at","all_day","owner","completed_at","overdue","person","company","lead","opportunity","created_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_task","summary":"Update a task","description":"Requires scope `tasks:write`.","tags":["Tasks"],"x-required-scope":"tasks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the task.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"owner":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"status":{"type":"string","enum":["open","completed","cancelled"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"task"},"title":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"status":{"type":"string","enum":["open","completed","cancelled"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"description":"ISO 8601.","type":["string","null"]},"all_day":{"type":"boolean"},"owner":{"description":"Member user id.","type":["string","null"]},"completed_at":{"type":["string","null"]},"overdue":{"type":"boolean"},"person":{"description":"Public id, or null when unlinked or not visible to the key.","type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","title","description","kind","status","priority","due_at","all_day","owner","completed_at","overdue","person","company","lead","opportunity","created_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"delete_task","summary":"Delete a task","description":"Removes the task for good, and the record it was on gets its next activity recalculated.\n\nRequires scope `tasks:write`.","tags":["Tasks"],"x-required-scope":"tasks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the task.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tasks/{id}/complete":{"post":{"operationId":"complete_task","summary":"Complete a task","description":"Idempotent: completing a completed task changes nothing.\n\nRequires scope `tasks:write`.","tags":["Tasks"],"x-required-scope":"tasks:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the task.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"task"},"title":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["task","call","meeting","email","follow_up"]},"status":{"type":"string","enum":["open","completed","cancelled"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"due_at":{"description":"ISO 8601.","type":["string","null"]},"all_day":{"type":"boolean"},"owner":{"description":"Member user id.","type":["string","null"]},"completed_at":{"type":["string","null"]},"overdue":{"type":"boolean"},"person":{"description":"Public id, or null when unlinked or not visible to the key.","type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","object","title","description","kind","status","priority","due_at","all_day","owner","completed_at","overdue","person","company","lead","opportunity","created_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes":{"get":{"operationId":"list_notes","summary":"List notes on a record","description":"The most recent notes on one record, pinned first. Not pageable: `pagination.hasMore` says whether older notes exist beyond `limit`.\n\nRequires scope `notes:read`.","tags":["Notes"],"x-required-scope":"notes:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"record_type","in":"query","required":true,"schema":{"type":"string","enum":["person","company","lead","opportunity"]}},{"name":"record_id","in":"query","required":true,"schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"note"},"body":{"type":"string"},"author":{"description":"Member user id of the author, when a person wrote it.","type":["string","null"]},"author_kind":{"type":"string"},"pinned":{"type":"boolean"},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","body","author","author_kind","pinned","person","company","lead","opportunity","created_at","updated_at"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"create_note","summary":"Add a note to a record","description":"Requires scope `notes:write`.","tags":["Notes"],"x-required-scope":"notes:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (1-255 visible ASCII). Retrying with the same key and body replays the first response; a different body answers 422 idempotency_key_reused. Kept for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record_type":{"type":"string","enum":["person","company","lead","opportunity"]},"record_id":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"},"body":{"type":"string","minLength":1,"maxLength":8000},"pinned":{"type":"boolean"}},"required":["record_type","record_id","body"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"note"},"body":{"type":"string"},"author":{"description":"Member user id of the author, when a person wrote it.","type":["string","null"]},"author_kind":{"type":"string"},"pinned":{"type":"boolean"},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","body","author","author_kind","pinned","person","company","lead","opportunity","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/{id}":{"get":{"operationId":"get_note","summary":"Get a note","description":"Requires scope `notes:read`.","tags":["Notes"],"x-required-scope":"notes:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the note.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"note"},"body":{"type":"string"},"author":{"description":"Member user id of the author, when a person wrote it.","type":["string","null"]},"author_kind":{"type":"string"},"pinned":{"type":"boolean"},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","body","author","author_kind","pinned","person","company","lead","opportunity","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"update_note","summary":"Edit a note","description":"Change the text, pin or unpin it, or both.\n\nRequires scope `notes:write`.","tags":["Notes"],"x-required-scope":"notes:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the note.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":8000},"pinned":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"note"},"body":{"type":"string"},"author":{"description":"Member user id of the author, when a person wrote it.","type":["string","null"]},"author_kind":{"type":"string"},"pinned":{"type":"boolean"},"person":{"type":["string","null"]},"company":{"type":["string","null"]},"lead":{"type":["string","null"]},"opportunity":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","body","author","author_kind","pinned","person","company","lead","opportunity","created_at","updated_at"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict, approval required, or idempotent request in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"delete_note","summary":"Delete a note","description":"Removes it from the record. An administrator can still recover it.\n\nRequires scope `notes:write`.","tags":["Notes"],"x-required-scope":"notes:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the note.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/pipelines":{"get":{"operationId":"list_pipelines","summary":"List pipelines and their stages","description":"Requires scope `pipelines:read`.","tags":["Pipelines"],"x-required-scope":"pipelines:read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"pipeline"},"name":{"type":"string"},"description":{"type":["string","null"]},"is_default":{"type":"boolean"},"position":{"type":"number"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"color":{"type":["string","null"]},"position":{"type":"number"},"probability":{"type":["number","null"]}},"required":["id","key","label","kind","color","position","probability"],"additionalProperties":false}}},"required":["id","object","name","description","is_default","position","stages"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/pipelines/{id}":{"get":{"operationId":"get_pipeline","summary":"Get a pipeline","description":"Requires scope `pipelines:read`.","tags":["Pipelines"],"x-required-scope":"pipelines:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Pipeline id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"pipeline"},"name":{"type":"string"},"description":{"type":["string","null"]},"is_default":{"type":"boolean"},"position":{"type":"number"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"color":{"type":["string","null"]},"position":{"type":"number"},"probability":{"type":["number","null"]}},"required":["id","key","label","kind","color","position","probability"],"additionalProperties":false}}},"required":["id","object","name","description","is_default","position","stages"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reports/{id}/run":{"post":{"operationId":"run_report","summary":"Run a saved report","description":"Runs the saved definition now. A key acting as a member opens that member's own, shared and workspace reports; other keys open workspace-visible reports. Totals include only records the key may see.\n\nRequires scope `reports:read`.","tags":["Reports"],"x-required-scope":"reports:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Public id of the saved report.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Public id of the saved report."},"object":{"type":"string","const":"report_result"},"name":{"type":"string"},"result":{"type":"object","properties":{"type":{"type":"string"},"columns":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"totals":{"type":"array","items":{"type":["number","null"]}},"truncated":{"type":"boolean"},"currency":{"type":["string","null"]},"empty":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string"},"message":{"type":"string"}},"required":["reason","message"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":"array","items":{"type":"string"}},"generatedAt":{"type":"string"}},"required":["type","columns","rows","totals","truncated","currency","empty","notes","generatedAt"],"additionalProperties":{},"description":"Aggregated over only the records the key may see."}},"required":["id","object","name","result"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/evidence":{"get":{"operationId":"list_evidence","summary":"List evidence on a record","description":"Newest first. Private evidence is never returned; metadata-only evidence has `title` and `content` null.\n\nRequires scope `evidence:read`.","tags":["Evidence"],"x-required-scope":"evidence:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"record_type","in":"query","required":true,"schema":{"type":"string","enum":["person","company","lead","opportunity"]}},{"name":"record_id","in":"query","required":true,"schema":{"type":"string","pattern":"^[a-z]{1,12}_[A-Za-z0-9]{4,64}$"}},{"name":"kinds","in":"query","required":false,"description":"Comma-separated evidence kinds.","schema":{"type":"string","maxLength":400}},{"name":"limit","in":"query","required":false,"description":"Page size, at most 100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`pagination.nextCursor` from the previous page.","schema":{"type":"string","maxLength":400}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"evidence"},"kind":{"type":"string"},"source":{"type":"string"},"provider":{"type":"string"},"occurred_at":{"type":"string"},"actor_kind":{"type":"string"},"actor_label":{"type":["string","null"]},"title":{"description":"Null when the key may only read metadata.","type":["string","null"]},"content":{"description":"Null when the key may only read metadata.","type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visibility":{"type":"string"},"access":{"type":"string","enum":["full","metadata"]},"links":{"type":"array","items":{"type":"object","properties":{"object_type":{"type":"string"},"record_id":{"description":"Public id of the linked record, or null when not visible.","type":["string","null"]},"role":{"type":"string"}},"required":["object_type","record_id","role"],"additionalProperties":false}}},"required":["id","object","kind","source","provider","occurred_at","actor_kind","actor_label","title","content","metadata","visibility","access","links"],"additionalProperties":false}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/evidence/{id}":{"get":{"operationId":"get_evidence","summary":"Get one piece of evidence","description":"Requires scope `evidence:read`.","tags":["Evidence"],"x-required-scope":"evidence:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Evidence id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK.","headers":{"RateLimit-Limit":{"description":"Requests per minute this key may make.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until a request is available again.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Quote this when contacting support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"evidence"},"kind":{"type":"string"},"source":{"type":"string"},"provider":{"type":"string"},"occurred_at":{"type":"string"},"actor_kind":{"type":"string"},"actor_label":{"type":["string","null"]},"title":{"description":"Null when the key may only read metadata.","type":["string","null"]},"content":{"description":"Null when the key may only read metadata.","type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visibility":{"type":"string"},"access":{"type":"string","enum":["full","metadata"]},"links":{"type":"array","items":{"type":"object","properties":{"object_type":{"type":"string"},"record_id":{"description":"Public id of the linked record, or null when not visible.","type":["string","null"]},"role":{"type":"string"}},"required":["object_type","record_id","role"],"additionalProperties":false}}},"required":["id","object","kind","source","provider","occurred_at","actor_kind","actor_label","title","content","metadata","visibility","access","links"],"additionalProperties":false}}}}}},"401":{"description":"Missing, invalid, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the scope, or its role cannot do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found, or not visible to this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}}}