{"openapi":"3.1.0","info":{"title":"Crossing Edge API","version":"1.0.0","description":"Read and change everything in a Crossing Edge workspace from your own systems: records of any object, tasks, email, Telegram, webhooks, reports and settings. Every operation runs with the access of the member who made the key, through the same checks, automations and history as the app.","contact":{"name":"Crossing Edge","email":"team@crossingedge.com","url":"https://api.crossingedge.com"},"license":{"name":"Proprietary: for use with a Crossing Edge workspace","url":"https://crossingedge.com"}},"servers":[{"url":"https://api.crossingedge.com/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Getting started","description":"Check a key."},{"name":"Contacts","description":"REST routes for contacts."},{"name":"Companies","description":"REST routes for companies."},{"name":"Deals","description":"REST routes for deals."},{"name":"Any object","description":"REST routes for any object."},{"name":"Tasks","description":"REST routes for tasks."},{"name":"Schema","description":"REST routes for schema."},{"name":"Contacts and tasks","description":"Contacts, tasks, calls, meetings and notes."},{"name":"Records","description":"Any record: companies, deals, contacts and the objects a workspace adds itself. Links between them, and deal splits."},{"name":"Workspace settings","description":"Pipelines, objects, fields, relationships, automations, members and workspace settings. Owners and admins."},{"name":"Insights and history","description":"Duplicates, merging, history, stage times, overdue work, insights, spend and saved views."},{"name":"Email","description":"Email conversations, replies, drafts in the member’s own style, and their writing profile."},{"name":"Gmail sync","description":"The member’s own connected Gmail inboxes and their Review."},{"name":"Telegram","description":"Telegram chats, replies and links to records."},{"name":"Webhooks","description":"Incoming webhooks that bring leads in from forms and tools."},{"name":"IndiaMART","description":"IndiaMART enquiries arriving as leads."},{"name":"Events","description":"Event mode: who was met at a conference or trade fair."},{"name":"Exports","description":"Spreadsheets of records."},{"name":"Reports and schema","description":"Reports, the workspace schema and queries."}],"paths":{"/contacts":{"get":{"operationId":"getContacts","summary":"List or search contacts","description":"Finds contacts by name, email, phone, job title or company, optionally narrowed by status or owner. Returns compact rows with ids; use get_contact for everything about one.","tags":["Contacts"],"x-scope":"read","x-operation":"search_contacts","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string"},"description":"Words to match in the name, email, phone, job title or company names"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Only this lifecycle status"},{"name":"owner","in":"query","required":false,"schema":{"type":"string"},"description":"Only contacts this member owns, by email or name"},{"name":"companyId","in":"query","required":false,"schema":{"type":"number"},"description":"Only contacts at this company"},{"name":"limit","in":"query","required":false,"schema":{"type":"number"},"description":"How many to return, default 20, at most 100"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"post":{"operationId":"postContacts","summary":"Create a contact","description":"Adds a contact. Needs a first name and an email or phone. Runs the workspace’s automations and duplicate check like a contact made in the app.","tags":["Contacts"],"x-scope":"write","x-operation":"create_contact","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email. A contact needs an email or a phone"},"phone":{"type":"string","description":"Phone, with country code"},"jobTitle":{"type":"string","description":"Job title"},"status":{"type":"string","description":"Lifecycle status, one of the choices get_schema lists for contacts.status"},"source":{"type":"string","description":"Where they came from, one of the choices get_schema lists for contacts.source"},"linkedin":{"type":"string","description":"LinkedIn profile URL"},"telegram":{"type":"string","description":"Telegram username, like @priya"},"country":{"type":"string","description":"Country they are based in, by name or two-letter code (India, IN)"},"state":{"type":"string","description":"Their state, province or region"},"city":{"type":"string","description":"Their city"},"owner":{"type":"string","description":"Owner, by member email or name"},"companyIds":{"type":"array","items":{"type":"number"},"description":"Companies they work with, by id (replaces the current set)"},"companyName":{"type":"string","description":"A company to link by exact name; made if the workspace has none by that name"},"custom":{"type":"object","description":"Custom field values by field key (keys from get_schema)"}},"required":["firstName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/contacts/{id}":{"get":{"operationId":"getContactsById","summary":"Get a contact","description":"Everything about one contact: their fields, companies, owner, and their latest activities and open tasks.","tags":["Contacts"],"x-scope":"read","x-operation":"get_contact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"patch":{"operationId":"patchContactsById","summary":"Update a contact","description":"Changes a contact. Only the fields passed change; companyName adds a company link, companyIds replaces the set.","tags":["Contacts"],"x-scope":"write","x-operation":"update_contact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email. A contact needs an email or a phone"},"phone":{"type":"string","description":"Phone, with country code"},"jobTitle":{"type":"string","description":"Job title"},"status":{"type":"string","description":"Lifecycle status, one of the choices get_schema lists for contacts.status"},"source":{"type":"string","description":"Where they came from, one of the choices get_schema lists for contacts.source"},"linkedin":{"type":"string","description":"LinkedIn profile URL"},"telegram":{"type":"string","description":"Telegram username, like @priya"},"country":{"type":"string","description":"Country they are based in, by name or two-letter code (India, IN)"},"state":{"type":"string","description":"Their state, province or region"},"city":{"type":"string","description":"Their city"},"owner":{"type":"string","description":"Owner, by member email or name"},"companyIds":{"type":"array","items":{"type":"number"},"description":"Companies they work with, by id (replaces the current set)"},"companyName":{"type":"string","description":"A company to link by exact name; made if the workspace has none by that name"},"custom":{"type":"object","description":"Custom field values by field key (keys from get_schema)"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"delete":{"operationId":"deleteContactsById","summary":"Delete a contact","description":"Deletes a contact for good, with their notes and history. Ask the person first, then call with confirm: true. Deleting is permanent.","tags":["Contacts"],"x-scope":"write","x-operation":"delete_contact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/companies":{"get":{"operationId":"getCompanies","summary":"List or search companies","description":"Finds records of any object (companies, deals, contacts or a workspace object) by words in their name and fields, optionally narrowed by owner. Compact rows with ids; get_record has everything about one.","tags":["Companies"],"x-scope":"read","x-operation":"search_records","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string"},"description":"Words to match"},{"name":"owner","in":"query","required":false,"schema":{"type":"string"},"description":"Only records this member owns, by email or name"},{"name":"limit","in":"query","required":false,"schema":{"type":"number"},"description":"How many, default 20, at most 100"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"post":{"operationId":"postCompanies","summary":"Create a company","description":"Adds a record of any object: a company, a deal (lands in the default pipeline unless pipeline or stage is given), a contact, or a workspace object. Runs automations and duplicate checks like the app.","tags":["Companies"],"x-scope":"write","x-operation":"create_record","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Field values by key or label: name, domain, amount, owner (member email), and custom fields by their label. /schema lists every field and its choices."}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/companies/{id}":{"get":{"operationId":"getCompaniesById","summary":"Get a company","description":"Everything about one record of any object: its fields, what it is linked to (companies, people, deals, parents and subsidiaries, workspace relationships), and its latest activity and notes.","tags":["Companies"],"x-scope":"read","x-operation":"get_record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"patch":{"operationId":"patchCompaniesById","summary":"Update a company","description":"Changes a record of any object. Only the fields passed change; a deal moves stage by passing stage (and pipeline if it is in several). companyIds and contactIds replace the set; link_records adds or removes one.","tags":["Companies"],"x-scope":"write","x-operation":"update_record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Field values by key or label: name, domain, amount, owner (member email), and custom fields by their label. /schema lists every field and its choices."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"delete":{"operationId":"deleteCompaniesById","summary":"Delete a company","description":"Deletes a record of any object for good, with its notes and history. Ask the person first, then call with confirm: true. Deleting is permanent.","tags":["Companies"],"x-scope":"write","x-operation":"delete_record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/deals":{"get":{"operationId":"getDeals","summary":"List or search deals","description":"Finds records of any object (companies, deals, contacts or a workspace object) by words in their name and fields, optionally narrowed by owner. Compact rows with ids; get_record has everything about one.","tags":["Deals"],"x-scope":"read","x-operation":"search_records","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string"},"description":"Words to match"},{"name":"owner","in":"query","required":false,"schema":{"type":"string"},"description":"Only records this member owns, by email or name"},{"name":"limit","in":"query","required":false,"schema":{"type":"number"},"description":"How many, default 20, at most 100"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"post":{"operationId":"postDeals","summary":"Create a deal","description":"Adds a record of any object: a company, a deal (lands in the default pipeline unless pipeline or stage is given), a contact, or a workspace object. Runs automations and duplicate checks like the app.","tags":["Deals"],"x-scope":"write","x-operation":"create_record","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Field values by key or label: name, domain, amount, owner (member email), and custom fields by their label. /schema lists every field and its choices."}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/deals/{id}":{"get":{"operationId":"getDealsById","summary":"Get a deal","description":"Everything about one record of any object: its fields, what it is linked to (companies, people, deals, parents and subsidiaries, workspace relationships), and its latest activity and notes.","tags":["Deals"],"x-scope":"read","x-operation":"get_record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"patch":{"operationId":"patchDealsById","summary":"Update a deal","description":"Changes a record of any object. Only the fields passed change; a deal moves stage by passing stage (and pipeline if it is in several). companyIds and contactIds replace the set; link_records adds or removes one.","tags":["Deals"],"x-scope":"write","x-operation":"update_record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Field values by key or label: name, domain, amount, owner (member email), and custom fields by their label. /schema lists every field and its choices."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"delete":{"operationId":"deleteDealsById","summary":"Delete a deal","description":"Deletes a record of any object for good, with its notes and history. Ask the person first, then call with confirm: true. Deleting is permanent.","tags":["Deals"],"x-scope":"write","x-operation":"delete_record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/objects/{object}/records":{"get":{"operationId":"getObjectsByObjectRecords","summary":"List or search records of any object","description":"Finds records of any object (companies, deals, contacts or a workspace object) by words in their name and fields, optionally narrowed by owner. Compact rows with ids; get_record has everything about one.","tags":["Any object"],"x-scope":"read","x-operation":"search_records","parameters":[{"name":"object","in":"path","required":true,"schema":{"type":"string"},"description":"The object: companies, deals, contacts, or a workspace object’s id (obj_…, from /schema)"},{"name":"query","in":"query","required":false,"schema":{"type":"string"},"description":"Words to match"},{"name":"owner","in":"query","required":false,"schema":{"type":"string"},"description":"Only records this member owns, by email or name"},{"name":"limit","in":"query","required":false,"schema":{"type":"number"},"description":"How many, default 20, at most 100"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"post":{"operationId":"postObjectsByObjectRecords","summary":"Create a record","description":"Adds a record of any object: a company, a deal (lands in the default pipeline unless pipeline or stage is given), a contact, or a workspace object. Runs automations and duplicate checks like the app.","tags":["Any object"],"x-scope":"write","x-operation":"create_record","parameters":[{"name":"object","in":"path","required":true,"schema":{"type":"string"},"description":"The object: companies, deals, contacts, or a workspace object’s id (obj_…, from /schema)"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Field values by key or label: name, domain, amount, owner (member email), and custom fields by their label. /schema lists every field and its choices."}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/objects/{object}/records/{id}":{"get":{"operationId":"getObjectsByObjectRecordsById","summary":"Get a record","description":"Everything about one record of any object: its fields, what it is linked to (companies, people, deals, parents and subsidiaries, workspace relationships), and its latest activity and notes.","tags":["Any object"],"x-scope":"read","x-operation":"get_record","parameters":[{"name":"object","in":"path","required":true,"schema":{"type":"string"},"description":"The object: companies, deals, contacts, or a workspace object’s id (obj_…, from /schema)"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"patch":{"operationId":"patchObjectsByObjectRecordsById","summary":"Update a record","description":"Changes a record of any object. Only the fields passed change; a deal moves stage by passing stage (and pipeline if it is in several). companyIds and contactIds replace the set; link_records adds or removes one.","tags":["Any object"],"x-scope":"write","x-operation":"update_record","parameters":[{"name":"object","in":"path","required":true,"schema":{"type":"string"},"description":"The object: companies, deals, contacts, or a workspace object’s id (obj_…, from /schema)"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Field values by key or label: name, domain, amount, owner (member email), and custom fields by their label. /schema lists every field and its choices."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"delete":{"operationId":"deleteObjectsByObjectRecordsById","summary":"Delete a record","description":"Deletes a record of any object for good, with its notes and history. Ask the person first, then call with confirm: true. Deleting is permanent.","tags":["Any object"],"x-scope":"write","x-operation":"delete_record","parameters":[{"name":"object","in":"path","required":true,"schema":{"type":"string"},"description":"The object: companies, deals, contacts, or a workspace object’s id (obj_…, from /schema)"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/tasks":{"get":{"operationId":"getTasks","summary":"List tasks and activities","description":"Tasks, open ones by default: yours, everyone’s you can see, or those on one record. Also lists other activity types with type.","tags":["Tasks"],"x-scope":"read","x-operation":"list_tasks","parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string"},"description":"Tasks you created or are on (default), or all you can see"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Default open"},{"name":"type","in":"query","required":false,"schema":{"type":"string"},"description":"Default task"},{"name":"overdue","in":"query","required":false,"schema":{"type":"boolean"},"description":"Only those past due"},{"name":"dueBefore","in":"query","required":false,"schema":{"type":"string"},"description":"Only those due before this ISO date"},{"name":"contactId","in":"query","required":false,"schema":{"type":"number"},"description":"The contact it is about"},{"name":"companyId","in":"query","required":false,"schema":{"type":"number"},"description":"The company it is about"},{"name":"dealId","in":"query","required":false,"schema":{"type":"number"},"description":"The deal it is about"},{"name":"limit","in":"query","required":false,"schema":{"type":"number"},"description":"Default 25, at most 100"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"post":{"operationId":"postTasks","summary":"Create a task","description":"Plans a task: what, when it is due, how urgent, who owns it (you by default), and the records it is about. Pass parentTaskId to make it a sub-task.","tags":["Tasks"],"x-scope":"write","x-operation":"create_task","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","description":"What needs doing"},"due":{"type":"string","description":"Due date and time, ISO 8601, e.g. 2026-10-01T17:00:00+05:30"},"priority":{"type":"string","enum":["Low","Medium","High"],"description":"Default Medium"},"assignee":{"type":"string","description":"Who owns it, by member email or name. Default: you"},"body":{"type":"string","description":"Details"},"parentTaskId":{"type":"string","description":"Make it a sub-task inside this task; it then takes that task’s records"},"notify":{"type":"array","items":{"type":"string"},"description":"People to keep informed, by member email or name"},"contactId":{"type":"number","description":"The contact it is about"},"companyId":{"type":"number","description":"The company it is about"},"dealId":{"type":"number","description":"The deal it is about"},"records":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}}},"description":"Other records it is about, as { object, id } (custom objects too)"}},"required":["subject","due"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/tasks/{id}":{"get":{"operationId":"getTasksById","summary":"Get a task","description":"One task (or any activity) with everything logged inside it: its calls, meetings, emails, messages, notes and sub-tasks.","tags":["Tasks"],"x-scope":"read","x-operation":"get_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"patch":{"operationId":"patchTasksById","summary":"Update a task","description":"Changes a task or activity. Only what is passed changes. status: planned | in_progress | done | cancelled.","tags":["Tasks"],"x-scope":"write","x-operation":"update_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","description":"New subject"},"body":{"type":"string","description":"New details"},"due":{"type":"string","description":"New due date, ISO 8601 (tasks), or when it happened (other types)"},"priority":{"type":"string","enum":["Low","Medium","High"]},"status":{"type":"string","enum":["planned","in_progress","done","cancelled"]},"assignee":{"type":"string","description":"New owner, by member email or name"},"notify":{"type":"array","items":{"type":"string"},"description":"The full new list of people to keep informed, by email or name"},"details":{"type":"object","description":"Type fields to change"},"moveIntoTask":{"type":"string","description":"Move it inside this task; it then takes that task’s records"},"moveOutOfTask":{"type":"boolean","description":"Take it out of the task it is in, keeping its records"},"contactId":{"type":"number","description":"The contact it is about. Passing any record replaces what it is linked to"},"companyId":{"type":"number","description":"The company it is about. Passing any record replaces what it is linked to"},"dealId":{"type":"number","description":"The deal it is about. Passing any record replaces what it is linked to"},"records":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}}},"description":"Other records it is about, as { object, id } (custom objects too). Passing any record replaces what it is linked to"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}},"delete":{"operationId":"deleteTasksById","summary":"Delete a task","description":"Deletes a task or activity for good; a task takes everything logged inside it. Ask the person first, then call with confirm: true. Deleting is permanent.","tags":["Tasks"],"x-scope":"write","x-operation":"delete_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/tasks/{id}/complete":{"post":{"operationId":"postTasksByIdComplete","summary":"Complete a task","description":"Marks a task done.","tags":["Tasks"],"x-scope":"write","x-operation":"complete_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The record id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/schema":{"get":{"operationId":"getSchema","summary":"Get the workspace schema: objects, fields and their choices","description":"The workspace data model: every object and field (with types and choices), pipelines and stages, members, currency and today’s date.","tags":["Schema"],"x-scope":"read","x-operation":"get_schema","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/search_contacts":{"post":{"operationId":"search_contacts","summary":"Search contacts","description":"Finds contacts by name, email, phone, job title or company, optionally narrowed by status or owner. Returns compact rows with ids; use get_contact for everything about one.","tags":["Contacts and tasks"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Words to match in the name, email, phone, job title or company names"},"status":{"type":"string","description":"Only this lifecycle status"},"owner":{"type":"string","description":"Only contacts this member owns, by email or name"},"companyId":{"type":"number","description":"Only contacts at this company"},"limit":{"type":"number","description":"How many to return, default 20, at most 100"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_contact":{"post":{"operationId":"get_contact","summary":"Get contact","description":"Everything about one contact: their fields, companies, owner, and their latest activities and open tasks.","tags":["Contacts and tasks"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number","description":"Contact id"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_contact":{"post":{"operationId":"create_contact","summary":"Create contact","description":"Adds a contact. Needs a first name and an email or phone. Runs the workspace’s automations and duplicate check like a contact made in the app.","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email. A contact needs an email or a phone"},"phone":{"type":"string","description":"Phone, with country code"},"jobTitle":{"type":"string","description":"Job title"},"status":{"type":"string","description":"Lifecycle status, one of the choices get_schema lists for contacts.status"},"source":{"type":"string","description":"Where they came from, one of the choices get_schema lists for contacts.source"},"linkedin":{"type":"string","description":"LinkedIn profile URL"},"telegram":{"type":"string","description":"Telegram username, like @priya"},"country":{"type":"string","description":"Country they are based in, by name or two-letter code (India, IN)"},"state":{"type":"string","description":"Their state, province or region"},"city":{"type":"string","description":"Their city"},"owner":{"type":"string","description":"Owner, by member email or name"},"companyIds":{"type":"array","items":{"type":"number"},"description":"Companies they work with, by id (replaces the current set)"},"companyName":{"type":"string","description":"A company to link by exact name; made if the workspace has none by that name"},"custom":{"type":"object","description":"Custom field values by field key (keys from get_schema)"}},"required":["firstName"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_contact":{"post":{"operationId":"update_contact","summary":"Update contact","description":"Changes a contact. Only the fields passed change; companyName adds a company link, companyIds replaces the set.","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number","description":"Contact id"},"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email. A contact needs an email or a phone"},"phone":{"type":"string","description":"Phone, with country code"},"jobTitle":{"type":"string","description":"Job title"},"status":{"type":"string","description":"Lifecycle status, one of the choices get_schema lists for contacts.status"},"source":{"type":"string","description":"Where they came from, one of the choices get_schema lists for contacts.source"},"linkedin":{"type":"string","description":"LinkedIn profile URL"},"telegram":{"type":"string","description":"Telegram username, like @priya"},"country":{"type":"string","description":"Country they are based in, by name or two-letter code (India, IN)"},"state":{"type":"string","description":"Their state, province or region"},"city":{"type":"string","description":"Their city"},"owner":{"type":"string","description":"Owner, by member email or name"},"companyIds":{"type":"array","items":{"type":"number"},"description":"Companies they work with, by id (replaces the current set)"},"companyName":{"type":"string","description":"A company to link by exact name; made if the workspace has none by that name"},"custom":{"type":"object","description":"Custom field values by field key (keys from get_schema)"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_contact":{"post":{"operationId":"delete_contact","summary":"Delete contact","description":"Deletes a contact for good, with their notes and history. Ask the person first, then call with confirm: true.","tags":["Contacts and tasks"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number","description":"Contact id"},"confirm":{"type":"boolean","description":"True once the person has confirmed the delete"}},"required":["id","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_tasks":{"post":{"operationId":"list_tasks","summary":"List tasks","description":"Tasks, open ones by default: yours, everyone’s you can see, or those on one record. Also lists other activity types with type.","tags":["Contacts and tasks"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["mine","all"],"description":"Tasks you created or are on (default), or all you can see"},"status":{"type":"string","enum":["open","done","all"],"description":"Default open"},"type":{"type":"string","enum":["task","call","meeting","email","message","note","any"],"description":"Default task"},"overdue":{"type":"boolean","description":"Only those past due"},"dueBefore":{"type":"string","description":"Only those due before this ISO date"},"contactId":{"type":"number","description":"The contact it is about"},"companyId":{"type":"number","description":"The company it is about"},"dealId":{"type":"number","description":"The deal it is about"},"records":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}}},"description":"Other records it is about, as { object, id } (custom objects too)"},"limit":{"type":"number","description":"Default 25, at most 100"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_task":{"post":{"operationId":"get_task","summary":"Get task","description":"One task (or any activity) with everything logged inside it: its calls, meetings, emails, messages, notes and sub-tasks.","tags":["Contacts and tasks"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Task id, like act_…"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_task":{"post":{"operationId":"create_task","summary":"Create task","description":"Plans a task: what, when it is due, how urgent, who owns it (you by default), and the records it is about. Pass parentTaskId to make it a sub-task.","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","description":"What needs doing"},"due":{"type":"string","description":"Due date and time, ISO 8601, e.g. 2026-10-01T17:00:00+05:30"},"priority":{"type":"string","enum":["Low","Medium","High"],"description":"Default Medium"},"assignee":{"type":"string","description":"Who owns it, by member email or name. Default: you"},"body":{"type":"string","description":"Details"},"parentTaskId":{"type":"string","description":"Make it a sub-task inside this task; it then takes that task’s records"},"notify":{"type":"array","items":{"type":"string"},"description":"People to keep informed, by member email or name"},"contactId":{"type":"number","description":"The contact it is about"},"companyId":{"type":"number","description":"The company it is about"},"dealId":{"type":"number","description":"The deal it is about"},"records":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}}},"description":"Other records it is about, as { object, id } (custom objects too)"}},"required":["subject","due"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/log_activity":{"post":{"operationId":"log_activity","summary":"Log activity","description":"Logs a call, meeting, email, message or note on records, or inside a task (taskId). Fields by type: call: direction (Incoming | Outgoing), outcome (Connected | No answer | Left voicemail | Wrong number | Busy); meeting: locationOrLink, agenda, outcome; email: direction (Incoming | Outgoing), subject; message: channel (SMS | WhatsApp | LinkedIn | Telegram), direction (Incoming | Outgoing); note: none. Required choices left out are filled with sensible defaults (calls and emails: Outgoing).","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["call","meeting","email","message","note"]},"subject":{"type":"string","description":"Short title"},"body":{"type":"string","description":"What happened; required for a note"},"at":{"type":"string","description":"When, ISO 8601. Default now. A future time plans a meeting, call, email or message"},"durationMinutes":{"type":"number","description":"How long, for calls and meetings"},"details":{"type":"object","description":"This type’s own fields (see the description)"},"taskId":{"type":"string","description":"Log it inside this task; it then takes the task’s records"},"notify":{"type":"array","items":{"type":"string"},"description":"People to keep informed, by member email or name"},"private":{"type":"boolean","description":"Notes on a record only: visible to you alone"},"contactId":{"type":"number","description":"The contact it is about"},"companyId":{"type":"number","description":"The company it is about"},"dealId":{"type":"number","description":"The deal it is about"},"records":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}}},"description":"Other records it is about, as { object, id } (custom objects too)"}},"required":["type"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_task":{"post":{"operationId":"update_task","summary":"Update task","description":"Changes a task or activity. Only what is passed changes. status: planned | in_progress | done | cancelled.","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Task or activity id"},"subject":{"type":"string","description":"New subject"},"body":{"type":"string","description":"New details"},"due":{"type":"string","description":"New due date, ISO 8601 (tasks), or when it happened (other types)"},"priority":{"type":"string","enum":["Low","Medium","High"]},"status":{"type":"string","enum":["planned","in_progress","done","cancelled"]},"assignee":{"type":"string","description":"New owner, by member email or name"},"notify":{"type":"array","items":{"type":"string"},"description":"The full new list of people to keep informed, by email or name"},"details":{"type":"object","description":"Type fields to change"},"moveIntoTask":{"type":"string","description":"Move it inside this task; it then takes that task’s records"},"moveOutOfTask":{"type":"boolean","description":"Take it out of the task it is in, keeping its records"},"contactId":{"type":"number","description":"The contact it is about. Passing any record replaces what it is linked to"},"companyId":{"type":"number","description":"The company it is about. Passing any record replaces what it is linked to"},"dealId":{"type":"number","description":"The deal it is about. Passing any record replaces what it is linked to"},"records":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}}},"description":"Other records it is about, as { object, id } (custom objects too). Passing any record replaces what it is linked to"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_note":{"post":{"operationId":"update_note","summary":"Update note","description":"Changes a note on a record (ids like note_…, from get_contact). Only its author can.","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Note id"},"body":{"type":"string","description":"The new text"},"private":{"type":"boolean","description":"Visible to you alone"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_note":{"post":{"operationId":"delete_note","summary":"Delete note","description":"Deletes a note on a record for good. Ask the person first, then call with confirm: true.","tags":["Contacts and tasks"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Note id"},"confirm":{"type":"boolean","description":"True once the person has confirmed the delete"}},"required":["id","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/complete_task":{"post":{"operationId":"complete_task","summary":"Complete task","description":"Marks a task done.","tags":["Contacts and tasks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Task id"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_task":{"post":{"operationId":"delete_task","summary":"Delete task","description":"Deletes a task or activity for good; a task takes everything logged inside it. Ask the person first, then call with confirm: true.","tags":["Contacts and tasks"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Task or activity id"},"confirm":{"type":"boolean","description":"True once the person has confirmed the delete"}},"required":["id","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/search_records":{"post":{"operationId":"search_records","summary":"Search records","description":"Finds records of any object (companies, deals, contacts or a workspace object) by words in their name and fields, optionally narrowed by owner. Compact rows with ids; get_record has everything about one.","tags":["Records"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural (get_schema lists them)"},"query":{"type":"string","description":"Words to match"},"owner":{"type":"string","description":"Only records this member owns, by email or name"},"limit":{"type":"number","description":"How many, default 20, at most 100"}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_record":{"post":{"operationId":"get_record","summary":"Get record","description":"Everything about one record of any object: its fields, what it is linked to (companies, people, deals, parents and subsidiaries, workspace relationships), and its latest activity and notes.","tags":["Records"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural (get_schema lists them)"},"id":{"type":"number","description":"Record id"}},"required":["object","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_record":{"post":{"operationId":"create_record","summary":"Create record","description":"Adds a record of any object: a company, a deal (lands in the default pipeline unless pipeline or stage is given), a contact, or a workspace object. Runs automations and duplicate checks like the app.","tags":["Records"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural (get_schema lists them)"},"fields":{"type":"object","description":"Field values. Companies: name, domain, industry, companySize, country, state, city, phone, linkedin, icp. Deals: name, amount, closeDate (YYYY-MM-DD), source, nextStep, lostReason, pipeline and stage (by name), companyIds, contactIds. Contacts: firstName, lastName, email, phone, jobTitle, status, source, linkedin, telegram, country, state, city, companyIds. Any object: owner (member email or name) and custom: { field label or id: value }. On a workspace object, pass its fields by label directly."}},"required":["object","fields"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_record":{"post":{"operationId":"update_record","summary":"Update record","description":"Changes a record of any object. Only the fields passed change; a deal moves stage by passing stage (and pipeline if it is in several). companyIds and contactIds replace the set; link_records adds or removes one.","tags":["Records"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural (get_schema lists them)"},"id":{"type":"number","description":"Record id"},"fields":{"type":"object","description":"Field values. Companies: name, domain, industry, companySize, country, state, city, phone, linkedin, icp. Deals: name, amount, closeDate (YYYY-MM-DD), source, nextStep, lostReason, pipeline and stage (by name), companyIds, contactIds. Contacts: firstName, lastName, email, phone, jobTitle, status, source, linkedin, telegram, country, state, city, companyIds. Any object: owner (member email or name) and custom: { field label or id: value }. On a workspace object, pass its fields by label directly."}},"required":["object","id","fields"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_deal_split":{"post":{"operationId":"set_deal_split","summary":"Set deal split","description":"Shares credit on a deal between its owner and other members. members replaces the whole split: each member (email or name) with a whole-number percent; the owner is never listed and holds the rest (at least 1%). Pass an empty list to end the split. Only works while the deal’s pipeline has split credit on. Everyone on a split can see and edit the deal, and reports by owner credit each their share.","tags":["Records"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deal":{"type":"number","description":"Deal id"},"members":{"type":"array","description":"Who shares credit besides the owner","items":{"type":"object","properties":{"member":{"type":"string","description":"Member email or name"},"percent":{"type":"number","description":"Their share, 1 to 99"}},"required":["member","percent"],"additionalProperties":false}}},"required":["deal","members"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_record":{"post":{"operationId":"delete_record","summary":"Delete record","description":"Deletes a record of any object for good, with its notes and history. Ask the person first, then call with confirm: true.","tags":["Records"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural (get_schema lists them)"},"id":{"type":"number","description":"Record id"},"confirm":{"type":"boolean","description":"True once the person has confirmed the delete"}},"required":["object","id","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/link_records":{"post":{"operationId":"link_records","summary":"Link records","description":"Links two records: a contact to a company, a contact or company to a deal (with an optional role), a parent company (from) to a subsidiary (to), or any two records a workspace relationship joins (pass relationship when several do).","tags":["Records"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}},"required":["object","id"]},"to":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}},"required":["object","id"]},"role":{"type":"string","description":"A contact’s or company’s role on a deal, e.g. Decision maker"},"relationship":{"type":"string","description":"Which workspace relationship, by label or id, when several join the two"}},"required":["from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/unlink_records":{"post":{"operationId":"unlink_records","summary":"Unlink records","description":"Removes a link between two records (the records themselves stay). Same pairs as link_records.","tags":["Records"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}},"required":["object","id"]},"to":{"type":"object","properties":{"object":{"type":"string"},"id":{"type":"number"}},"required":["object","id"]},"relationship":{"type":"string","description":"Which workspace relationship, by label or id, when several join the two"}},"required":["from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_settings":{"post":{"operationId":"get_settings","summary":"Get settings","description":"How the workspace is set up: pipelines and their stages, objects, custom fields per object, the choices of standard fields (contact status, source, buying roles, company ICP), relationships, workspace settings (currency, fiscal year, business hours, stage time targets, file limits: maxFileMb and storageMb), automations, members and AI. Pass section to read just one.","tags":["Workspace settings"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"section":{"type":"string","enum":["pipelines","objects","fields","choices","relationships","workspace","automations","members","ai"]}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_pipeline":{"post":{"operationId":"create_pipeline","summary":"Create pipeline","description":"Adds a deal pipeline with its stages. Needs at least one open stage; won and lost stages close a deal.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Pipeline name"},"description":{"type":"string","description":"What it is for"},"stages":{"type":"array","items":{"type":"object"},"description":"The full list of stages, in order: { name, kind: open|won|lost, probability 0-100, color: gray|blue|green|yellow|orange|red|purple, targetHours (how long a deal should sit there) }. Keep a stage’s id (from get_settings) to rename it; a stage left out is removed (refused while open deals sit in it)."},"makeDefault":{"type":"boolean","description":"Make it the pipeline new deals land in"},"splitCredit":{"type":"boolean","description":"Let several people share credit on its deals (see set_deal_split)"}},"required":["name","stages"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_pipeline":{"post":{"operationId":"update_pipeline","summary":"Update pipeline","description":"Renames a pipeline or changes its stages. stages replaces the whole list: keep each stage’s id to rename it; stages matched by name keep their deals.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pipeline":{"type":"string","description":"Pipeline name or id"},"name":{"type":"string","description":"New name"},"description":{"type":"string","description":"New description"},"stages":{"type":"array","items":{"type":"object"},"description":"The full list of stages, in order: { name, kind: open|won|lost, probability 0-100, color: gray|blue|green|yellow|orange|red|purple, targetHours (how long a deal should sit there) }. Keep a stage’s id (from get_settings) to rename it; a stage left out is removed (refused while open deals sit in it)."},"splitCredit":{"type":"boolean","description":"Let several people share credit on its deals. Off keeps existing splits; they stop counting until it is on again"}},"required":["pipeline"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_default_pipeline":{"post":{"operationId":"set_default_pipeline","summary":"Set default pipeline","description":"Makes a pipeline the one new deals land in.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pipeline":{"type":"string","description":"Pipeline name or id"}},"required":["pipeline"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/archive_pipeline":{"post":{"operationId":"archive_pipeline","summary":"Archive pipeline","description":"Archives a pipeline (its deals and history stay; it can be restored) or restores one with archived: false. The last live pipeline can’t be archived.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pipeline":{"type":"string","description":"Pipeline name or id"},"archived":{"type":"boolean","description":"false to restore; default true"}},"required":["pipeline"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_object":{"post":{"operationId":"create_object","summary":"Create object","description":"Adds an object of the workspace’s own (like Projects or Tickets), with a required Name field to start. Add more fields with create_field, and join it to others with create_relationship.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Singular, e.g. Project"},"plural":{"type":"string","description":"Plural, e.g. Projects"},"icon":{"type":"string","enum":["box","folder","ticket","calendar","chart","tag","star","flag"]},"color":{"type":"string","description":"gray, blue, green, yellow, orange, red, purple"}},"required":["name","plural"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_object":{"post":{"operationId":"update_object","summary":"Update object","description":"Renames a workspace object or changes its icon, colour, or which fields name and describe its records.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"name":{"type":"string","description":"Singular"},"plural":{"type":"string","description":"Plural"},"icon":{"type":"string","enum":["box","folder","ticket","calendar","chart","tag","star","flag"]},"color":{"type":"string","description":"gray, blue, green, yellow, orange, red, purple"},"titleField":{"type":"string","description":"Field (label or id) that names a record"},"subtitleField":{"type":"string","description":"Field (label or id) shown under the name"}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/archive_object":{"post":{"operationId":"archive_object","summary":"Archive object","description":"Archives a workspace object (hidden, records kept, can be restored) or restores it with archived: false.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"archived":{"type":"boolean","description":"false to restore; default true"}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_object":{"post":{"operationId":"delete_object","summary":"Delete object","description":"Deletes a workspace object for good, with its fields and views. Only allowed once it has no records, relationships or automations. Ask the person first, then call with confirm: true.","tags":["Workspace settings"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["object","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_field":{"post":{"operationId":"create_field","summary":"Create field","description":"Adds a custom field to any object, built in or the workspace’s own. Types: text, longText, number, currency, percent, date, datetime, checkbox, singleSelect, multiSelect, email, phone, url, country, user. Select types need options.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"label":{"type":"string","description":"Field name, e.g. Contract value"},"type":{"type":"string","enum":["text","longText","number","currency","percent","date","datetime","checkbox","singleSelect","multiSelect","email","phone","url","country","user"]},"options":{"type":"array","items":{"type":"string"},"description":"Choices, for singleSelect and multiSelect"},"help":{"type":"string","description":"A line of help under the field"},"required":{"type":"boolean","description":"Every record must have it"},"unique":{"type":"boolean","description":"No two records may share a value (text, email, phone, url, number, currency, date)"},"defaultValue":{"description":"What new records start with"}},"required":["object","label","type"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_field":{"post":{"operationId":"update_field","summary":"Update field","description":"Changes a custom field’s label, help, required, unique or default. Its type can’t change. To rename or remove choices use set_field_choices; adding choices works here too.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"field":{"type":"string","description":"Field label or id"},"label":{"type":"string","description":"New label"},"help":{"type":"string","description":"Help line"},"required":{"type":"boolean","description":"Required"},"unique":{"type":"boolean","description":"Unique"},"defaultValue":{"description":"Default for new records"},"options":{"type":"array","items":{"type":"string"},"description":"Full list of choices (only adding; use set_field_choices to rename or remove)"}},"required":["object","field"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_field_choices":{"post":{"operationId":"set_field_choices","summary":"Set field choices","description":"Sets the choices of a select field: a custom single or multi select, or a standard one (contacts: status, source, buyingRoles; companies: icp). Records using a removed or renamed choice move through replacements: { old: new } (null clears them). Standard fields also take colours and a default.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"field":{"type":"string","description":"Field label or id, or status / source / buyingRoles / icp"},"choices":{"type":"array","items":{"type":"object"},"description":"The full list, in order: strings, or { value, color (gray, blue, green, yellow, orange, red, purple) }"},"replacements":{"type":"object","description":"Where records on an old choice go: { \"Old\": \"New\" or null }"},"defaultValue":{"type":"string","description":"Standard fields: the choice new records start with"}},"required":["object","field","choices"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/archive_field":{"post":{"operationId":"archive_field","summary":"Archive field","description":"Archives a custom field (hidden, values kept, can be restored) or restores it with archived: false. A field automations use needs force: true, which leaves those automations flagged.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"field":{"type":"string","description":"Field label or id"},"archived":{"type":"boolean","description":"false to restore; default true"},"force":{"type":"boolean","description":"Archive even though automations use it"}},"required":["object","field"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/arrange_fields":{"post":{"operationId":"arrange_fields","summary":"Arrange fields","description":"Shapes an object’s fields for everyone in the workspace: the order they appear in (record pages, forms, tables), standard fields to hide or show again, and standard fields to make required or optional. Fields are named by label or key. order may list just the fields that should come first; the rest keep their order after them. Hidden fields keep their data. Name, owner, stage, email and phone can’t be hidden; Crossing Edge’s own fields (created at and so on) can’t be required. Required is checked when people save (app, Claude, the assistant), not on leads captured automatically. Custom fields are required on the field itself (update_field) and archived rather than hidden.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"order":{"type":"array","items":{"type":"string"},"description":"Fields in the order they should appear, first first"},"hide":{"type":"array","items":{"type":"string"},"description":"Standard fields to hide"},"show":{"type":"array","items":{"type":"string"},"description":"Hidden standard fields to show again"},"require":{"type":"array","items":{"type":"string"},"description":"Standard fields to make required"},"optional":{"type":"array","items":{"type":"string"},"description":"Standard fields to make optional again"}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_field":{"post":{"operationId":"delete_field","summary":"Delete field","description":"Deletes an archived custom field and every value it holds, permanently. It cannot be undone, so always ask the person first and only then call with confirm: true. Without confirm it reports what would be erased (records holding a value) and anything still using the field (automations, reports, calculated fields, stage timing), which must be changed first. Archive the field with archive_field before deleting it. Standard fields are never deleted: hide them with arrange_fields.","tags":["Workspace settings"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"field":{"type":"string","description":"Custom field label or id"},"confirm":{"type":"boolean","description":"true only after the person has agreed to erase it for good"}},"required":["object","field"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_relationship":{"post":{"operationId":"create_relationship","summary":"Create relationship","description":"Joins two objects so their records can be linked, e.g. companies ↔ Projects. Each side gets its own label: what the other side is called when read from it.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"to":{"type":"string","description":"contacts, companies, deals, or a workspace object by id, name or plural"},"fromLabel":{"type":"string","description":"What a from record calls its linked to records, e.g. Projects"},"toLabel":{"type":"string","description":"What a to record calls its linked from records, e.g. Account"},"manyTo":{"type":"boolean","description":"A from record may hold several to records (default true)"},"manyFrom":{"type":"boolean","description":"A to record may be held by several from records (default true)"}},"required":["from","to","fromLabel","toLabel"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_relationship":{"post":{"operationId":"update_relationship","summary":"Update relationship","description":"Renames a relationship’s labels or changes whether each side may hold several records.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relationship":{"type":"string","description":"Relationship id or either label"},"fromLabel":{"type":"string","description":"New from label"},"toLabel":{"type":"string","description":"New to label"},"manyTo":{"type":"boolean","description":"manyTo"},"manyFrom":{"type":"boolean","description":"manyFrom"},"showReverse":{"type":"boolean","description":"Show it on the to side too"}},"required":["relationship"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/archive_relationship":{"post":{"operationId":"archive_relationship","summary":"Archive relationship","description":"Archives a relationship (hidden, links kept, can be restored) or restores it with archived: false.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relationship":{"type":"string","description":"Relationship id or either label"},"archived":{"type":"boolean","description":"false to restore; default true"}},"required":["relationship"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_relationship":{"post":{"operationId":"delete_relationship","summary":"Delete relationship","description":"Deletes a relationship for good. Only allowed once no records are linked through it. Ask the person first, then call with confirm: true.","tags":["Workspace settings"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relationship":{"type":"string","description":"Relationship id or either label"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["relationship","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_workspace_settings":{"post":{"operationId":"update_workspace_settings","summary":"Update workspace settings","description":"Changes workspace-wide settings: its name, currency (USD, EUR, GBP, INR, …), fiscal year start month, business hours for stage clocks, stage time targets for contact statuses ({ \"contacts.status.Working\": 48 } hours; 0 removes), which statuses make the funnel, which select field a record’s stage clock follows, and the file limits: the largest file anyone may upload (maxFileMb, 1 to 25 MB, default 5) and all the workspace’s files together (storageMb, 100 to 5120 MB, default 1024). Lowering a file limit keeps files already stored; only new uploads are checked.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Workspace name"},"currency":{"type":"string","description":"ISO currency code"},"fiscalYearStart":{"type":"number","description":"Month the fiscal year starts, 1-12"},"businessHours":{"type":"object","description":"{ mode: 'calendar' | 'business', days: [1..5] (0 is Sunday), startMinute: 540, endMinute: 1080, timezone: 'Asia/Kolkata' }"},"targets":{"type":"object","description":"Hours allowed per stage, keyed object.field.value"},"funnel":{"type":"array","items":{"type":"string"},"description":"Contact statuses in funnel order"},"tracks":{"type":"object","description":"Which select field each object’s stage clock follows, e.g. { contacts: \"status\" }"},"maxFileMb":{"type":"number","description":"The largest file anyone may upload, in MB: 1 to 25"},"storageMb":{"type":"number","description":"All the workspace’s files together, in MB: 100 to 5120 (5 GB)"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_automation":{"post":{"operationId":"create_automation","summary":"Create automation","description":"Adds an automation: a rule that acts when records are created or change. An automation: { name, object (contacts, companies, deals, a workspace object, or activities), enabled, triggers: [{ kind: 'created' } | { kind: 'changed', field, to? } | { kind: 'overdue', days } (activities only)], conditions: [{ key, values? | text? | min?, max? }], tree: [node] }.\nActivities (object 'activities') are tasks, calls, meetings, emails, messages and notes: filter by type (task, call, meeting, email, message, note) and status (planned, in_progress, done, cancelled); other fields: subject, body, at (due date), overdueDays, ownerId (the assignee), createdBy, completedAt, linkedTo (contacts, companies, deals), contactOwnerId, companyOwnerId, dealOwnerId, dealStage. { kind: 'overdue', days: 2 } runs once per activity still to do, 2 whole days past its due date (checked every 15 minutes). On an activity: owner reassigns it (who: owner = current assignee, creator, a user, or { kind: 'field', field: 'dealOwnerId' } for the linked deal's owner); set changes status, subject, body or at (at may be a when, e.g. { kind: 'in', amount: 2, unit: 'days' }); activity and note steps land on the records the activity is on; related { from: contacts | companies | deals } reaches those records; link is not available. A node is { id, kind, config, children: [] }; kinds and their config:\n- condition { filters: [{ key, values? }] } (children run only when it matches)\n- activity { type: task|call|meeting|email|message|note, subject (body for a note), who?: { kind: owner|creator } | { kind: 'user', userId }, when?: { kind: 'in', amount, unit: hours|days|weeks, skipWeekends? } }\n- note { body }\n- set { field, value }\n- owner { who }: who is { kind: 'owner' } | { kind: 'creator' } | { kind: 'user', userId } | { kind: 'field', field } (a user field on the record) | { kind: 'rotate', id, userIds: [...] } (take turns, fair over time, skipping anyone who left; id is any short unique name like 'rot_inbound', and keeping it keeps the place in the turn) | { kind: 'rules', rules: [{ when: [{ key, values }], then: who }], otherwise: who } (first match wins; inside rules { kind: 'user', userId: 0 } means nobody, so the record stays unassigned). This is how leads get assigned: webhook leads arrive unassigned and their source is the webhook's name.\n- record { object, title (may use {{field}}), values?, pipelineId?, stageId? }: object is a standard object or a workspace object's id (obj_…, from get_schema); title becomes the new record's name. values must set every field that object marks required and has no default, or the rule is refused. The new record is attached to the one that started the rule (contacts, companies and deals directly; other objects through a relationship between the two).\n- related { from, relationshipId?, direction? } (its children act on the related record)\n- link { from, recordId, relationshipId?, mode?: 'unlink' }\nLead assignment example: { name: 'Assign inbound leads', object: 'contacts', triggers: [{ kind: 'created' }], conditions: [{ key: 'source', values: ['Website form'] }], tree: [{ id: 'n1', kind: 'owner', config: { who: { kind: 'rules', rules: [{ when: [{ key: 'city', values: ['Chennai'] }], then: { kind: 'user', userId: 12 } }], otherwise: { kind: 'rotate', id: 'rot_inbound', userIds: [12, 15] } } }, children: [] }] }.\nExample: { name: 'Call new leads', object: 'contacts', triggers: [{ kind: 'created' }], conditions: [], tree: [{ id: 'n1', kind: 'activity', config: { type: 'task', subject: 'Call {{firstName}}', who: { kind: 'owner' }, when: { kind: 'in', amount: 1, unit: 'days' } }, children: [] }] }. Try it with test_automation before switching it on.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"object","description":"The automation, as described above"}},"required":["automation"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_automation":{"post":{"operationId":"update_automation","summary":"Update automation","description":"Changes an automation: pass only what changes (name, enabled, triggers, conditions, tree). enabled: false switches it off without deleting it.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"string","description":"Automation name or id"},"changes":{"type":"object","description":"Fields to change, same shape as create_automation"}},"required":["automation","changes"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/test_automation":{"post":{"operationId":"test_automation","summary":"Test automation","description":"Dry-runs an automation over existing records: which would match, why, and what it would do. Changes nothing.","tags":["Workspace settings"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"string","description":"Automation name or id"},"limit":{"type":"number","description":"How many records to try, default 20, at most 50"}},"required":["automation"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_automation":{"post":{"operationId":"delete_automation","summary":"Delete automation","description":"Deletes an automation and its run history for good (update_automation with enabled: false just switches it off). Ask the person first, then call with confirm: true.","tags":["Workspace settings"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"string","description":"Automation name or id"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["automation","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/add_member":{"post":{"operationId":"add_member","summary":"Add member","description":"Invites someone to the workspace by email (or phone): they are added straight away and emailed an invite with a Join button (notify: false to add them quietly). Role: member (default) or admin; permissions: a preset (full, standard, own, readOnly) or leave it to the workspace default. The answer says whether the invite went out.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Their email or phone"},"name":{"type":"string","description":"Their name"},"role":{"type":"string","enum":["member","admin"]},"permissions":{"type":"string","description":"Preset: full, standard, own or readOnly"},"notify":{"type":"boolean","description":"Email them an invite (default true)"}},"required":["email"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/resend_invite":{"post":{"operationId":"resend_invite","summary":"Resend invite","description":"Emails someone who was added but hasn’t signed in yet their invite again.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"string","description":"Member email or name"}},"required":["member"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_member":{"post":{"operationId":"update_member","summary":"Update member","description":"Changes a member’s role (member or admin) or what they can do: a preset (full, standard, own, readOnly), \"default\" for the workspace default, or a full permissions object.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"string","description":"Member email or name"},"role":{"type":"string","enum":["member","admin"]},"permissions":{"description":"Preset name, \"default\", or a permissions object"}},"required":["member"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/remove_member":{"post":{"operationId":"remove_member","summary":"Remove member","description":"Removes someone from the workspace; the records they own stay. Ask the person first, then call with confirm: true.","tags":["Workspace settings"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"string","description":"Member email or name"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["member","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_ai_settings":{"post":{"operationId":"update_ai_settings","summary":"Update AI settings","description":"Switches AI duplicate detection on or off. Switching on can also check existing contacts and companies from a date (YYYY-MM-DD) or all of them.","tags":["Workspace settings"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"duplicates":{"type":"boolean","description":"Detect duplicates"},"backfillSince":{"type":"string","description":"'all' or YYYY-MM-DD: check existing records too"}},"required":["duplicates"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/find_duplicates":{"post":{"operationId":"find_duplicates","summary":"Find duplicates","description":"Finds duplicate contacts or companies. With an id: checks that record now (AI, when the workspace has it on) and lists its lookalikes. Without one: every open AI suggestion plus exact lookalikes (same name, email, phone or website) across the workspace, most likely first. Follow with merge_preview and merge_records, or dismiss_duplicate.","tags":["Insights and history"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["contacts","companies"],"description":"contacts or companies"},"id":{"type":"number","description":"One record to check"},"limit":{"type":"number","description":"How many pairs, default 30, at most 200"}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/scan_duplicates":{"post":{"operationId":"scan_duplicates","summary":"Scan for duplicates","description":"Runs the AI duplicate check over existing contacts and companies (all of them, or those created since a date), in the background. Switches AI duplicate detection on for the workspace. Owners and admins. Pairs already judged are skipped, so re-running is cheap; call find_duplicates afterwards.","tags":["Insights and history"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","description":"'all' (default) or YYYY-MM-DD"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/dismiss_duplicate":{"post":{"operationId":"dismiss_duplicate","summary":"Dismiss duplicate","description":"Marks two records as not duplicates, so the pair stops being suggested.","tags":["Insights and history"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["contacts","companies"],"description":"contacts or companies"},"a":{"type":"number","description":"One record id"},"b":{"type":"number","description":"The other record id"}},"required":["object","a","b"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/merge_preview":{"post":{"operationId":"merge_preview","summary":"Merge preview","description":"Shows what merging two contacts or companies would do before doing it: which values the kept record keeps or takes from the duplicate (with the choices per field), and the deals, activities, notes, links and history that move over. Show this to the person before merge_records.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["contacts","companies"],"description":"contacts or companies"},"keep":{"type":"number","description":"Id of the record that stays"},"remove":{"type":"number","description":"Id of the duplicate folded into it and then deleted"}},"required":["object","keep","remove"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/merge_records":{"post":{"operationId":"merge_records","summary":"Merge records","description":"Merges a duplicate contact or company into the one that stays: its deals, activities, notes, links, people and history move over, chosen field values are copied, and the duplicate is deleted. Defaults match the app (the kept value wins, blanks are filled, companies are kept from both). Override per field with choices: { field: existing | incoming | both }. Can’t be undone: show merge_preview, ask the person, then call with confirm: true.","tags":["Insights and history"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["contacts","companies"],"description":"contacts or companies"},"keep":{"type":"number","description":"Id of the record that stays"},"remove":{"type":"number","description":"Id of the duplicate"},"choices":{"type":"object","description":"Per field, from merge_preview: \"existing\" keeps the kept record’s value, \"incoming\" takes the duplicate’s, \"both\" keeps both companies"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["object","keep","remove","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_history":{"post":{"operationId":"get_history","summary":"Get history","description":"A record’s change history, newest first: who created, changed (field by field, from and to), linked, merged or deleted things, and when. Any object. Page with before.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Any object"},"id":{"type":"number","description":"Record id"},"limit":{"type":"number","description":"How many, default 20, at most 100"},"before":{"type":"string","description":"The cursor from the previous page"}},"required":["object","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_stage_times":{"post":{"operationId":"get_stage_times","summary":"Get stage times","description":"How long a record has spent in each stage (deal pipeline stages, or a contact’s status), counting business hours when the workspace uses them: where it is now, for how long, against the target, and every stage it passed through.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Any object with a stage: deals, contacts, …"},"id":{"type":"number","description":"Record id"}},"required":["object","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_overdue":{"post":{"operationId":"list_overdue","summary":"List overdue","description":"Records that have sat in their stage past its target (overdue) or are close to it (due soon), longest over first. Only records you can see.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Only this object (deals, contacts, …)"},"include":{"type":"string","enum":["overdue","dueSoon","both"],"description":"Default overdue"},"limit":{"type":"number","description":"How many, default 30"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_insights":{"post":{"operationId":"get_insights","summary":"Get insights","description":"The Insights page as data: leads and conversion, won value, win rate, time to win, the funnel, segments, execution, what needs attention, and observations, for a period against the one before. Owners and admins.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string","enum":["week","month","quarter","year","custom"],"description":"Default month"},"year":{"type":"number","description":"Year"},"quarter":{"type":"number","description":"1-4"},"from":{"type":"string","description":"custom: first day, YYYY-MM-DD"},"to":{"type":"string","description":"custom: last day, YYYY-MM-DD"},"pipeline":{"type":"string","description":"Pipeline name or id"},"filters":{"type":"array","items":{"type":"object"},"description":"Deal filters: [{ key, values? | text? | min?, max? }]"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_spend":{"post":{"operationId":"get_spend","summary":"Get spend","description":"Marketing spend by source and month, as entered for Insights. Owners and admins.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_spend":{"post":{"operationId":"set_spend","summary":"Set spend","description":"Records what was spent on a lead source in a month (amount 0 means nothing was spent; null clears it back to unknown). Owners and admins.","tags":["Insights and history"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","description":"Lead source, as in contact sources"},"month":{"type":"string","description":"YYYY-MM"},"amount":{"type":["number","null"],"description":"Amount in the workspace currency, or null for unknown"}},"required":["source","month","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_automation_runs":{"post":{"operationId":"get_automation_runs","summary":"Get automation runs","description":"What automations actually did, newest first: which record, whether it matched, what it did, and any error. One automation or all.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"string","description":"Automation name or id; all when left out"},"failedOnly":{"type":"boolean","description":"Only runs with an error"},"limit":{"type":"number","description":"How many, default 30, at most 200"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_views":{"post":{"operationId":"list_views","summary":"List views","description":"Saved list views: yours and the shared ones, with their filters, sort and hidden columns, and which one opens by default for you.","tags":["Insights and history"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Only views of this object"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/save_view":{"post":{"operationId":"save_view","summary":"Save view","description":"Saves a list view, or changes one (pass view). filters: [{ key, values? | text? | min?, max? }] with field keys from get_schema; sort: { id: field key, dir: asc | desc }; hidden: column keys to hide; cardFields: what each card shows on the board, as field keys in order (at most 5; timeInStage = time in the current stage; a field of a linked record as <relation field>.<field>, e.g. companyIds.industry on deals; [] for just the name); shared: everyone sees it (needs the share-views permission).","tags":["Insights and history"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Object the view lists"},"view":{"type":"string","description":"An existing view’s name or id, to change it"},"name":{"type":"string","description":"View name"},"filters":{"type":"array","items":{"type":"object"}},"sort":{"type":"object","description":"{ id, dir }"},"hidden":{"type":"array","items":{"type":"string"}},"cardFields":{"type":"array","items":{"type":"string"},"description":"Field keys shown on board cards, in order, at most 5; companyIds.industry reads the linked company"},"shared":{"type":"boolean","description":"Share with the workspace"},"makeDefault":{"type":"boolean","description":"Open this view by default for you"}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_default_view":{"post":{"operationId":"set_default_view","summary":"Set default view","description":"Which view a list opens on for you: a saved view by name or id, a built-in one (all, mine, leads, open), or null for the page default.","tags":["Insights and history"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Object"},"view":{"type":["string","null"],"description":"View name or id, a built-in id, or null"}},"required":["object","view"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_view":{"post":{"operationId":"delete_view","summary":"Delete view","description":"Deletes a saved view (the records it lists are untouched). A shared view disappears for everyone.","tags":["Insights and history"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"string","description":"View name or id"},"object":{"type":"string","description":"Its object, when names repeat across objects"}},"required":["view"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_report":{"post":{"operationId":"delete_report","summary":"Delete report","description":"Deletes a report for good (its author, or an owner or admin). Ask the person first, then call with confirm: true.","tags":["Insights and history"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"string","description":"Report id or name"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["report","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_email_conversations":{"post":{"operationId":"list_email_conversations","summary":"List email conversations","description":"Email conversations brought in by Gmail sync or logged by hand: subject, people, how many emails, the newest one, its AI brief and whether it needs a reply. The workspace’s (as far as the person can see), only their own inboxes with mine: true, or one record’s.","tags":["Email"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mine":{"type":"boolean","description":"Only conversations from the person’s own inboxes"},"q":{"type":"string","description":"Search subject, people and text"},"record":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object id"},"id":{"type":"number","description":"Record id"}},"required":["object","id"],"additionalProperties":false,"description":"Only the ones on this record"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/read_email_conversation":{"post":{"operationId":"read_email_conversation","summary":"Read email conversation","description":"One email conversation, oldest first: each email’s sender, recipients and own text (quoted history cut), the brief, the records it is on, and whether the person can reply from Crossing Edge (from which of their inboxes, and who Reply and Reply all go to).","tags":["Email"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Conversation key from list_email_conversations"}},"required":["key"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/draft_email_reply":{"post":{"operationId":"draft_email_reply","summary":"Draft email reply","description":"Drafts the person’s reply to an email conversation in their own writing style (learned from the email they send), with their signature on the end. Nothing is sent: show them the draft, let them change it, then send_email_reply. Facts the thread does not give are left as [placeholders] to fill in.","tags":["Email"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Conversation key"},"all":{"type":"boolean","description":"Reply all rather than reply"}},"required":["key"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/send_email_reply":{"post":{"operationId":"send_email_reply","summary":"Send email reply","description":"Sends a reply to an email conversation through the person’s own Gmail, threaded under it, and keeps it in the conversation. Recipients default to Reply (or Reply all with all: true); to, cc and bcc replace them. It goes to people outside the workspace: show the person the text and recipients, then call with confirm: true. Attachments are added in the app.","tags":["Email"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Conversation key"},"text":{"type":"string","description":"The message, plain text"},"all":{"type":"boolean","description":"Reply all: everyone else on the thread too"},"to":{"type":"array","items":{"type":"string"},"description":"Email addresses to send to (replaces the default)"},"cc":{"type":"array","items":{"type":"string"},"description":"Cc addresses (replaces the default)"},"bcc":{"type":"array","items":{"type":"string"},"description":"Bcc addresses"},"subject":{"type":"string","description":"Subject (default Re: the conversation’s)"},"inbox":{"type":"string","description":"Which of the person’s inboxes to send from (default the one it came through)"},"confirm":{"type":"boolean","description":"True once the person has seen it and said send"}},"required":["key","text","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_writing_profile":{"post":{"operationId":"get_writing_profile","summary":"Get writing profile","description":"How the person writes their email, as Crossing Edge learned it from what they send (tone, length, greeting, sign-off, phrases, what they avoid), and the emails they pasted in to learn from. Private to them.","tags":["Email"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/relearn_writing_profile":{"post":{"operationId":"relearn_writing_profile","summary":"Learn writing style again","description":"Learns the person’s writing profile again now, from their latest sent email and pasted samples.","tags":["Email"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/add_writing_sample":{"post":{"operationId":"add_writing_sample","summary":"Add writing sample","description":"Teaches the person’s writing profile from an email they wrote, pasted whole (up to 5 kept). Use their own email only, as they sent it.","tags":["Email"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"An email the person wrote, whole"}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_email_signature":{"post":{"operationId":"set_email_signature","summary":"Set email signature","description":"The signature added to the end of the person’s drafted replies: text to use word for word (line breaks kept; \"\" for no signature), or null to go back to the one found at the end of their emails.","tags":["Email"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":["string","null"],"description":"The signature, or \"\" for none, or null for the one in their email"}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/remove_writing_sample":{"post":{"operationId":"remove_writing_sample","summary":"Remove writing sample","description":"Removes one of the emails the person pasted into their writing profile, by its index from get_writing_profile.","tags":["Email"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"number","description":"Index from get_writing_profile"}},"required":["index"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/forget_writing_profile":{"post":{"operationId":"forget_writing_profile","summary":"Forget writing profile","description":"Forgets what was learned about how the person writes, and the emails they pasted. It learns again from the next emails they send. Ask the person first, then call with confirm: true.","tags":["Email"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_gmail":{"post":{"operationId":"get_gmail","summary":"Get Gmail","description":"The person’s own connected Gmail inboxes: address, status, last check, problems, how much was brought in, and how many emails wait in each Review. Connecting an inbox needs a Gmail app password, typed in Settings › Email, never in a chat.","tags":["Gmail sync"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_gmail_brought_in":{"post":{"operationId":"list_gmail_brought_in","summary":"List emails brought in","description":"Emails Gmail sync brought into the CRM from one of the person’s inboxes: when, which way, why, and the records each was logged on.","tags":["Gmail sync"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"inbox":{"type":"string","description":"Inbox address or id (optional when there is one)"},"days":{"type":"number","description":"How many days back (default 7)"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_gmail_status":{"post":{"operationId":"set_gmail_status","summary":"Pause or resume Gmail","description":"Pauses or resumes Gmail sync for one of the person’s inboxes.","tags":["Gmail sync"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inbox":{"type":"string","description":"Inbox address or id (optional when there is one)"},"status":{"type":"string","enum":["paused","active"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/check_gmail_now":{"post":{"operationId":"check_gmail_now","summary":"Check Gmail now","description":"Reads new mail in one of the person’s inboxes now, rather than waiting for the next minute.","tags":["Gmail sync"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"inbox":{"type":"string","description":"Inbox address or id (optional when there is one)"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/disconnect_gmail":{"post":{"operationId":"disconnect_gmail","summary":"Disconnect Gmail","description":"Disconnects one of the person’s own inboxes; emails already brought in stay. Ask the person first, then call with confirm: true.","tags":["Gmail sync"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inbox":{"type":"string","description":"Inbox address or id (optional when there is one)"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_team_inboxes":{"post":{"operationId":"list_team_inboxes","summary":"List team inboxes","description":"Owners and admins: every member’s connected Gmail inbox (address, status, last check). Never their mail.","tags":["Gmail sync"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/disconnect_team_inbox":{"post":{"operationId":"disconnect_team_inbox","summary":"Disconnect a member’s inbox","description":"Owners and admins: disconnects a member’s Gmail inbox, by its id from list_team_inboxes. Ask the person first, then call with confirm: true.","tags":["Gmail sync"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Inbox id"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["id","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_email_review":{"post":{"operationId":"list_email_review","summary":"List emails to review","description":"Emails waiting in the person’s own Review page (the ones Jev was unsure about: maybe not sales, maybe private, many people): who, subject, snippet and why. Only ever their own inbox.","tags":["Gmail sync"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"inbox":{"type":"string","description":"Inbox address or id (optional: all of theirs)"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/read_review_email":{"post":{"operationId":"read_review_email","summary":"Read email to review","description":"One email waiting in the person’s Review, in full, by its id from list_email_review.","tags":["Gmail sync"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Email id"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/bring_in_review_emails":{"post":{"operationId":"bring_in_review_emails","summary":"Bring emails into the CRM","description":"Brings emails from the person’s Review into the CRM: logged on the people (and their companies) outside the team, creating contacts where needed. By id from list_email_review.","tags":["Gmail sync"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"Email ids"}},"required":["ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/dismiss_review_emails":{"post":{"operationId":"dismiss_review_emails","summary":"Dismiss emails","description":"Dismisses emails from the person’s Review: they never come into the CRM and their copy is deleted. By id from list_email_review. Ask the person first, then call with confirm: true.","tags":["Gmail sync"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"Email ids"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["ids","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_telegram":{"post":{"operationId":"get_telegram","summary":"Get Telegram","description":"The person’s Telegram in Crossing Edge: the workspace bot, whether their account is linked (and the link to do it), their Business chatbot and personal account, their filters, the groups the bot is in, and how many chats are tracked or waiting. Bot tokens, app keys and phone sign-in stay in Settings › Telegram, never in a chat.","tags":["Telegram"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_telegram_filters":{"post":{"operationId":"set_telegram_filters","summary":"Set Telegram filters","description":"The person’s own Telegram filters. onlySalesChats: only chats Jev judges to be sales come in (off: every chat). holdPrivateMessages: messages that look private wait for them before they come in (off: everything comes straight in).","tags":["Telegram"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"onlySalesChats":{"type":"boolean","description":"Only sales chats come in"},"holdPrivateMessages":{"type":"boolean","description":"Private-looking messages wait for you"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_telegram_chats":{"post":{"operationId":"list_telegram_chats","summary":"List Telegram chats","description":"Telegram chats brought into Crossing Edge (1:1 Business chats, groups with the workspace bot, personal account chats): people, last message, AI brief, linked records. The workspace’s tracked chats as far as the person can see; mine: true for their own; review: true for their chats waiting on them; ignored: true for ones they ignored; or one record’s.","tags":["Telegram"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mine":{"type":"boolean","description":"Only the person’s own chats"},"q":{"type":"string","description":"Search"},"kind":{"type":"string","enum":["private","group"]},"review":{"type":"boolean","description":"Their chats waiting for them to track or ignore"},"ignored":{"type":"boolean","description":"Chats they ignored"},"record":{"type":"object","properties":{"object":{"type":"string","description":"contacts, companies, deals, or a workspace object id"},"id":{"type":"number","description":"Record id"}},"required":["object","id"],"additionalProperties":false,"description":"Only the ones on this record"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/read_telegram_chat":{"post":{"operationId":"read_telegram_chat","summary":"Read Telegram chat","description":"One Telegram chat with its messages, oldest first, and whether the person can reply to it from Crossing Edge (as themselves in a Business chat, or through the workspace bot in a group). Held private messages show only to their owner.","tags":["Telegram"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Chat id from list_telegram_chats"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/reply_telegram_chat":{"post":{"operationId":"reply_telegram_chat","summary":"Reply on Telegram","description":"Replies in one of the person’s own Telegram chats: as them in a Business chat, through the workspace bot (with their name) in a group. It goes to people outside the workspace: show the person the text, then call with confirm: true.","tags":["Telegram"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Chat id"},"text":{"type":"string","description":"The message"},"confirm":{"type":"boolean","description":"True once the person has seen it and said send"}},"required":["id","text","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_telegram_chat_status":{"post":{"operationId":"set_telegram_chat_status","summary":"Track or ignore a Telegram chat","description":"Tracks one of the person’s Telegram chats (its messages come into the CRM) or ignores it (nothing more comes in; it can be tracked again).","tags":["Telegram"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Chat id"},"status":{"type":"string","enum":["tracked","ignored"]}},"required":["id","status"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/link_telegram_chat":{"post":{"operationId":"link_telegram_chat","summary":"Link Telegram chat","description":"Links one of the person’s Telegram chats to a record, so its messages show there: an existing contact, company, deal or workspace record (object + recordId), or a new contact made for someone in the chat (newContact). Linking a contact sets their Telegram handle and source Telegram.","tags":["Telegram"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Chat id"},"object":{"type":"string","description":"contacts, companies, deals, or a workspace object id"},"recordId":{"type":"number","description":"Record id"},"newContact":{"type":"object","additionalProperties":false,"description":"Make a contact and link it. person: who in the chat (their name, @username or tgUserId; optional in a 1:1 chat)","properties":{"person":{"type":"string","description":"Who in the chat"},"firstName":{"type":"string","description":"First name (default their Telegram name)"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Their real email, if known"},"phone":{"type":"string","description":"Phone"}}}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/unlink_telegram_chat":{"post":{"operationId":"unlink_telegram_chat","summary":"Unlink Telegram chat","description":"Takes a record off one of the person’s Telegram chats; its messages stop showing there.","tags":["Telegram"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Chat id"},"object":{"type":"string","description":"Record object"},"recordId":{"type":"number","description":"Record id"}},"required":["id","object","recordId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/settle_held_telegram_message":{"post":{"operationId":"settle_held_telegram_message","summary":"Bring in or dismiss a held message","description":"A message held back as private in one of the person’s chats: bring: true brings it into the CRM, false dismisses it for good. By messageId from read_telegram_chat.","tags":["Telegram"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Chat id"},"messageId":{"type":"number","description":"Message id"},"bring":{"type":"boolean","description":"True to bring it in, false to dismiss it"}},"required":["id","messageId","bring"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_telegram_connections":{"post":{"operationId":"list_telegram_connections","summary":"List Telegram connections","description":"Owners and admins: who in the workspace has connected Telegram (linked account, Business chatbot, personal account, groups) and which filters they turned off. Never their chats.","tags":["Telegram"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_webhooks":{"post":{"operationId":"list_webhooks","summary":"List webhooks","description":"The workspace’s incoming webhooks: addresses forms and tools post leads to. Each one’s status, address, the fields it has seen, and how many leads came in. Setting one up (mapping its fields) is done in Settings › Integrations › Webhooks.","tags":["Webhooks"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_webhook_log":{"post":{"operationId":"get_webhook_log","summary":"Get webhook log","description":"One webhook’s recent posts, newest first: what each lead said, and whether it made a new contact, updated one, waited, or failed and why.","tags":["Webhooks"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id (optional when there is one)"},"limit":{"type":"number","description":"How many (default 20)"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_webhook_status":{"post":{"operationId":"set_webhook_status","summary":"Pause or resume a webhook","description":"Pauses a webhook (leads wait in its log) or turns it back on (the waiting ones go in).","tags":["Webhooks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id"},"status":{"type":"string","enum":["paused","active"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_webhook":{"post":{"operationId":"create_webhook","summary":"Create webhook","description":"Makes a new webhook: an address a form or tool posts leads to. It starts out listening: posts are kept as tests and nothing is written. Give the person the address to paste into their tool, ask them to send one lead, then call map_webhook.","tags":["Webhooks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Where the leads come from, like “Website form”. New contacts get it as their source."}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/map_webhook":{"post":{"operationId":"map_webhook","summary":"Map and turn on a webhook","description":"Maps a webhook’s fields (from the tests it has received) onto contact and company fields, sets values every lead gets, and turns it on; on a live one it saves the change. Fields not given are matched by AI, as an import’s columns are. Leads arrive unassigned and the workspace’s automations always run on them: assign leads with an automation on new contacts (create_automation, owner step).","tags":["Webhooks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id"},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"Payload field (as list_webhooks shows it, e.g. \"lead.email\") → \"contacts:email\", \"Contact · Email\", \"skip\", or \"new:Budget\" for a new contact field. Unlisted fields are matched by AI."},"values":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Field key or label, e.g. contacts:source"},"value":{"type":"string","description":"Value"}},"required":["field","value"],"additionalProperties":false},"description":"Values every lead gets. Defaults to the source set to the webhook’s name."},"onExisting":{"type":"string","enum":["fill","overwrite","skip"],"description":"A contact already in the CRM (same email or phone): fill its blanks (default), overwrite, or leave it"},"companyFromDomain":{"type":"boolean","description":"Find or add the company from a work email (default true; free mail never makes one)"},"name":{"type":"string","description":"A new name for it"}},"required":["webhook"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/preview_webhook":{"post":{"operationId":"preview_webhook","summary":"Preview a webhook lead","description":"What a webhook’s latest post would become, written nowhere: the fields it would set, the contact it would update (same email or phone), the company its email finds or makes, and the automations that run.","tags":["Webhooks"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/run_webhook_post_again":{"post":{"operationId":"run_webhook_post_again","summary":"Run a webhook post again","description":"Runs one post from a webhook’s log again (one that failed, waited while paused, or was a test), by its id from get_webhook_log.","tags":["Webhooks"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id"},"post":{"type":"string","description":"Post id from get_webhook_log"}},"required":["post"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/new_webhook_address":{"post":{"operationId":"new_webhook_address","summary":"New webhook address","description":"Gives a webhook a new address; the old one stops working at once, so the tool must be given the new one. Ask the person first, then call with confirm: true.","tags":["Webhooks"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/delete_webhook":{"post":{"operationId":"delete_webhook","summary":"Delete webhook","description":"Deletes a webhook: its address stops working and its log goes. Contacts it brought in stay. Ask the person first, then call with confirm: true.","tags":["Webhooks"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"string","description":"Webhook name or id"},"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["webhook","confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_indiamart":{"post":{"operationId":"get_indiamart","summary":"Get IndiaMART","description":"How IndiaMART is connected: status, the key (last 4 only), the webhook address, what each enquiry becomes (mapping, values every lead gets, deal, call task), who gets each lead, and counts. IndiaMART fields: SENDER_NAME (Buyer name), SENDER_MOBILE (Mobile), SENDER_EMAIL (Email), SENDER_COMPANY (Buyer company), SENDER_CITY (City), SENDER_STATE (State), SENDER_PINCODE (Pincode), SENDER_COUNTRY_ISO (Country), SENDER_ADDRESS (Address), SUBJECT (Enquiry subject), QUERY_PRODUCT_NAME (Product), QUERY_MESSAGE (Message), QUERY_MCAT_NAME (Category), QUERY_TYPE (Enquiry type), QUERY_TIME (Enquired at), RECEIVER_MOBILE (Received on), CALL_DURATION (Call duration), SENDER_MOBILE_ALT (Alternate mobile), SENDER_PHONE (Landline), SENDER_PHONE_ALT (Alternate landline), SENDER_EMAIL_ALT (Alternate email), UNIQUE_QUERY_ID (Enquiry ID). Enquiry types: Direct enquiry, Buy lead, Phone call, Catalogue view, WhatsApp enquiry.","tags":["IndiaMART"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_indiamart_enquiries":{"post":{"operationId":"list_indiamart_enquiries","summary":"List IndiaMART enquiries","description":"The latest IndiaMART enquiries and what each became: a new lead, updated, already in the CRM, failed (with why) or waiting. Newest first.","tags":["IndiaMART"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"number","description":"How many (default 20, up to 200)"},"result":{"type":"string","enum":["created","updated","skipped","failed","held"],"description":"Only this result"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/connect_indiamart":{"post":{"operationId":"connect_indiamart","summary":"Connect IndiaMART","description":"Connects IndiaMART, or replaces its CRM key. With a key (from IndiaMART Lead Manager › ⋮ › Import/Export Leads › Pull API) IndiaMART is checked at once and the answer says how many enquiries the last day had; with no key it connects for the webhook only. A new connection then needs update_indiamart to go live.","tags":["IndiaMART"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"The CRM key, when the person gave one"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_indiamart":{"post":{"operationId":"update_indiamart","summary":"Update IndiaMART","description":"Changes what IndiaMART enquiries become and who gets them, and switches a new connection on. Pass only what changes; the rest stays.\n- map: { IndiaMART field: \"object:field\" | \"skip\" | { new: { object, label, type } } }, e.g. { \"QUERY_PRODUCT_NAME\": \"contacts:note\", \"QUERY_MCAT_NAME\": { \"new\": { \"object\": \"contacts\", \"label\": \"Category\", \"type\": \"singleSelect\" } } }.\n- everyLeadGets: [{ field: \"contacts:source\", value: \"IndiaMART\" }] replaces the list.\n- owners: { mode: \"none\" } | { mode: \"one\", member } | { mode: \"rotate\", members: [...] } | { mode: \"rules\", rules: [{ when: [{ field: \"SENDER_CITY\", op: \"is\", value: \"Mumbai, Pune\" }], to: [...] }], fallback: [...] }. Members by email or name. Rule fields: SENDER_CITY, SENDER_STATE, SENDER_PINCODE, SENDER_COUNTRY_ISO, QUERY_PRODUCT_NAME, QUERY_MCAT_NAME, QUERY_TYPE, SUBJECT, QUERY_MESSAGE, SENDER_COMPANY, RECEIVER_MOBILE; ops: is, isNot, contains, startsWith; a comma list means any of.\n- deal: { on, pipelineId, stage }; callTask: { on, dueMinutes }; existingRecords: fill | overwrite | skip; automations: true/false.\n- pastDays (7, 30, 90 or 365): also bring in past enquiries, once.\nIndiaMART fields: SENDER_NAME (Buyer name), SENDER_MOBILE (Mobile), SENDER_EMAIL (Email), SENDER_COMPANY (Buyer company), SENDER_CITY (City), SENDER_STATE (State), SENDER_PINCODE (Pincode), SENDER_COUNTRY_ISO (Country), SENDER_ADDRESS (Address), SUBJECT (Enquiry subject), QUERY_PRODUCT_NAME (Product), QUERY_MESSAGE (Message), QUERY_MCAT_NAME (Category), QUERY_TYPE (Enquiry type), QUERY_TIME (Enquired at), RECEIVER_MOBILE (Received on), CALL_DURATION (Call duration), SENDER_MOBILE_ALT (Alternate mobile), SENDER_PHONE (Landline), SENDER_PHONE_ALT (Alternate landline), SENDER_EMAIL_ALT (Alternate email), UNIQUE_QUERY_ID (Enquiry ID). Enquiry types: Direct enquiry, Buy lead, Phone call, Catalogue view, WhatsApp enquiry.","tags":["IndiaMART"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"map":{"type":"object","description":"IndiaMART field → target"},"everyLeadGets":{"type":"array","items":{"type":"object"},"description":"Values every lead gets"},"owners":{"type":"object","description":"Who gets each lead"},"deal":{"type":"object","description":"{ on, pipelineId, stage }"},"callTask":{"type":"object","description":"{ on, dueMinutes }"},"existingRecords":{"type":"string","enum":["fill","overwrite","skip"]},"automations":{"type":"boolean","description":"Run automations on each lead"},"pastDays":{"type":"number","description":"7, 30, 90 or 365"}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/set_indiamart_status":{"post":{"operationId":"set_indiamart_status","summary":"Pause or resume IndiaMART","description":"Pauses IndiaMART (enquiries sent by webhook are held and come in on resume) or resumes it.","tags":["IndiaMART"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["paused","active"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/check_indiamart_now":{"post":{"operationId":"check_indiamart_now","summary":"Check IndiaMART now","description":"Asks IndiaMART for new enquiries now. IndiaMART allows one check every 5 minutes; if it is too soon, the answer says when the next one is allowed.","tags":["IndiaMART"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/retry_indiamart_enquiry":{"post":{"operationId":"retry_indiamart_enquiry","summary":"Retry IndiaMART enquiry","description":"Takes a failed or waiting IndiaMART enquiry again, by its id from list_indiamart_enquiries.","tags":["IndiaMART"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Enquiry id"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/new_indiamart_webhook":{"post":{"operationId":"new_indiamart_webhook","summary":"New IndiaMART webhook address","description":"Makes a new webhook address for IndiaMART; the old one stops working at once, so the new one must be pasted into IndiaMART’s Push API page. For an address shared by mistake. Ask the person first, then call with confirm: true.","tags":["IndiaMART"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/disconnect_indiamart":{"post":{"operationId":"disconnect_indiamart","summary":"Disconnect IndiaMART","description":"Disconnects IndiaMART: the key, mapping, owners and enquiry log go; leads already made stay. Ask the person first, then call with confirm: true.","tags":["IndiaMART"],"x-scope":"write","x-destructive":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","description":"True once the person has confirmed"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_events":{"post":{"operationId":"list_events","summary":"List events","description":"The workspace’s events in event mode (conferences, trade fairs), running ones first: their lead source, how many people were captured at each by you and in total, and the link to the capture page.","tags":["Events"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_event":{"post":{"operationId":"get_event","summary":"Get event","description":"One event and everyone captured at it: who, who captured them, how (QR, card photo or typed) and when, newest first. Use it for \"who did we meet at TOKEN2049\".","tags":["Events"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","description":"Event name or id"}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_event":{"post":{"operationId":"create_event","summary":"Create event","description":"Starts an event in event mode and returns its capture-page link (open it on a phone to scan QR codes and cards). source is the lead source captures start on: one of the choices get_schema lists for contacts.source, or a new one with addSource: true (owners and admins).","tags":["Events"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Event name, e.g. TOKEN2049"},"source":{"type":"string","description":"Lead source captures start on"},"addSource":{"type":"boolean","description":"Add source as a new lead source choice first"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/end_event":{"post":{"operationId":"end_event","summary":"End event","description":"Ends an event so its link stops capturing, or reopens it with reopen: true. Whoever started it, or an owner or admin.","tags":["Events"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","description":"Event name or id"},"reopen":{"type":"boolean","description":"Reopen an ended event"}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/capture_at_event":{"post":{"operationId":"capture_at_event","summary":"Capture at event","description":"Adds someone met at an event: either an existing contact (contactId), or a new lead from their details, owned by you and on the event’s source. Either way they are counted at the event and get a “Met at …” note. A new lead needs a first name and an email, a phone, or a Telegram handle (someone known only by their Telegram handle is matched when they message).","tags":["Events"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","description":"Event name or id"},"contactId":{"type":"number","description":"An existing contact, instead of new details"},"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email"},"phone":{"type":"string","description":"Phone"},"jobTitle":{"type":"string","description":"Job title"},"companyId":{"type":"number","description":"Their company, if already in the CRM"},"telegram":{"type":"string","description":"Telegram handle, without the @"},"x":{"type":"string","description":"X (Twitter) handle, without the @"},"linkedin":{"type":"string","description":"LinkedIn profile URL"},"note":{"type":"string","description":"Anything else worth keeping, added to the note"},"method":{"type":"string","enum":["qr","photo","typed"],"description":"How they were captured; default typed"}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/export_records":{"post":{"operationId":"export_records","summary":"Export records","description":"Exports records as a spreadsheet and returns a download link (kept 7 days). One object gives a CSV; several give a zip with one CSV per object. Give record ids to export only those (search_records or search_contacts finds them), and field keys from get_schema to choose columns; otherwise every record the person can see, with every field. Calculated fields are left out. Needs the Export records permission; every export is logged.","tags":["Exports"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"objects":{"type":"array","minItems":1,"maxItems":25,"description":"What to export, one entry per object","items":{"type":"object","properties":{"object":{"type":"string","description":"Object id: contacts, companies, deals, or a custom object id from get_schema"},"ids":{"type":"array","items":{"type":"number"},"description":"Only these records"},"columns":{"type":"array","items":{"type":"string"},"description":"Field keys to include, in any order"}},"required":["object"],"additionalProperties":false}}},"required":["objects"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/report_guide":{"post":{"operationId":"report_guide","summary":"Report guide","description":"How reports work: the sandboxed runtime, window.crossingEdge, the query language, making a dashboard interactive (drill-downs, filters, tabs, dialogs) and the house style. Read this before building.","tags":["Reports and schema"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_schema":{"post":{"operationId":"get_schema","summary":"Get schema","description":"The workspace data model: every object and field (with types and choices), pipelines and stages, members, currency and today’s date.","tags":["Reports and schema"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/run_query":{"post":{"operationId":"run_query","summary":"Run query","description":"Runs one report query and returns the answer, exactly as a report would get it. Use it to check numbers before publishing.","tags":["Reports and schema"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"object","description":"A report query. See report_guide for the full language.","properties":{"object":{"type":"string","description":"Object id from get_schema: contacts, companies, deals, activities, or a custom one"},"filters":{"type":"array","items":{"type":"object"},"description":"[{ key, values? | text? | min?, max? }]"},"groupBy":{"type":"array","items":{"type":"string"},"description":"Up to two field keys"},"bucket":{"type":"string","enum":["day","week","month","quarter","year"]},"measures":{"type":"array","items":{"type":"object"},"description":"[{ op: count|sum|avg|min|max|distinct, field?, as? }]"},"fields":{"type":"array","items":{"type":"string"}},"sort":{"type":"object","properties":{"by":{"type":"string"},"dir":{"type":"string","enum":["asc","desc"]}}},"limit":{"type":"number"}},"required":["object"]}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/list_reports":{"post":{"operationId":"list_reports","summary":"List reports","description":"Reports in the workspace this person can see: their own and the shared ones.","tags":["Reports and schema"],"x-scope":"read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/get_report":{"post":{"operationId":"get_report","summary":"Get report","description":"One report with its full HTML, to read or change it.","tags":["Reports and schema"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Report id"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/check_report":{"post":{"operationId":"check_report","summary":"Check report","description":"Checks a native report spec and works out every figure on it for a period and the one before, exactly as the page will show them. Run it before create_report and read the numbers back.","tags":["Reports and schema"],"x-scope":"read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spec":{"type":"object","description":"The report spec (see report_guide)"},"period":{"type":"object","description":"{ kind: week | month | quarter | year | custom, year?, quarter?, from?, to? }. Default: the spec’s, else this month"},"pipeline":{"type":"string","description":"A pipeline name, as the pipeline picker would set it"},"filters":{"type":"array","items":{"type":"object"},"description":"Filter bar filters on the spec’s object"}},"required":["spec"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/create_report":{"post":{"operationId":"create_report","summary":"Create report","description":"Publishes a new report into Crossing Edge. Returns its URL. Private to its author unless shared is true. Prefer a native report (spec): the app draws it with Insights’ own pieces. Use html only for what a spec cannot draw.","tags":["Reports and schema"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Short title, e.g. \"Pipeline health\""},"description":{"type":"string","description":"One line on what it answers"},"spec":{"type":"object","description":"A native report spec (see report_guide). Check it with check_report first"},"html":{"type":"string","description":"Instead of a spec: the complete, self-contained HTML page"},"shared":{"type":"boolean","description":"Show it to everyone in the workspace (each sees only their own data access)"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/actions/update_report":{"post":{"operationId":"update_report","summary":"Update report","description":"Changes a report: any of its name, description, spec, HTML or sharing. Only its author, an owner or an admin can. A spec replaces HTML and the other way round. To change part of an HTML report, send `edits` rather than the whole page: read it with get_report, then give each piece of text to find (copied exactly, appearing once) and what replaces it. A long page written out in full may not fit in one reply.","tags":["Reports and schema"],"x-scope":"write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Report id"},"name":{"type":"string","description":"New title"},"description":{"type":"string","description":"New description"},"spec":{"type":"object","description":"The complete new spec"},"html":{"type":"string","description":"The complete new HTML"},"edits":{"type":"array","description":"Changes to part of the HTML page, applied in order: each `find` is exact text from the current page that appears once, replaced by `replace`","items":{"type":"object","properties":{"find":{"type":"string","description":"Exact text from the page"},"replace":{"type":"string","description":"What replaces it"}},"required":["find","replace"],"additionalProperties":false}},"shared":{"type":"boolean"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}},"/me":{"get":{"operationId":"getMe","summary":"The key in use","description":"Which key this is, its scope, the workspace it works in, and the member it acts as. A cheap way to check a key works.","tags":["Getting started"],"x-scope":"read","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"422":{"$ref":"#/components/responses/E422"},"429":{"$ref":"#/components/responses/E429"},"500":{"$ref":"#/components/responses/E500"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"ce_live_…","description":"A workspace API key from Settings › Integrations › API."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Any unique string. A retry with the same key and body returns the first answer for 24 hours instead of doing it twice."}},"schemas":{"Envelope":{"type":"object","required":["data","request_id"],"properties":{"data":{"description":"The result."},"request_id":{"type":"string","example":"req_5f1c…"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message","request_id"],"properties":{"type":{"type":"string","enum":["invalid_request","authentication_error","permission_error","not_found","conflict","rate_limited","server_error"]},"code":{"type":"string","example":"invalid_parameter"},"message":{"type":"string"},"field":{"type":"string","description":"The field at fault, when there is one."},"request_id":{"type":"string"}}}}}},"responses":{"E400":{"description":"The request is not valid: a missing or wrong field, or bad JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"No key, or a key that is unknown, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E403":{"description":"The key may not do this: read-only, its maker lacks the access, or it is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"The record, or the operation, is not there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E409":{"description":"It conflicts with what is already there, like a duplicate email.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E422":{"description":"An Idempotency-Key reused for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Over the per-minute or daily limit. Wait for Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E500":{"description":"Something failed on our side. Retry; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}