{"openapi":"3.1.0","info":{"title":"AgentSend API","version":"1","description":"Cold email infrastructure for AI agents. Start with https://api.useagentsend.com/llms.txt.","termsOfService":"https://api.useagentsend.com/terms"},"servers":[{"url":"https://api.useagentsend.com/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"ak_live_… from POST /signup or the dashboard"}},"responses":{"Error":{"description":"Error; `fix` says what to do next","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","required":["type","code","message","requires_human"],"properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"},"requires_human":{"type":"boolean","description":"Only a person can clear this (tier, credits, a key with more scopes): ask, do not retry"},"next_action":{"type":"object","description":"The endpoint the fix names, with its MCP tool","properties":{"method":{"type":"string"},"path":{"type":"string"},"tool":{"type":"string"}}},"details":{}}}}}}}}}},"paths":{"/infrastructure":{"post":{"summary":"Quote (dry_run) or buy sending domains and inboxes; returns a job","tags":["Sending"],"description":"Scope: `infrastructure:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"domains":{"type":"object","properties":{"names":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9-]+(\\.[a-z0-9-]+)+$"}}},"required":["names"]},"inboxes_per_domain":{"default":2,"type":"integer","minimum":1,"maximum":5},"personas":{"description":"Who the inboxes send as; personas take turns across inboxes_per_domain, and one person can hold several (george.witwer@, george@, …)","minItems":1,"type":"array","items":{"type":"object","properties":{"first_name":{"type":"string","minLength":1,"maxLength":50},"last_name":{"type":"string","maxLength":50},"title":{"type":"string","maxLength":100},"usernames":{"description":"Preferred local parts, e.g. [\"george\", \"g.witwer\"]","maxItems":5,"type":"array","items":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+([._-][a-z0-9]+)*$"}}},"required":["first_name"]}},"timezone":{"default":"America/New_York","type":"string"},"dry_run":{"default":false,"type":"boolean"}},"required":["domains","personas"]}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dry_run":{"type":"boolean","const":true},"quote":{"type":"object","properties":{"id":{"type":"string","pattern":"^qte_[0-9A-HJKMNP-TV-Z]{26}$"},"lines":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","const":"domain"},"name":{"type":"string"},"available":{"type":"boolean"},"price_usd":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},{"type":"null"}]},"reason":{"type":"string","enum":["unavailable","premium"]},"inboxes":{"type":"array","items":{"type":"string"}}},"required":["item","name","available","price_usd"],"additionalProperties":false}},"total":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"currency":{"type":"string","const":"USD"},"monthly":{"type":"object","properties":{"inboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workspace_fee_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"extra_inboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_per_extra_inbox_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"total_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"}},"required":["inboxes","workspace_fee_usd","extra_inboxes","price_per_extra_inbox_usd","total_usd"],"additionalProperties":false},"note":{"type":"string"}},"required":["id","lines","total","currency","monthly","note"],"additionalProperties":false}},"required":["dry_run","quote"],"additionalProperties":false}}}},"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","const":"queued"}},"required":["id","status"],"additionalProperties":false},"quote":{"type":"object","properties":{"id":{"type":"string","pattern":"^qte_[0-9A-HJKMNP-TV-Z]{26}$"},"lines":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","const":"domain"},"name":{"type":"string"},"available":{"type":"boolean"},"price_usd":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},{"type":"null"}]},"reason":{"type":"string","enum":["unavailable","premium"]},"inboxes":{"type":"array","items":{"type":"string"}}},"required":["item","name","available","price_usd"],"additionalProperties":false}},"total":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"currency":{"type":"string","const":"USD"},"monthly":{"type":"object","properties":{"inboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workspace_fee_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"extra_inboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_per_extra_inbox_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"total_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"}},"required":["inboxes","workspace_fee_usd","extra_inboxes","price_per_extra_inbox_usd","total_usd"],"additionalProperties":false},"note":{"type":"string"}},"required":["id","lines","total","currency","monthly","note"],"additionalProperties":false}},"required":["job","quote"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/inboxes":{"post":{"summary":"Add an inbox to a verified domain you have; one person can hold several (george.witwer@, george@, …)","tags":["Sending"],"description":"Scope: `infrastructure:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"domain":{"description":"Domain id or name, from GET /domains","type":"string","minLength":1},"first_name":{"type":"string","minLength":1,"maxLength":50},"last_name":{"type":"string","maxLength":50},"title":{"type":"string","maxLength":100},"username":{"description":"Local part, e.g. \"george\"; omitted → the first free one of george.witwer, george, g.witwer, …","type":"string","maxLength":64,"pattern":"^[a-z0-9]+([._-][a-z0-9]+)*$"},"timezone":{"default":"America/New_York","type":"string"}},"required":["domain","first_name"]}}}},"responses":{"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"address":{"type":"string"},"domain_id":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Z]{26}$"},"display_name":{"type":"string"},"status":{"type":"string","const":"creating"},"price":{"type":"object","properties":{"monthly_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"}},"required":["monthly_usd"],"additionalProperties":false},"next":{"type":"string"}},"required":["address","domain_id","display_name","status","price","next"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"Inboxes, with the scheduler's latest report","tags":["Sending"],"description":"Scope: `workspace:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ibx_[0-9A-HJKMNP-TV-Z]{26}$"},"address":{"type":"string"},"domain_id":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Z]{26}$"},"display_name":{"type":"string"},"state":{"type":"string","enum":["warming","ready","sending","paused","retired"]},"daily_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timezone":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"status":{"anyOf":[{"type":"object","properties":{"last_tick_at":{"type":"string"},"planned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"skips":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"next_send_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","address","domain_id","display_name","state","daily_cap","timezone","created_at","status"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/jobs/{id}":{"get":{"summary":"A long-running job","tags":["Sending"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["infrastructure","lead_search"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","partially_succeeded"]},"progress":{},"result":{"anyOf":[{},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","status","progress","result","created_at","finished_at"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/domains":{"get":{"summary":"Sending domains","tags":["Sending"],"description":"Scope: `workspace:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"state":{"type":"string","enum":["registering","dns_pending","verifying","verified","failed","paused","retired"]},"verified_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"cold_from":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","state","verified_at","expires_at","cold_from","created_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/signup":{"post":{"summary":"Sign up as an agent: returns an API key, a T0 workspace and a claim link for your human","tags":["Account"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"principal_email":{"description":"The human who will own the account","type":"string"},"org_name":{"type":"string","minLength":1},"agent_name":{"type":"string"}},"required":["principal_email","org_name"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account_id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"workspace_id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"tier":{"type":"string","const":"T0"},"api_key":{"type":"string"},"claim_url":{"type":"string"},"next":{"type":"object","properties":{"action":{"type":"string","const":"claim_account"},"why":{"type":"string"}},"required":["action","why"],"additionalProperties":false}},"required":["account_id","workspace_id","tier","api_key","claim_url","next"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/workspace":{"get":{"summary":"This workspace: tier, caps, credit balance","tags":["Account"],"description":"Scope: `workspace:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"tier":{"type":"string","enum":["T0","T1","T2","T3","T4"]},"status":{"type":"string","enum":["active","restricted","suspended","closed"]},"caps":{"type":"object","properties":{"new_recipients_per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"domains":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["new_recipients_per_day","domains","inboxes"],"additionalProperties":false},"balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2,6}$"},"sender":{"type":"object","properties":{"business_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"postal_address":{}},"required":["business_name","postal_address"],"additionalProperties":false}},"required":["id","name","tier","status","caps","balance","sender"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/me":{"get":{"summary":"Who is calling: the key (workspace, scopes) or the person (accounts, workspaces, roles)","tags":["Account"],"parameters":[],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"api_key"},"key":{"type":"object","properties":{"id":{"type":"string","pattern":"^key_.*"},"account_id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"workspace_id":{"anyOf":[{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","account_id","workspace_id","scopes"],"additionalProperties":false}},"required":["kind","key"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"user"},"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"is_staff":{"type":"boolean","const":true}},"required":["id","email"],"additionalProperties":false},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"role":{"type":"string","enum":["viewer","editor","admin","owner"]}},"required":["id","name","role"],"additionalProperties":false}},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"account_id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"tier":{"type":"string","enum":["T0","T1","T2","T3","T4"]},"role":{"type":"string","enum":["viewer","editor","admin","owner"]}},"required":["id","name","account_id","tier","role"],"additionalProperties":false}}},"required":["kind","user","accounts","workspaces"],"additionalProperties":false}]}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/workspaces":{"get":{"summary":"Workspaces the caller can open","tags":["Account"],"parameters":[],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"account_id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"tier":{"type":"string","enum":["T0","T1","T2","T3","T4"]},"status":{"type":"string","enum":["active","restricted","suspended","closed"]},"available_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2,6}$"},"role":{"type":"string","enum":["viewer","editor","admin","owner"]}},"required":["id","account_id","name","tier","status","available_balance"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create a workspace (sub-account); needs workspaces:write on the account","tags":["Account"],"description":"Scope: `workspaces:write`","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"account_id":{"type":"string"},"principal":{"type":"object","properties":{"legal_name":{"type":"string","minLength":1},"country":{"type":"string","minLength":2,"maxLength":2},"website":{"type":"string"},"contact_email":{"type":"string"},"postal_address":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["legal_name","country"]}},"required":["name"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"account_id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"tier":{"type":"string","const":"T0"},"principal_id":{"type":"string","pattern":"^prn_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["id","account_id","name","tier","principal_id"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/workspaces/{id}":{"patch":{"summary":"Rename a workspace or set its sender (business name, postal address)","tags":["Account"],"description":"Scope: `members:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"sender":{"description":"Who the mail is from, for the footer that commercial emails carry (CAN-SPAM): business name and postal address. Non-commercial emails (e.g. recruiting a person for a job) go out without it.","type":"object","properties":{"business_name":{"type":"string","minLength":1,"maxLength":200},"postal_address":{"description":"A PO box or commercial mailbox is fine","type":"object","properties":{"line1":{"type":"string","minLength":1},"line2":{"type":"string"},"city":{"type":"string","minLength":1},"region":{"type":"string"},"postal_code":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2, e.g. US","type":"string","minLength":2,"maxLength":2}},"required":["line1","city","country"]}}}}}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"sender":{"type":"object","properties":{"business_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"postal_address":{}},"required":["business_name","postal_address"],"additionalProperties":false}},"required":["id","name"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/billing/transfers":{"post":{"summary":"Move credits between two workspaces of one account (billing:spend in both)","tags":["Credits"],"description":"Scope: `billing:spend`","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from_workspace_id":{"type":"string"},"to_workspace_id":{"type":"string"},"amount":{"description":"USD, e.g. \"25.00\"","type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"note":{"type":"string","maxLength":200}},"required":["from_workspace_id","to_workspace_id","amount"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from_workspace_id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"to_workspace_id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"amount":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"currency":{"type":"string","const":"USD"}},"required":["from_workspace_id","to_workspace_id","amount","currency"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api-keys":{"get":{"summary":"API keys of this workspace (and account-wide keys, for account admins)","tags":["Keys and people"],"description":"Scope: `keys:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^key_.*"},"prefix":{"type":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"}},"workspace_id":{"anyOf":[{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"created_by":{"type":"string","enum":["agent","human"]},"created_by_user_id":{"anyOf":[{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"created_by_email":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","prefix","label","scopes","workspace_id","created_by","created_by_user_id","created_by_email","last_used_at","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create a key; the secret is returned once; never more scopes than the caller holds","tags":["Keys and people"],"description":"Scope: `keys:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"label":{"type":"string","maxLength":100},"scopes":{"description":"Defaults to all of the caller's scopes","minItems":1,"type":"array","items":{"type":"string"}},"account_wide":{"default":false,"type":"boolean"}}}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^key_.*"},"api_key":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"workspace_id":{"anyOf":[{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"note":{"type":"string"}},"required":["id","api_key","prefix","scopes","workspace_id","note"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api-keys/{id}":{"delete":{"summary":"Revoke a key","tags":["Keys and people"],"description":"Scope: `keys:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/members":{"get":{"summary":"People who can open this workspace","tags":["Keys and people"],"description":"Scope: `members:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^mem_[0-9A-HJKMNP-TV-Z]{26}$"},"role":{"type":"string","enum":["viewer","editor","admin","owner"]},"level":{"type":"string","enum":["account","workspace"]},"user_id":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","role","level","user_id","email","name","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/members/{id}":{"patch":{"summary":"Change a member's role","tags":["Keys and people"],"description":"Scope: `members:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"role":{"type":"string","enum":["admin","editor","viewer"]}},"required":["role"]}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^mem_[0-9A-HJKMNP-TV-Z]{26}$"},"role":{"type":"string","enum":["viewer","editor","admin","owner"]}},"required":["id","role"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"summary":"Remove a member","tags":["Keys and people"],"description":"Scope: `members:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^mem_[0-9A-HJKMNP-TV-Z]{26}$"},"removed":{"type":"boolean","const":true}},"required":["id","removed"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invitations":{"get":{"summary":"Open invitations","tags":["Keys and people"],"description":"Scope: `members:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^inv_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"role":{"type":"string","enum":["viewer","editor","admin","owner"]},"level":{"type":"string","enum":["account","workspace"]},"invited_by":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","email","role","level","invited_by","created_at","expires_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Invite someone; returns an invite_url to pass on","tags":["Keys and people"],"description":"Scope: `members:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["admin","editor","viewer"]},"level":{"default":"workspace","type":"string","enum":["workspace","account"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^inv_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"role":{"type":"string","enum":["viewer","editor","admin","owner"]},"level":{"type":"string","enum":["account","workspace"]},"invite_url":{"type":"string"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"note":{"type":"string"}},"required":["id","email","role","level","invite_url","expires_at","note"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["Keys and people"],"description":"Scope: `members:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/account/claim-link":{"post":{"summary":"A fresh claim link while the account has no owner","tags":["Account"],"description":"Scope: `members:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"claim_url":{"type":"string"},"principal_email":{"type":"string"},"expires_in_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["claim_url","principal_email","expires_in_days"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/templates":{"get":{"summary":"Template library","tags":["Templates"],"description":"Scope: `templates:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","archived"]},"latest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shared":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","status","latest_version","shared","created_at","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create a template (version 1); returns lint findings","tags":["Templates"],"description":"Scope: `templates:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"delay":{"description":"Days after the previous step","default":0,"type":"number","minimum":0},"variants":{"minItems":1,"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"}},"required":["body"]}}},"required":["variants"]}},"shared":{"description":"Share with every workspace of the account","default":false,"type":"boolean"}},"required":["name","steps"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"shared":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"merge_fields":{"type":"array","items":{"type":"string"}},"lint":{"type":"object","properties":{"ok":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"field":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"],"additionalProperties":false}}},"required":["ok","issues"],"additionalProperties":false}},"required":["id","name","shared","version","merge_fields","lint"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/templates/{id}":{"get":{"summary":"A template's latest version","tags":["Templates"],"description":"Scope: `templates:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","archived"]},"shared":{"type":"boolean"},"campaign_id":{"anyOf":[{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"latest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"delay":{"type":"number"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"}},"required":["id","body"],"additionalProperties":false}}},"required":["delay","variants"],"additionalProperties":false}},"merge_fields":{"type":"array","items":{"type":"string"}},"content_hash":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","status","shared","campaign_id","latest_version","version","steps","merge_fields","content_hash","created_at"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"summary":"Rename or archive a template","tags":["Templates"],"description":"Scope: `templates:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["active","archived"]}}}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","archived"]}},"required":["id","name","status"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/templates/{id}/versions/{v}":{"get":{"summary":"One version of a template","tags":["Templates"],"description":"Scope: `templates:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"v","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","archived"]},"shared":{"type":"boolean"},"campaign_id":{"anyOf":[{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"latest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"delay":{"type":"number"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"}},"required":["id","body"],"additionalProperties":false}}},"required":["delay","variants"],"additionalProperties":false}},"merge_fields":{"type":"array","items":{"type":"string"}},"content_hash":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","status","shared","campaign_id","latest_version","version","steps","merge_fields","content_hash","created_at"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/templates/{id}/preview":{"post":{"summary":"Render every variant for a sample person (changes nothing); lists the fields they lack","tags":["Templates"],"description":"Scope: `templates:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"description":"Defaults to the latest version","type":"integer","minimum":1,"maximum":9007199254740991},"lead":{"default":{"email":"sam@example.com","custom_variables":{}},"type":"object","properties":{"email":{"description":"Also picks the {{RANDOM}} options, as a send would","default":"sam@example.com","type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company_name":{"type":"string"},"title":{"type":"string"},"custom_variables":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}},"sender_name":{"description":"The sending inbox's display name, for {{sender_name}}","type":"string"}}}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delay":{"type":"number"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"missing":{"type":"array","items":{"type":"string"}}},"required":["id","body","missing"],"additionalProperties":false}}},"required":["step","delay","variants"],"additionalProperties":false}},"note":{"type":"string"}},"required":["id","version","steps","note"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/templates/{id}/versions":{"post":{"summary":"Save a new immutable version","tags":["Templates"],"description":"Scope: `templates:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"delay":{"description":"Days after the previous step","default":0,"type":"number","minimum":0},"variants":{"minItems":1,"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"}},"required":["body"]}}},"required":["variants"]}}},"required":["steps"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"merge_fields":{"type":"array","items":{"type":"string"}},"lint":{"type":"object","properties":{"ok":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"field":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"],"additionalProperties":false}}},"required":["ok","issues"],"additionalProperties":false},"note":{"type":"string"}},"required":["id","version","merge_fields","lint","note"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/leads":{"post":{"summary":"Add leads to a campaign (≤ 1000 per call)","tags":["Campaigns"],"description":"Scope: `leads:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaign_id":{"type":"string"},"leads":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company_name":{"type":"string"},"title":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"},"custom_variables":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["email"]}}},"required":["campaign_id","leads"]}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"anyOf":[{"type":"string","pattern":"^imp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"freemail_blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_verification":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["import_id","uploaded","duplicates","invalid_syntax","freemail_blocked","suppressed","pending_verification"],"additionalProperties":false}}}},"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"anyOf":[{"type":"string","pattern":"^imp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"freemail_blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_verification":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["import_id","uploaded","duplicates","invalid_syntax","freemail_blocked","suppressed","pending_verification"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"Leads (imported at activation); with campaign_id, where each is in that sequence","tags":["Campaigns"],"description":"Scope: `leads:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"campaign_id","in":"query","required":false,"description":"Only this campaign's leads, with their sequence state","schema":{"type":"string"}},{"name":"state","in":"query","required":false,"description":"queued | canary | held | active | waiting | completed | stopped (needs campaign_id)","schema":{"type":"string"}},{"name":"verify_status","in":"query","required":false,"description":"valid | accept_all | invalid | …","schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"description":"prospect | warm","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Search email, name or company","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^led_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"custom_variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"kind":{"type":"string","enum":["prospect","warm"]},"relationship":{"anyOf":[{"type":"string","enum":["customer","partner","replied","colleague"]},{"type":"null"}]},"verify_status":{"type":"string","enum":["pending","valid","accept_all","invalid","disposable","role","webmail","unknown"]},"verified_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"interest_status":{"anyOf":[{"type":"string","enum":["interested","not_interested","wrong_person","needs_review"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"campaign":{"type":"object","properties":{"campaign_id":{"type":"string"},"state":{"type":"string","enum":["queued","canary","held","active","waiting","completed","stopped"]},"stop_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"release":{"type":"string"},"next_due_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"inbox_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"type":"string"}},"required":["campaign_id","state","stop_reason","step","release","next_due_at","inbox_id","updated_at"],"additionalProperties":false}},"required":["id","email","first_name","last_name","company_name","title","country","timezone","custom_variables","kind","relationship","verify_status","verified_at","interest_status","created_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/warm-audience":{"post":{"summary":"Add people who already know the sender","tags":["Campaigns"],"description":"Scope: `leads:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaign_id":{"type":"string"},"leads":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"relationship":{"type":"string","enum":["customer","partner","replied","colleague"]},"first_name":{"type":"string"},"last_name":{"type":"string"},"company_name":{"type":"string"},"title":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"},"custom_variables":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["email"]}}},"required":["campaign_id","leads"]}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"anyOf":[{"type":"string","pattern":"^imp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"freemail_blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_verification":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["import_id","uploaded","duplicates","invalid_syntax","freemail_blocked","suppressed","pending_verification"],"additionalProperties":false}}}},"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"anyOf":[{"type":"string","pattern":"^imp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"freemail_blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_verification":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["import_id","uploaded","duplicates","invalid_syntax","freemail_blocked","suppressed","pending_verification"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/lead-searches":{"post":{"summary":"Start a lead search: describe who to find, with filters, contacts per company, a target and a hard spending cap","tags":["Lead discovery (preview)"],"description":"Scope: `leads:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","minLength":10,"maxLength":2000},"filters":{"type":"object","properties":{"countries":{"default":["US"],"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"employees":{"default":{},"type":"object","properties":{"min":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"exclude":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"roles":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}}},"required":["roles"],"additionalProperties":false},"contacts_per_company":{"default":2,"type":"integer","minimum":1,"maximum":5},"target_contacts":{"type":"integer","minimum":1,"maximum":2000},"max_spend_usd":{"type":"number","exclusiveMinimum":0,"maximum":200},"seed_queries":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"query_style":{"type":"string","minLength":10,"maxLength":500}},"required":["description","filters","target_contacts","max_spend_usd"]}}}},"responses":{"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","const":"queued"}},"required":["id","status"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"Lead searches, newest first, each with its yield and spend","tags":["Lead discovery (preview)"],"description":"Scope: `leads:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["queued","running","succeeded","failed","partially_succeeded"]},"stop_reason":{"anyOf":[{"type":"string","enum":["target_reached","budget_reached","queries_exhausted","failed"]},{"type":"null"}]},"spec":{"type":"object","properties":{"description":{"type":"string","minLength":10,"maxLength":2000},"filters":{"type":"object","properties":{"countries":{"default":["US"],"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"employees":{"default":{},"type":"object","properties":{"min":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"additionalProperties":false},"exclude":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"roles":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}}},"required":["countries","employees","exclude","roles"],"additionalProperties":false},"contacts_per_company":{"default":2,"type":"integer","minimum":1,"maximum":5},"target_contacts":{"type":"integer","minimum":1,"maximum":2000},"max_spend_usd":{"type":"number","exclusiveMinimum":0,"maximum":200},"seed_queries":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"query_style":{"type":"string","minLength":10,"maxLength":500}},"required":["description","filters","contacts_per_company","target_contacts","max_spend_usd","seed_queries"],"additionalProperties":false},"spent_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"companies":{"type":"object","properties":{"checked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["checked","fit"],"additionalProperties":false},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_per_contact_usd":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","status","stop_reason","spec","spent_usd","companies","contacts","cost_per_contact_usd","created_at","finished_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/lead-searches/{id}":{"get":{"summary":"A lead search: status, spend, companies and contacts found, and the yield of each query","tags":["Lead discovery (preview)"],"description":"Scope: `leads:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["queued","running","succeeded","failed","partially_succeeded"]},"stop_reason":{"anyOf":[{"type":"string","enum":["target_reached","budget_reached","queries_exhausted","failed"]},{"type":"null"}]},"spec":{"type":"object","properties":{"description":{"type":"string","minLength":10,"maxLength":2000},"filters":{"type":"object","properties":{"countries":{"default":["US"],"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"employees":{"default":{},"type":"object","properties":{"min":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"additionalProperties":false},"exclude":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"roles":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}}},"required":["countries","employees","exclude","roles"],"additionalProperties":false},"contacts_per_company":{"default":2,"type":"integer","minimum":1,"maximum":5},"target_contacts":{"type":"integer","minimum":1,"maximum":2000},"max_spend_usd":{"type":"number","exclusiveMinimum":0,"maximum":200},"seed_queries":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"query_style":{"type":"string","minLength":10,"maxLength":500}},"required":["description","filters","contacts_per_company","target_contacts","max_spend_usd","seed_queries"],"additionalProperties":false},"spent_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"companies":{"type":"object","properties":{"checked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["checked","fit"],"additionalProperties":false},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_per_contact_usd":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},{"type":"null"}]},"queries":{"type":"array","items":{"type":"object","properties":{"query":{"type":"string"},"results":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"candidates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"}},"required":["query","results","candidates","fits","contacts","spent_usd"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","status","stop_reason","spec","spent_usd","companies","contacts","cost_per_contact_usd","queries","created_at","finished_at"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/lead-searches/{id}/companies":{"get":{"summary":"The companies a search checked: why each fits or was dropped, its source, cost and picked contacts","tags":["Lead discovery (preview)"],"description":"Scope: `leads:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"fit","in":"query","required":false,"description":"true: only companies that fit","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^lsc_[0-9A-HJKMNP-TV-Z]{26}$"},"domain":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"source_query":{"type":"string"},"source_url":{"type":"string"},"fit":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"drop_reason":{"anyOf":[{"type":"string","enum":["not_a_match","wrong_country","excluded","too_big","too_small","no_contacts","unreachable"]},{"type":"null"}]},"size_band":{"anyOf":[{"type":"string","enum":["solo","small","mid","large","unknown"]},{"type":"null"}]},"address_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"scores":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cost_usd":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^lct_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"confidence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"verify_status":{"anyOf":[{"type":"string","enum":["pending","valid","accept_all","invalid","disposable","role","webmail","unknown"]},{"type":"null"}]},"imported":{"type":"boolean"}},"required":["id","email","first_name","last_name","title","confidence","verify_status","imported"],"additionalProperties":false}}},"required":["id","domain","name","source_query","source_url","fit","drop_reason","size_band","address_count","scores","cost_usd","contacts"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/lead-searches/{id}/leads":{"post":{"summary":"Put a search's picked contacts into a campaign (all fitting companies, or the ones listed), with the same checks as POST /leads","tags":["Lead discovery (preview)"],"description":"Scope: `leads:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaign_id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"company_ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","pattern":"^lsc_[0-9A-HJKMNP-TV-Z]{26}$"}}},"required":["campaign_id"]}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"anyOf":[{"type":"string","pattern":"^imp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"freemail_blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_verification":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["import_id","uploaded","duplicates","invalid_syntax","freemail_blocked","suppressed","pending_verification"],"additionalProperties":false}}}},"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"anyOf":[{"type":"string","pattern":"^imp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"freemail_blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_verification":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["import_id","uploaded","duplicates","invalid_syntax","freemail_blocked","suppressed","pending_verification"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/emails":{"get":{"summary":"Replies, newest first, classified (interested, not_interested, unsubscribe, …)","tags":["Replies"],"description":"Scope: `campaigns:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"campaign_id","in":"query","required":false,"description":"Only replies to this campaign","schema":{"type":"string"}},{"name":"lead_id","in":"query","required":false,"description":"Only this lead's replies","schema":{"type":"string"}},{"name":"label","in":"query","required":false,"description":"Only replies with this label","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"focused (default: leaves out out-of-office, auto-replies and bounce notices) | all","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^msg_[0-9A-HJKMNP-TV-Z]{26}$"},"thread_id":{"type":"string","pattern":"^thr_[0-9A-HJKMNP-TV-Z]{26}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"from":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"type":"string"},"label":{"anyOf":[{"type":"string","enum":["interested","not_interested","wrong_person","unsubscribe","angry","out_of_office","auto_reply","bounce_notice"]},{"type":"null"}]},"label_confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^led_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","first_name","last_name","company_name"],"additionalProperties":false},{"type":"null"}]},"campaign_id":{"anyOf":[{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"inbox":{"type":"object","properties":{"id":{"type":"string","pattern":"^ibx_[0-9A-HJKMNP-TV-Z]{26}$"},"address":{"type":"string"}},"required":["id","address"],"additionalProperties":false}},"required":["id","thread_id","at","from","subject","snippet","label","label_confidence","lead","campaign_id","inbox"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/emails/{id}":{"get":{"summary":"A reply with its whole conversation, whether it can be answered, and the answers asked for","tags":["Replies"],"description":"Scope: `campaigns:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^msg_[0-9A-HJKMNP-TV-Z]{26}$"},"thread_id":{"type":"string","pattern":"^thr_[0-9A-HJKMNP-TV-Z]{26}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"from":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string","enum":["interested","not_interested","wrong_person","unsubscribe","angry","out_of_office","auto_reply","bounce_notice"]},{"type":"null"}]},"label_confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^led_[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","first_name","last_name","company_name"],"additionalProperties":false},{"type":"null"}]},"campaign_id":{"anyOf":[{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"inbox":{"type":"object","properties":{"id":{"type":"string","pattern":"^ibx_[0-9A-HJKMNP-TV-Z]{26}$"},"address":{"type":"string"}},"required":["id","address"],"additionalProperties":false},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"thread":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^msg_[0-9A-HJKMNP-TV-Z]{26}$"},"direction":{"type":"string","enum":["in","out"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string","enum":["interested","not_interested","wrong_person","unsubscribe","angry","out_of_office","auto_reply","bounce_notice"]},{"type":"null"}]}},"required":["id","direction","at","from","to","subject","text","label"],"additionalProperties":false}},"can_reply":{"type":"boolean"},"cannot_reply_reason":{"anyOf":[{"type":"string","enum":["automatic_message","recipient_suppressed"]},{"type":"null"}]},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^rpl_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["queued","sent","refused"]},"text":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"refusal":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status","text","created_at","refusal"],"additionalProperties":false}}},"required":["id","thread_id","at","from","subject","label","label_confidence","lead","campaign_id","inbox","text","thread","can_reply","cannot_reply_reason","replies"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/emails/{id}/reply":{"post":{"summary":"Answer a reply, in its thread (plain text, ≤ 300 words; never to unsubscribed or automatic mail)","tags":["Replies"],"description":"Scope: `campaigns:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string"}},"required":["text"]}}}},"responses":{"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^rpl_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","const":"queued"}},"required":["id","status"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns":{"get":{"summary":"Campaigns, newest first","tags":["Campaigns"],"description":"Scope: `campaigns:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","activating","active","paused","completed","rejected","archived","pausing","resuming","paused_by_system"]},"desired":{"type":"string","enum":["draft","running","paused","archived"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"anyOf":[{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"template_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"activated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","status","desired","version","template_id","template_version","created_at","activated_at","updated_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create a campaign from a template (or inline sequences)","tags":["Campaigns"],"description":"Scope: `campaigns:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"sequences":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"object","properties":{"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"delay":{"description":"Days after the previous step","default":0,"type":"number","minimum":0},"variants":{"minItems":1,"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"}},"required":["body"]}}},"required":["variants"]}}},"required":["steps"]}},"template_id":{"type":"string"},"template_version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"campaign_schedule":{"default":{},"type":"object","properties":{"timezone":{"type":"string"},"timezone_mode":{"type":"string","enum":["recipient","campaign"]},"days":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"from":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"to":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}}},"email_list":{"description":"Inbox ids or addresses to send from","minItems":1,"type":"array","items":{"type":"string"}},"daily_limit":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"prioritize_new_leads":{"default":false,"type":"boolean"}},"required":["name","email_list"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","const":"draft"},"email_list":{"type":"array","items":{"type":"string","pattern":"^ibx_[0-9A-HJKMNP-TV-Z]{26}$"}},"template_id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"template_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lint":{"type":"object","properties":{"ok":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"field":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"],"additionalProperties":false}}},"required":["ok","issues"],"additionalProperties":false}},"required":["id","name","status","email_list","template_id","template_version"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}":{"get":{"summary":"A campaign","tags":["Campaigns"],"description":"Scope: `campaigns:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","activating","active","paused","completed","rejected","archived","pausing","resuming","paused_by_system"]},"desired":{"type":"string","enum":["draft","running","paused","archived"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"anyOf":[{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"template_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"activated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","status","desired","version","template_id","template_version","created_at","activated_at"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"summary":"Rename or move the template pin (draft, paused or rejected)","tags":["Campaigns"],"description":"Scope: `campaigns:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"template_id":{"type":"string"},"template_version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"template_id":{"type":"string","pattern":"^tpl_[0-9A-HJKMNP-TV-Z]{26}$"},"template_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next":{"type":"string"}},"required":["id","next"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/activate":{"post":{"summary":"Verify leads, review copy, run the canary, then send","tags":["Campaigns"],"description":"Scope: `campaigns:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":{"dry_run":false},"type":"object","properties":{"dry_run":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dry_run":{"type":"boolean","const":true},"spec":{"type":"object","properties":{"name":{"type":"string"},"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"delayDays":{"type":"number","minimum":0},"variants":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"}},"required":["id","body"],"additionalProperties":false}}},"required":["delayDays","variants"],"additionalProperties":false}},"schedule":{"default":{},"type":"object","properties":{"window":{"type":"object","properties":{"days":{"minItems":1,"type":"array","items":{"type":"number","enum":[0,1,2,3,4,5,6]}},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["days","start","end"],"additionalProperties":false},"timezoneMode":{"type":"string","enum":["recipient","campaign"]},"timezone":{"type":"string"},"prioritizeNew":{"type":"boolean"}},"additionalProperties":false},"inbox_ids":{"minItems":1,"type":"array","items":{"type":"string"}},"daily_new_cap":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"import_ids":{"minItems":1,"type":"array","items":{"type":"string"}},"available_fields":{"default":["first_name","last_name","company_name","title"],"type":"array","items":{"type":"string"}}},"required":["name","steps","schedule","inbox_ids","daily_new_cap","import_ids","available_fields"],"additionalProperties":false},"note":{"type":"string"}},"required":["dry_run","spec","note"],"additionalProperties":false}}}},"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","const":"activating"},"next":{"type":"string"}},"required":["id","version","status","next"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/lint":{"get":{"summary":"Run every free launch check without activating: copy, leads, inboxes, sender, tier; each issue with a fix","tags":["Campaigns"],"description":"Scope: `campaigns:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"field":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"],"additionalProperties":false}},"leads":{"type":"object","properties":{"imports":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["imports"],"additionalProperties":false},"inboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ibx_[0-9A-HJKMNP-TV-Z]{26}$"},"address":{"type":"string"},"state":{"type":"string","enum":["warming","ready","sending","paused","retired"]},"cold_ready":{"type":"boolean"}},"required":["id","address","state","cold_ready"],"additionalProperties":false}},"not_checked":{"type":"array","items":{"type":"string"}}},"required":["ok","issues","leads","inboxes","not_checked"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/sending-status":{"get":{"summary":"What is sending, what is blocked and why, with a fix","tags":["Campaigns"],"description":"Scope: `campaigns:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["draft","activating","rejected","sending","waiting","pausing","paused"]},"reason":{"type":"string"},"fix":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_action_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"gate":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"state":{"type":"string","enum":["active","rejected"]},"reason":{"anyOf":[{"type":"string","enum":["content","no_eligible_leads","inboxes"]},{"type":"null"}]},"imports":{"type":"object","properties":{"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid_syntax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["received","accepted","duplicate","invalid_syntax"],"additionalProperties":false},"eligible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canary":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"field":{"type":"string"},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"],"additionalProperties":false}},"content_hash":{"type":"string"},"footers":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"variant":{"type":"string"},"footer":{"type":"boolean"},"commercial_probability":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["step","variant","footer","commercial_probability"],"additionalProperties":false}}},"required":["version","state","reason","imports","eligible","added","canary","excluded","issues","content_hash"],"additionalProperties":false},{"type":"null"}]},"blocked_by":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"}},"required":["code","count"],"additionalProperties":false}},"inboxes":{"type":"array","items":{"type":"object","properties":{"last_tick_at":{"type":"string"},"planned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"skips":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"next_send_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["status","reason","fix","next_action_at","gate","blocked_by","inboxes"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/pause":{"post":{"summary":"Pause sending; status reads \"pausing\" until the data plane confirms (seconds). Works while activating too","tags":["Campaigns"],"description":"Scope: `campaigns:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":{},"type":"object","properties":{"reason":{"description":"Kept with the request; shown in activity","type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"desired":{"type":"string","const":"paused"},"status":{"type":"string","enum":["draft","activating","active","paused","completed","rejected","archived","pausing","resuming","paused_by_system"]},"note":{"type":"string"}},"required":["id","desired","status","note"],"additionalProperties":false}}}},"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"desired":{"type":"string","enum":["paused","running"]},"status":{"type":"string","enum":["pausing","resuming"]},"next":{"type":"string"}},"required":["id","desired","status","next"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/resume":{"post":{"summary":"Resume a campaign you paused (never lifts a safety pause)","tags":["Campaigns"],"description":"Scope: `campaigns:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","default":{},"type":"object","properties":{"reason":{"description":"Kept with the request; shown in activity","type":"string","maxLength":200}}}}}},"responses":{"202":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"desired":{"type":"string","enum":["paused","running"]},"status":{"type":"string","enum":["pausing","resuming"]},"next":{"type":"string"}},"required":["id","desired","status","next"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/workspace/next-actions":{"get":{"summary":"Every blocker and next step across the workspace, blockers first: each with a fix, whether your human is needed, and the call to make","tags":["Account"],"description":"Scope: `workspace:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"summary":{"type":"string"},"actions":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"kind":{"type":"string","enum":["blocker","todo","waiting"]},"message":{"type":"string"},"fix":{"type":"string"},"requires_human":{"type":"boolean"},"campaign_id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"next_action":{"type":"object","properties":{"method":{"type":"string"},"path":{"type":"string"},"tool":{"type":"string"}},"required":["method","path","tool"],"additionalProperties":false}},"required":["code","kind","message","fix","requires_human"],"additionalProperties":false}}},"required":["summary","actions"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/webhooks":{"get":{"summary":"Webhooks of this workspace","tags":["Webhooks"],"description":"Scope: `webhooks:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^whk_[0-9A-HJKMNP-TV-Z]{26}$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","url","events","status","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Subscribe an https URL to events (or [\"*\"]); returns the signing secret once; at most 10","tags":["Webhooks"],"description":"Scope: `webhooks:write`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"description":"A public https URL; it receives a signed POST per event","type":"string"},"events":{"description":"Event types (reply.received, campaign.ready, campaign.rejected) or [\"*\"] for all","minItems":1,"type":"array","items":{"type":"string","enum":["reply.received","campaign.ready","campaign.rejected","*"]}}},"required":["url","events"]}}}},"responses":{"201":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^whk_[0-9A-HJKMNP-TV-Z]{26}$"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"secret":{"type":"string"},"note":{"type":"string"}},"required":["id","url","events","status","created_at","secret","note"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/webhooks/{id}":{"delete":{"summary":"Delete a webhook; pending deliveries stop","tags":["Webhooks"],"description":"Scope: `webhooks:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^whk_[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/webhooks/{id}/test":{"post":{"summary":"Send a signed webhook.test event now; returns the status code your endpoint answered","tags":["Webhooks"],"description":"Scope: `webhooks:write`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"delivery_id":{"type":"string","pattern":"^whd_[0-9A-HJKMNP-TV-Z]{26}$"},"event_id":{"type":"string"},"delivered":{"type":"boolean"},"status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["delivery_id","event_id","delivered","status_code","error","duration_ms"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/webhooks/{id}/deliveries":{"get":{"summary":"Deliveries of a webhook, newest first: attempts, last status, next retry","tags":["Webhooks"],"description":"Scope: `webhooks:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^whd_[0-9A-HJKMNP-TV-Z]{26}$"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_attempt_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","event_id","event_type","status","attempts","last_status_code","last_error","last_attempt_at","next_attempt_at","delivered_at","created_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/analytics":{"get":{"summary":"Totals, rates, by step and variant, lead states","tags":["Campaigns"],"description":"Scope: `campaigns:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaign_id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"soft_bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complained":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"auto_replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"interested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_interested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsubscribed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opened":{"type":"null"},"clicked":{"type":"null"},"bounce_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"reply_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"interested_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaint_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"unsubscribed_by_link":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sent","hard_bounced","soft_bounced","complained","replied","auto_replied","interested","not_interested","unsubscribed","bounced","delivered","opened","clicked","bounce_rate","reply_rate","interested_rate","complaint_rate","unsubscribed_by_link"],"additionalProperties":false},"leads":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"in_sequence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["total","in_sequence","completed","stopped"],"additionalProperties":false},"steps":{"type":"array","items":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"soft_bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complained":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"auto_replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"interested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_interested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsubscribed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opened":{"type":"null"},"clicked":{"type":"null"},"bounce_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"reply_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"interested_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaint_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["sent","hard_bounced","soft_bounced","complained","replied","auto_replied","interested","not_interested","unsubscribed","bounced","delivered","opened","clicked","bounce_rate","reply_rate","interested_rate","complaint_rate","version","step","variant_id"],"additionalProperties":false}},"tracking":{"type":"string"}},"required":["campaign_id","version","totals","leads","steps","tracking"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/campaigns/{id}/analytics/daily":{"get":{"summary":"Counters by day","tags":["Campaigns"],"description":"Scope: `campaigns:read`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"timezone","in":"query","required":false,"description":"IANA zone (default: the campaign's)","schema":{"type":"string"}},{"name":"days","in":"query","required":false,"description":"1–90 (default 30)","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaign_id":{"type":"string","pattern":"^cmp_[0-9A-HJKMNP-TV-Z]{26}$"},"timezone":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"soft_bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complained":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"auto_replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"interested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_interested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsubscribed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opened":{"type":"null"},"clicked":{"type":"null"},"bounce_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"reply_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"interested_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaint_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"day":{"type":"string"}},"required":["sent","hard_bounced","soft_bounced","complained","replied","auto_replied","interested","not_interested","unsubscribed","bounced","delivered","opened","clicked","bounce_rate","reply_rate","interested_rate","complaint_rate","day"],"additionalProperties":false}},"tracking":{"type":"string"}},"required":["campaign_id","timezone","data","tracking"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/billing/balance":{"get":{"summary":"Credit balance: total, held for purchases, available","tags":["Credits"],"description":"Scope: `billing:read`","parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"workspace_id":{"type":"string","pattern":"^ws_[0-9A-HJKMNP-TV-Z]{26}$"},"balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2,6}$"},"held":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"available":{"type":"string","pattern":"^-?\\d+\\.\\d{2,6}$"},"currency":{"type":"string","const":"USD"}},"required":["workspace_id","balance","held","available","currency"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/billing/ledger":{"get":{"summary":"Credit movements, newest first","tags":["Credits"],"description":"Scope: `billing:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"kind":{"type":"string","enum":["topup","refund","debit_estimate","debit_true_up","grant","adjustment","transfer_in","transfer_out"]},"amount":{"type":"string","pattern":"^-?\\d+\\.\\d{2,6}$"},"ref_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"ref_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","at","kind","amount","ref_type","ref_id","note"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/usage":{"get":{"summary":"Usage and spend, grouped by meter and/or day","tags":["Credits"],"description":"Scope: `billing:read`","parameters":[{"name":"from","in":"query","required":false,"description":"YYYY-MM-DD (default: first day of this month, UTC)","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"YYYY-MM-DD (default: today)","schema":{"type":"string"}},{"name":"group_by","in":"query","required":false,"description":"meter | day | day,meter","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"group_by":{"type":"string","enum":["meter","day","day,meter"]},"data":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"meter":{"type":"string","enum":["send","verification","personalization","classification","domain","domain_renewal","inbox_month","placement_test","workspace_month","contact"]},"quantity":{"type":"number"},"amount":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"}},"required":["quantity","amount"],"additionalProperties":false}},"total_amount":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"}},"required":["from","to","group_by","data","total_amount"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/prices":{"get":{"summary":"The price list in force","tags":["Credits"],"parameters":[{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"meter":{"type":"string","enum":["send","verification","personalization","classification","domain","domain_renewal","inbox_month","placement_test","workspace_month","contact"]},"unit":{"type":"string"},"price":{"type":"string","pattern":"^\\d+\\.\\d{2,6}$"},"from_monthly_quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["meter","unit","price","from_monthly_quantity"],"additionalProperties":false}},"currency":{"type":"string","const":"USD"}},"required":["data","currency"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/me/sessions":{"get":{"summary":"Your signed-in sessions (people only)","tags":["Keys and people"],"description":"Signed-in people only (session cookie on the app host); API keys get 403 not_a_person.","parameters":[],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ses_[0-9A-HJKMNP-TV-Z]{26}$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"last_seen_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"current":{"type":"boolean"}},"required":["id","created_at","last_seen_at","expires_at","ip","user_agent","current"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/me/sessions/{id}":{"delete":{"summary":"Sign out one of your sessions","tags":["Keys and people"],"description":"Signed-in people only (session cookie on the app host); API keys get 403 not_a_person.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^ses_[0-9A-HJKMNP-TV-Z]{26}$"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/me/sessions/revoke-others":{"post":{"summary":"Sign out every session but this one","tags":["Keys and people"],"description":"Signed-in people only (session cookie on the app host); API keys get 403 not_a_person.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per write; reuse it to retry safely","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revoked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["revoked"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/audit-log":{"get":{"summary":"Who did what in this workspace, people and keys","tags":["Keys and people"],"description":"Scope: `members:read`","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 50)","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}},{"name":"X-Workspace-Id","in":"header","required":false,"description":"Required with account-wide keys and for people with several workspaces","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"actor_type":{"type":"string","enum":["api_key","human","service"]},"actor_id":{"type":"string"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"target_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"target_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"diff":{}},"required":["id","at","actor_type","actor_id","actor_email","action","target_type","target_id","diff"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}}}}