{"openapi":"3.1.0","info":{"title":"SYNCON ONE API","version":"1.0.0","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)."},"servers":[{"url":"https://0.0.0.0:3000"}],"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/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"}}}}}}},"/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/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"}}}}}}}}}