{"openapi":"3.0.3","info":{"title":"ReachHQ Public API","version":"1.0.0","description":"Scoped programmatic access to ReachHQ. Authenticate with `Authorization: Bearer rhq_live_…`. Each operation requires the scope listed in its description."},"servers":[{"url":"/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A workspace API key (rhq_live_…)."}},"schemas":{"ApiError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"traceId":{"type":"string"},"details":{}},"required":["code","message"]},"Paginated":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}},"paths":{"/whoami":{"get":{"operationId":"whoami","summary":"Identity of the calling key (workspace + granted scopes).","responses":{"200":{"description":"The key principal","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns":{"get":{"operationId":"campaigns.list","summary":"List campaigns in the workspace. (scope: campaigns:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of campaigns","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"campaigns.create","summary":"Create a campaign. (scope: campaigns:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"goal":{"type":"string"},"type":{"type":"string","enum":["SEQUENCE","ONE_OFF"]},"clientId":{"type":"string"}}}}}},"responses":{"201":{"description":"The created campaign","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}":{"get":{"operationId":"campaigns.get","summary":"Get a campaign by id. (scope: campaigns:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The campaign","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"campaigns.update","summary":"Update a campaign's basics (name, description, goal, type, client). (scope: campaigns:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"goal":{"type":"string"},"type":{"type":"string","enum":["SEQUENCE","ONE_OFF"]},"clientId":{"type":"string","nullable":true},"expectedVersion":{"type":"integer"}}}}}},"responses":{"200":{"description":"The updated campaign","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Version conflict (expectedVersion mismatch)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/duplicate":{"post":{"operationId":"campaigns.duplicate","summary":"Duplicate a campaign (options + sequence; audience starts empty). (scope: campaigns:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"newName":{"type":"string"}}}}}},"responses":{"201":{"description":"The duplicated campaign","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/archive":{"post":{"operationId":"campaigns.archive","summary":"Archive a campaign. (scope: campaigns:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The archived campaign","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/validate":{"get":{"operationId":"campaigns.validate","summary":"Validate a campaign for launch readiness (dry-run). (scope: campaigns:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Validation result (valid, errors, warnings)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/settings":{"get":{"operationId":"campaigns.settings.get","summary":"Get a campaign's settings (sending options). (scope: campaigns:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The campaign settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"campaigns.settings.update","summary":"Update a campaign's settings (sending options). (scope: campaigns:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Partial campaign options to merge"}}}},"responses":{"200":{"description":"The updated campaign settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/sequence":{"get":{"operationId":"campaigns.sequence.get","summary":"Get a campaign's sequence with its steps and variants. (scope: campaigns:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The sequence with steps and variants","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"operationId":"campaigns.sequence.update","summary":"Update a campaign's sequence (set mode, replace steps, or reorder). (scope: campaigns:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["setMode","replaceSteps","reorder"]},"mode":{"type":"string","enum":["DEFAULT","VISUAL"]},"steps":{"type":"array","items":{"type":"object","additionalProperties":true}},"orderedStepIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"The updated sequence","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/sequence/preview":{"post":{"operationId":"campaigns.sequence.preview","summary":"Preview a rendered sequence email against a lead's merge fields. (scope: campaigns:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"stepId":{"type":"string"},"variantId":{"type":"string"},"leadId":{"type":"string"}}}}}},"responses":{"200":{"description":"The rendered preview with any missing variables","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign or variant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/control":{"post":{"operationId":"campaigns.control","summary":"Launch, pause, or resume campaign sending. Launch validates first and only sends if valid. CAN CAUSE EMAIL TO BE SENT. (scope: campaigns:launch)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["launch","pause","resume"],"description":"launch validates first and only sends if valid; pause stops; resume re-activates"}}}}}},"responses":{"200":{"description":"Launch result (launched + validation) or the paused/resumed campaign","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/test-send":{"post":{"operationId":"campaigns.test_send","summary":"Send a single [TEST] email of a sequence variant to a given address. CAN CAUSE EMAIL TO BE SENT. (scope: campaigns:launch)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["toEmail"],"properties":{"toEmail":{"type":"string","format":"email","description":"Address to send the test email to"},"stepId":{"type":"string"},"variantId":{"type":"string"},"leadId":{"type":"string"}}}}}},"responses":{"200":{"description":"The test-send result (ok, messageId, sentTo)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign or variant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/recipients":{"get":{"operationId":"recipients.list","summary":"List a campaign's recipients with status breakdown stats. (scope: recipients:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of recipients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"recipients.manage","summary":"Manage a campaign's recipients (add, refresh audience, remove, set outcome). (scope: recipients:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["addManual","addFromList","refreshAudience","bulkRemove","updateOutcome"]},"emails":{"type":"array","items":{"type":"string","format":"email"}},"leadListId":{"type":"string"},"recipientIds":{"type":"array","items":{"type":"string"}},"recipientId":{"type":"string"},"meetingBooked":{"type":"boolean"},"meetingBookedAt":{"type":"string"},"revenueAmount":{"type":"string"},"revenueCurrency":{"type":"string"},"outcomeNotes":{"type":"string"}}}}}},"responses":{"200":{"description":"Result of the recipient operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/campaigns/{id}/recipients/stats":{"get":{"operationId":"recipients.stats","summary":"Recipient status-breakdown counts for a campaign. (scope: recipients:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Recipient counts by status","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads":{"get":{"operationId":"leads.list","summary":"Search leads in the workspace with rich filters (search, status, tags, verification, list). (scope: leads:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"verificationStatus","in":"query","schema":{"type":"string"}},{"name":"domain","in":"query","schema":{"type":"string"}},{"name":"tags","in":"query","schema":{"type":"string"}},{"name":"suppressed","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"listId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of leads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"leads.create","summary":"Create a lead. (scope: leads:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","additionalProperties":true}},"additionalProperties":true}}}},"responses":{"201":{"description":"The created lead","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Lead already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/export":{"get":{"operationId":"leads.export","summary":"Export the workspace's leads as CSV. (scope: leads:read)","responses":{"200":{"description":"A CSV export of the workspace leads","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/tags":{"get":{"operationId":"leads.tags","summary":"The distinct lead tags in the workspace. (scope: leads:read)","responses":{"200":{"description":"The workspace lead tags","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/import":{"post":{"operationId":"leads.import","summary":"Import leads from JSON rows (dry-run + commit) or fetch a shared Google Sheet. (scope: leads:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["dryRun","commit","googleSheet"]},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}},"fieldMapping":{"type":"object","additionalProperties":true},"source":{"type":"string","enum":["CSV","MANUAL","GOOGLE_SHEETS"]},"fileName":{"type":"string"},"url":{"type":"string"}}}}}},"responses":{"200":{"description":"The import result (preview, commit summary, or sheet rows)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/manage":{"post":{"operationId":"leads.manage","summary":"Manage leads: update, delete, bulk-delete, bulk add/remove tags, and create/delete notes. (scope: leads:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["update","delete","bulkDelete","bulkAddTags","bulkRemoveTags","createNote","deleteNote"]},"leadId":{"type":"string"},"patch":{"type":"object","additionalProperties":true},"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"authorUserId":{"type":"string"},"body":{"type":"string"},"noteId":{"type":"string"}}}}}},"responses":{"200":{"description":"Result of the lead operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Lead or note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/suppress":{"post":{"operationId":"leads.suppress","summary":"Suppress or unsuppress one or many leads. SENSITIVE — changes who can receive email. Idempotent. (scope: leads:suppress)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action","ids"],"properties":{"action":{"type":"string","enum":["suppress","unsuppress"]},"ids":{"type":"array","items":{"type":"string"},"minItems":1}}}}}},"responses":{"200":{"description":"Count of leads whose suppression state changed","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/{id}":{"get":{"operationId":"leads.get","summary":"Get a lead by id with its lists, campaign history, and note count. (scope: leads:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The lead with its lists and campaign history","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Lead not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/leads/{id}/activity":{"get":{"operationId":"leads.activity","summary":"Read a lead's activity timeline, its notes, or the workspace tag catalogue. (scope: leads:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"view","in":"query","schema":{"type":"string","enum":["activity","notes"],"default":"activity"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The lead's activity or notes","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/block-list":{"get":{"operationId":"block_list.read","summary":"List the workspace's block-list entries (suppressed emails/domains). (scope: block_list:read)","responses":{"200":{"description":"The workspace block-list entries","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"block_list.write","summary":"Add or remove a workspace block-list entry. SENSITIVE — changes who can receive email. Add is idempotent. (scope: block_list:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"Email or domain to block"},"type":{"type":"string","enum":["EMAIL","DOMAIN"]},"reason":{"type":"string"}}}}}},"responses":{"201":{"description":"The block-list entry (existing one if already present)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/block-list/{id}":{"delete":{"operationId":"block_list.remove","summary":"Remove a workspace block-list entry by id. SENSITIVE. (scope: block_list:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removal acknowledged","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/lead-lists":{"get":{"operationId":"lead_lists.read","summary":"List lead lists. (scope: lead_lists:read)","responses":{"200":{"description":"The workspace lead lists","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"lead_lists.write","summary":"Create a lead list. (scope: lead_lists:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["STATIC","DYNAMIC"]},"filterRules":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"The created lead list","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/lead-lists/preview":{"post":{"operationId":"lead_lists.preview","summary":"Preview a dynamic segment against the workspace leads. (scope: lead_lists:read)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filterRules"],"properties":{"filterRules":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Segment count and a sample of matches","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/lead-lists/manage":{"post":{"operationId":"lead_lists.manage","summary":"Update or delete a lead list, or add/remove members. (scope: lead_lists:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action","listId"],"properties":{"action":{"type":"string","enum":["update","delete","addMembers","removeMembers"]},"listId":{"type":"string"},"input":{"type":"object","additionalProperties":true},"leadIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Result of the lead-list operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/custom-fields":{"get":{"operationId":"custom_fields.read","summary":"List custom fields. (scope: custom_fields:read)","parameters":[{"name":"includeArchived","in":"query","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The workspace custom fields","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"custom_fields.write","summary":"Create a custom field. (scope: custom_fields:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"label":{"type":"string"},"key":{"type":"string"},"type":{"type":"string","enum":["TEXT","URL","NUMBER","DATE","SELECT"]},"options":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"The created custom field","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/custom-fields/variables":{"get":{"operationId":"custom_fields.variables","summary":"The template-variable catalogue (built-ins + custom fields). (scope: custom_fields:read)","responses":{"200":{"description":"The variable catalogue","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/custom-fields/manage":{"post":{"operationId":"custom_fields.manage","summary":"Update, reorder, or delete custom fields. (scope: custom_fields:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["update","reorder","delete"]},"fieldId":{"type":"string"},"input":{"type":"object","additionalProperties":true},"ids":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Result of the custom-field operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Field not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deals":{"get":{"operationId":"deals.read","summary":"List deals in the workspace. (scope: deals:read)","parameters":[{"name":"leadId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"The workspace deals","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"deals.write","summary":"Create a deal. (scope: deals:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["leadId","name"],"properties":{"leadId":{"type":"string"},"name":{"type":"string"},"stage":{"type":"string"},"amountCents":{"type":"integer"}}}}}},"responses":{"201":{"description":"The created deal","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deals/{id}/delete":{"post":{"operationId":"deals.delete","summary":"Delete a deal. (scope: deals:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The deleted deal id","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes":{"get":{"operationId":"mailboxes.list","summary":"List connected mailboxes and their health, or get one by id. (scope: mailboxes:read)","responses":{"200":{"description":"Connected mailboxes with health","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/manage":{"post":{"operationId":"mailboxes.manage","summary":"Manage mailbox settings: update identity/sending settings, edit tags, bulk-update, pause, or resume. (scope: mailboxes:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["updateSettings","updateTags","bulkUpdateSettings","bulkUpdateTags","pause","resume"]},"mailboxId":{"type":"string"},"mailboxIds":{"type":"array","items":{"type":"string"}},"patch":{"type":"object","additionalProperties":true},"add":{"type":"array","items":{"type":"string"}},"remove":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Result of the mailbox management operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Mailbox not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/tracking-domain":{"post":{"operationId":"mailboxes.tracking_domain","summary":"Set, verify, or detach a mailbox's custom tracking domain. (scope: mailboxes:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action","mailboxId"],"properties":{"action":{"type":"string","enum":["set","verify","detach"]},"mailboxId":{"type":"string"},"domain":{"type":"string","description":"Required for action=set"}}}}}},"responses":{"200":{"description":"The mailbox with its updated tracking-domain state","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Mailbox not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/{id}":{"get":{"operationId":"mailboxes.get","summary":"Get a single connected mailbox by id. (scope: mailboxes:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The mailbox","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Mailbox not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/{id}/verify-dns":{"post":{"operationId":"mailboxes.verify_dns","summary":"Check a mailbox's connection-verification status; resend or skip verification (write). (scope: mailboxes:read for status; mailboxes:write for resend/skip)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["status","resend","skip"],"default":"status"}}}}}},"responses":{"200":{"description":"The verification status or the affected mailbox","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Mailbox not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/connect":{"post":{"operationId":"mailboxes.connect","summary":"Connect a sending mailbox (SMTP/IMAP test + save, Google/Microsoft OAuth start — returns a browser consent URL — or app-password/basic SMTP). SENSITIVE — adds a sending identity. (scope: mailboxes:connect)","description":"OAuth-start actions (googleOAuthStart/microsoftOAuthStart) return a provider consent URL to open in a browser — OAuth is browser-redirect and cannot complete headless; the mailbox is created when the user authorizes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["smtpTest","smtpConnect","googleOAuthStart","googleAppPassword","microsoftOAuthStart","microsoftSmtp"]},"credentials":{"type":"object","description":"SMTP/IMAP credentials (smtpTest, smtpConnect)","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"smtpHost":{"type":"string"},"smtpPort":{"type":"integer"},"imapHost":{"type":"string"},"imapPort":{"type":"integer"},"security":{"type":"string","enum":["SSL_TLS","STARTTLS","NONE"]},"name":{"type":"string"}}},"google":{"type":"object","description":"Gmail app-password credentials (googleAppPassword)","properties":{"email":{"type":"string","format":"email"},"appPassword":{"type":"string"},"name":{"type":"string"}}},"microsoft":{"type":"object","description":"Microsoft basic SMTP/IMAP credentials (microsoftSmtp)","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"name":{"type":"string"},"smtpHost":{"type":"string"},"smtpPort":{"type":"integer"},"imapHost":{"type":"string"},"imapPort":{"type":"integer"}}}}}}}},"responses":{"200":{"description":"Connection test result, the connected mailbox, or an OAuth consent URL ({ authUrl })","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/{id}/disconnect":{"post":{"operationId":"mailboxes.disconnect","summary":"Disconnect or permanently delete a mailbox. SENSITIVE — removes a sending identity. (scope: mailboxes:connect)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["disconnect","delete"],"default":"disconnect"}}}}}},"responses":{"200":{"description":"The affected mailbox or a delete acknowledgement","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Mailbox not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/import/test-bulk":{"post":{"operationId":"mailboxes.import.test_bulk","summary":"Preview a bulk mailbox import — probe SMTP/IMAP for each parsed CSV row (no DB write). (scope: mailboxes:connect)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}},"description":"Parsed CSV rows as JSON objects (snake_case/camelCase headers + app_password accepted)"}}}}}},"responses":{"200":{"description":"Per-row connection test results","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/import/csv":{"post":{"operationId":"mailboxes.import","summary":"Enqueue an async bulk mailbox import job from CSV rows. Idempotent per address. (scope: mailboxes:connect)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fileName","rows"],"properties":{"fileName":{"type":"string"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}},"description":"Parsed CSV rows as JSON objects"}}}}}},"responses":{"202":{"description":"The created import job (poll GET /mailboxes/import/{jobId})","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/mailboxes/import/{jobId}":{"get":{"operationId":"mailboxes.import.job_status","summary":"Poll a bulk mailbox-import job's progress/result. (scope: mailboxes:connect)","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The import job status","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Import job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/enrolments":{"get":{"operationId":"warmup.list","summary":"Read mailbox warmup: enrolments list/get, heatmap, reputation trend, or 7-day bounces. (scope: warmup:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of warmup enrolments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/enrolments/{mailboxId}":{"get":{"operationId":"warmup.enrolment.get","summary":"Get a single warmup enrolment by mailbox id. (scope: warmup:read)","parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The warmup enrolment","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Enrolment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/enrolments/{mailboxId}/heatmap":{"get":{"operationId":"warmup.enrolment.heatmap","summary":"Daily warmup send/reply/engagement rows for a mailbox. (scope: warmup:read)","parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":90,"default":14}}],"responses":{"200":{"description":"Heatmap day rows","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Enrolment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/enrolments/{mailboxId}/reputation":{"get":{"operationId":"warmup.enrolment.reputation","summary":"Reputation-score trend points for a mailbox. (scope: warmup:read)","parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":180,"default":30}}],"responses":{"200":{"description":"Reputation trend points","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Enrolment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/enrolments/{mailboxId}/bounces":{"get":{"operationId":"warmup.enrolment.bounces","summary":"Rolling 7-day bounce summary for a mailbox. (scope: warmup:read)","parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Bounce summary (hard/soft/total + last bounce)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Enrolment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/manage":{"post":{"operationId":"warmup.manage","summary":"Manage warmup: start/pause/stop/reconnect/remove, configure, onboard mailboxes, mark-important/unspam, bulk action, or apply a preset. (scope: warmup:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["start","pause","stop","reconnect","remove","configure","markImportant","unspam","onboard","bulkAction","applyPreset"]},"mailboxId":{"type":"string"},"mailboxIds":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":true},"preset":{"type":"string","enum":["COLD","WARM","AGGRESSIVE","CUSTOM"]},"customConfig":{"type":"object","additionalProperties":true},"bulkAction":{"type":"string","enum":["start","pause","stop","reconnect","remove","apply-config"]},"onboard":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Result of the warmup management operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Enrolment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/warmup/pools":{"post":{"operationId":"warmup_pools.read","summary":"Read or manage warmup pools. action=overview/listPrivate read (scope: warmup:read); action=createPrivate/deletePrivate/setParticipation mutate (scope: warmup:write).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["overview","listPrivate","createPrivate","deletePrivate","setParticipation"]},"name":{"type":"string","description":"createPrivate"},"mailboxIds":{"type":"array","items":{"type":"string"},"description":"createPrivate"},"poolId":{"type":"string","description":"deletePrivate"},"mailboxId":{"type":"string","description":"setParticipation"},"pools":{"type":"array","description":"setParticipation — shares sum to ≤ 1","items":{"type":"object","properties":{"type":{"type":"string"},"share":{"type":"number"}}}}}}}}},"responses":{"200":{"description":"Pools overview/list or the result of the pool mutation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Enrolment or pool not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads":{"get":{"operationId":"inbox.threads.list","summary":"List inbox threads with filters (campaign, mailbox, category, folder, search, flags, date range). (scope: inbox:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"archived","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"unreadOnly","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"starredOnly","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"hasAttachments","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"campaignId","in":"query","schema":{"type":"string"}},{"name":"mailboxIds","in":"query","schema":{"type":"string"},"description":"Comma-separated mailbox ids"},{"name":"category","in":"query","schema":{"type":"string"}},{"name":"categories","in":"query","schema":{"type":"string"},"description":"Comma-separated reply categories"},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"lastMessageAfter","in":"query","schema":{"type":"string"}},{"name":"lastMessageBefore","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of inbox threads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/summary":{"get":{"operationId":"inbox.summary","summary":"Inbox replies summary: unread/total/starred/archived counts, category facets, and the unread count. (scope: inbox:read)","responses":{"200":{"description":"Inbox summary counts, facets, and unread count","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/scheduled":{"get":{"operationId":"inbox.scheduled.read","summary":"List scheduled replies. (scope: inbox:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"mailboxIds","in":"query","schema":{"type":"string"},"description":"Comma-separated mailbox ids"}],"responses":{"200":{"description":"A page of scheduled replies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/scheduled/{id}/cancel":{"post":{"operationId":"inbox.scheduled.write","summary":"Cancel a pending scheduled reply. (scope: inbox:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancel result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/messages/{messageId}/category":{"post":{"operationId":"inbox.categorize","summary":"Set a manual reply category on an inbox message. (scope: inbox:write)","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["category"],"properties":{"category":{"type":"string"}}}}}},"responses":{"200":{"description":"Categorize result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Message not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads/{root}":{"get":{"operationId":"inbox.threads.get","summary":"Get an inbox thread with its messages. (scope: inbox:read)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The thread with its messages","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Thread not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads/{root}/manage":{"post":{"operationId":"inbox.manage","summary":"Manage a thread (non-send): archive/unarchive, read/unread, star/unstar. (scope: inbox:write)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["archive","unarchive","read","unread","star","unstar"]}}}}}},"responses":{"200":{"description":"Manage result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads/{root}/attachments":{"get":{"operationId":"inbox.attachment.download","summary":"Get inbound attachment metadata for a thread's messages. (scope: inbox:read)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Inbound attachment metadata for the thread","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads/{root}/draft":{"get":{"operationId":"inbox.draft.read","summary":"Get a thread's saved reply draft. (scope: inbox:read)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The saved draft (or null)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"operationId":"inbox.draft.save","summary":"Save a thread's reply draft. (scope: inbox:write)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","bodyText","bodyFormat"],"properties":{"userId":{"type":"string"},"bodyText":{"type":"string"},"bodyHtml":{"type":"string"},"bodyFormat":{"type":"string","enum":["HTML","PLAIN_TEXT"]},"empty":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The saved draft (or null when cleared)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"inbox.draft.delete","summary":"Delete a thread's reply draft. (scope: inbox:write)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads/{root}/reply":{"post":{"operationId":"inbox.reply.send","summary":"Send an immediate reply on a thread. Requires an idempotency key (never double-sends) and is suppression-checked. CAN CAUSE EMAIL TO BE SENT. (scope: inbox:send)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idempotencyKey"],"properties":{"bodyText":{"type":"string"},"bodyHtml":{"type":"string"},"idempotencyKey":{"type":"string","description":"Caller-supplied unique key; reusing it replays the prior send without re-sending."}}}}}},"responses":{"200":{"description":"The sent reply message (deduplicated=true if replayed)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/inbox/threads/{root}/schedule":{"post":{"operationId":"inbox.reply.schedule","summary":"Schedule a reply on a thread for later delivery (suppression-checked). CAN CAUSE EMAIL TO BE SENT. (scope: inbox:send)","parameters":[{"name":"root","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sendAt"],"properties":{"bodyText":{"type":"string"},"bodyHtml":{"type":"string"},"sendAt":{"type":"string","description":"When to send, ISO 8601 timestamp."}}}}}},"responses":{"200":{"description":"The created scheduled reply","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/campaigns/{campaignId}/settings":{"get":{"operationId":"agent.settings.read","summary":"Get a campaign's AI inbox-agent settings (goal, persona, playbook, autonomy, confidence, LLM model). (scope: inbox:read)","parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The resolved agent settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"operationId":"agent.settings.write","summary":"Update a campaign's AI inbox-agent settings (goal, persona, playbook, hard rules, autonomy, confidence, LLM model). (scope: inbox:write)","parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The updated agent settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/llm/models":{"get":{"operationId":"agent.models.list","summary":"List the AI inbox-agent's available LLM models, grouped by provider. (scope: inbox:read)","parameters":[{"name":"refresh","in":"query","schema":{"type":"string","enum":["1","true"]}}],"responses":{"200":{"description":"LLM model groups by provider","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/approvals":{"get":{"operationId":"agent.approvals.read","summary":"List the AI inbox-agent's reply approval queue, or its filter facets. (scope: inbox:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"status","in":"query","schema":{"type":"string"},"description":"Default PENDING"},{"name":"campaignId","in":"query","schema":{"type":"string"},"description":"Comma-separated campaign ids"},{"name":"intent","in":"query","schema":{"type":"string"},"description":"Comma-separated intents"},{"name":"queueReason","in":"query","schema":{"type":"string"},"description":"Comma-separated queue-reason prefixes"},{"name":"mailboxId","in":"query","schema":{"type":"string"},"description":"Comma-separated mailbox ids"}],"responses":{"200":{"description":"A page of approval-queue drafts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/approvals/facets":{"get":{"operationId":"agent.approvals.facets","summary":"Distinct filter-chip counts for the approval queue. (scope: inbox:read)","parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"Default PENDING"}],"responses":{"200":{"description":"Facet counts by intent/campaign/queueReason/mailbox","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/approvals/{id}/approve":{"post":{"operationId":"agent.approval.approve","summary":"Approve an agent reply draft (optional edits). Idempotent on the id. (scope: inbox:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"editedSubject":{"type":"string"},"editedBody":{"type":"string"}}}}}},"responses":{"200":{"description":"The approved (or signalled) approval","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Approval not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/approvals/{id}/reject":{"post":{"operationId":"agent.approval.reject","summary":"Reject an agent reply draft (optional reason). Idempotent on the id. (scope: inbox:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"The rejected (or signalled) approval","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Approval not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/approvals/bulk":{"post":{"operationId":"agent.approval.bulk","summary":"Bulk approve/reject agent reply drafts by id. (scope: inbox:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"type":"array","items":{"type":"string"},"maxItems":200},"action":{"type":"string","enum":["approve","reject"]},"reason":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Bulk result (requested/succeeded/skippedLowConfidence/failed)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/calendar/connection":{"get":{"operationId":"agent.calendar.read","summary":"Read the AI inbox-agent's calendar connection or its bookable event types. (scope: inbox:read)","responses":{"200":{"description":"The active calendar connection (or null)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/calendar/event-types":{"get":{"operationId":"agent.calendar.event_types","summary":"List the connected calendar's bookable event types. (scope: inbox:read)","responses":{"200":{"description":"The connection's event types","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agent/calendar/connect":{"post":{"operationId":"agent.calendar.write","summary":"Connect a calendar (Cal.com / Calendly) for the AI inbox-agent to book meetings. (scope: inbox:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider","apiToken"],"properties":{"provider":{"type":"string","enum":["CALCOM","CALENDLY"]},"apiToken":{"type":"string"},"defaultEventTypeRef":{"type":"string","nullable":true},"defaultEventTypeLabel":{"type":"string","nullable":true},"schedulingPageUrl":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Connect result ({ ok, user })","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/overview":{"get":{"operationId":"deliverability.overview","summary":"Deliverability workspace overview (score, grade tallies, alert/recommendation counts, recent timeline). (scope: deliverability:read)","responses":{"200":{"description":"The deliverability overview","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/score":{"get":{"operationId":"deliverability.score","summary":"Current deliverability score + history for a scope. (scope: deliverability:read)","parameters":[{"name":"scope","in":"query","schema":{"type":"string","enum":["WORKSPACE","DOMAIN","MAILBOX","CAMPAIGN"]}},{"name":"refId","in":"query","schema":{"type":"string"},"description":"Required for a non-workspace scope"},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":180}}],"responses":{"200":{"description":"The score view","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/score/history":{"get":{"operationId":"deliverability.score.history","summary":"Deliverability score-history points for a scope. (scope: deliverability:read)","parameters":[{"name":"scope","in":"query","schema":{"type":"string","enum":["WORKSPACE","DOMAIN","MAILBOX","CAMPAIGN"]}},{"name":"refId","in":"query","schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":180}}],"responses":{"200":{"description":"The score-history points","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/score/correlation":{"get":{"operationId":"deliverability.score.correlation","summary":"Per-day score-vs-penalty correlation series. (scope: deliverability:read)","parameters":[{"name":"scope","in":"query","schema":{"type":"string","enum":["WORKSPACE","DOMAIN","MAILBOX","CAMPAIGN"]}},{"name":"refId","in":"query","schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"The correlation series","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/timeline":{"get":{"operationId":"deliverability.timeline","summary":"Deliverability event timeline (cursor-paginated). (scope: deliverability:read)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"occurredAt ISO of the last item"}],"responses":{"200":{"description":"A page of timeline events + nextCursor","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/domains":{"get":{"operationId":"deliverability.domains.read","summary":"List sending domains with auth/health, or get one domain with its DNS-check history. (scope: deliverability:read)","responses":{"200":{"description":"The sending domains","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/domains/{id}":{"get":{"operationId":"deliverability.domains.get","summary":"Get a sending domain with its DNS-check history. (scope: deliverability:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The domain detail","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Domain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/domains/{id}/dns-check":{"post":{"operationId":"deliverability.domains.write","summary":"Trigger an on-demand SPF/DKIM/DMARC DNS check for a domain and re-score it. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The DNS-check result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Domain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/mailboxes":{"get":{"operationId":"deliverability.mailboxes.read","summary":"List mailboxes with deliverability health. (scope: deliverability:read)","responses":{"200":{"description":"The mailboxes","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/mailboxes/{id}":{"get":{"operationId":"deliverability.mailboxes.get","summary":"Get one mailbox's deliverability detail. (scope: deliverability:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The mailbox detail","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Mailbox not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/mailboxes/{id}/microsoft-trace":{"get":{"operationId":"deliverability.mailboxes.microsoft_trace","summary":"Read a mailbox's Microsoft message-trace events. (scope: deliverability:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"sinceDays","in":"query","schema":{"type":"integer","minimum":1,"maximum":30}}],"responses":{"200":{"description":"The trace events + totals","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/mailboxes/{id}/microsoft-trace/timeline":{"get":{"operationId":"deliverability.mailboxes.microsoft_trace_timeline","summary":"Daily Microsoft delivered/quarantined/failed series. (scope: deliverability:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"The daily trace series","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/mailboxes/{id}/microsoft-trace/sync":{"post":{"operationId":"deliverability.mailboxes.write","summary":"Sync a mailbox's Microsoft Graph message-trace activity. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"sinceDays":{"type":"integer","minimum":1,"maximum":30}}}}}},"responses":{"200":{"description":"The sync result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/alerts":{"get":{"operationId":"deliverability.alerts.read","summary":"List deliverability alerts (filter by state). (scope: deliverability:read)","parameters":[{"name":"states","in":"query","schema":{"type":"string"},"description":"Comma-separated: ACTIVE,ACKNOWLEDGED,SNOOZED,RESOLVED"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The alerts","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/alerts/{id}/ack":{"post":{"operationId":"deliverability.alerts.ack","summary":"Acknowledge a deliverability alert. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The acknowledged alert","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Alert not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/alerts/{id}/snooze":{"post":{"operationId":"deliverability.alerts.snooze","summary":"Snooze a deliverability alert until a time. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"until":{"type":"string"}}}}}},"responses":{"200":{"description":"The snoozed alert","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Alert not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/alerts/{id}/resolve":{"post":{"operationId":"deliverability.alerts.resolve","summary":"Resolve a deliverability alert. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The resolved alert","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Alert not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/alerts/bulk":{"post":{"operationId":"deliverability.alerts.write","summary":"Bulk ack/resolve/snooze deliverability alerts by id. (scope: deliverability:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"type":"array","items":{"type":"string"},"maxItems":200},"action":{"type":"string","enum":["ack","resolve","snooze"]},"snoozeUntil":{"type":"string"}}}}}},"responses":{"200":{"description":"Bulk result (updated/skipped)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/recommendations":{"get":{"operationId":"deliverability.recommendations.read","summary":"List deliverability recommendations (filter by status). (scope: deliverability:read)","parameters":[{"name":"statuses","in":"query","schema":{"type":"string"},"description":"Comma-separated: OPEN,RESOLVED,DISMISSED (default OPEN)"}],"responses":{"200":{"description":"The recommendations","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/recommendations/{id}/dismiss":{"post":{"operationId":"deliverability.recommendations.dismiss","summary":"Dismiss a deliverability recommendation. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The dismissed recommendation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Recommendation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/recommendations/{id}/resolve":{"post":{"operationId":"deliverability.recommendations.write","summary":"Resolve a deliverability recommendation. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The resolved recommendation","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Recommendation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests":{"get":{"operationId":"deliverability.placement_tests.read","summary":"List inbox-placement tests (filter by mailbox). (scope: deliverability:read)","parameters":[{"name":"mailboxId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"The placement tests","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"deliverability.placement_tests.write","summary":"Create an inbox-placement test (daily-limit enforced). (scope: deliverability:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailboxId","subject","bodyText"],"properties":{"mailboxId":{"type":"string"},"campaignId":{"type":"string"},"subject":{"type":"string"},"bodyText":{"type":"string"},"bodyHtml":{"type":"string"},"providers":{"type":"array","items":{"type":"string"}},"seedAccountIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"The created test (testId, token, seedCount)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Daily test limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests/providers":{"get":{"operationId":"deliverability.placement_tests.providers","summary":"Seed providers + active seed counts. (scope: deliverability:read)","responses":{"200":{"description":"The seed providers","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests/trend":{"get":{"operationId":"deliverability.placement_tests.trend","summary":"Inbox-rate trend + per-provider breakdown. (scope: deliverability:read)","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"The placement trend","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests/mailbox-limit/{mailboxId}":{"get":{"operationId":"deliverability.placement_tests.limit_get","summary":"Read a mailbox's daily placement-test limit. (scope: deliverability:read)","parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The mailbox daily limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests/mailbox-limit":{"put":{"operationId":"deliverability.placement_tests.limit_set","summary":"Set a mailbox's daily placement-test limit (0 = unlimited). (scope: deliverability:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailboxId","dailyLimit"],"properties":{"mailboxId":{"type":"string"},"dailyLimit":{"type":"integer","minimum":0,"maximum":1000}}}}}},"responses":{"200":{"description":"The updated limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests/{id}":{"get":{"operationId":"deliverability.placement_tests.get","summary":"Get an inbox-placement test with its seed results. (scope: deliverability:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The placement-test detail","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Test not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/placement-tests/{id}/cancel":{"post":{"operationId":"deliverability.placement_tests.cancel","summary":"Cancel an inbox-placement test. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The canceled test","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Test not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/postmaster/status":{"get":{"operationId":"deliverability.postmaster.read","summary":"Google Postmaster connection + per-domain verification status. (scope: deliverability:read)","responses":{"200":{"description":"The Postmaster status","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/domains/{id}/postmaster/status":{"get":{"operationId":"deliverability.postmaster.domain_status","summary":"One domain's Postmaster reputation metrics. (scope: deliverability:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The domain Postmaster status","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Domain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/postmaster/connect":{"post":{"operationId":"deliverability.postmaster.write","summary":"Start Google Postmaster OAuth — returns a consent URL to open in a browser (cannot complete headless). (scope: deliverability:write)","responses":{"200":{"description":"{ url } — the Google OAuth consent URL","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/postmaster/disconnect":{"post":{"operationId":"deliverability.postmaster.disconnect","summary":"Disconnect Google Postmaster. (scope: deliverability:write)","responses":{"200":{"description":"Disconnect result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/domains/{id}/postmaster/verify":{"post":{"operationId":"deliverability.postmaster.verify","summary":"Mark a domain Google-Postmaster verified. (scope: deliverability:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verify result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/deliverability/settings":{"get":{"operationId":"deliverability.settings.read","summary":"Get the workspace's deliverability settings. (scope: deliverability:read)","responses":{"200":{"description":"The deliverability settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"deliverability.settings.write","summary":"Update the workspace's deliverability settings (e.g. auto-pause on critical alert). (scope: deliverability:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"autoPauseOnCriticalAlert":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The updated settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs":{"get":{"operationId":"verification.jobs.read","summary":"List verification jobs (newest first, cursor-paginated). (scope: verification:read)","parameters":[{"name":"search","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"},"description":"Comma-separated status filter"},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"A cursor page of jobs","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"verification.jobs.write","summary":"Create a verification job over a scope (spends credits). (scope: verification:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scope"],"properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["LIST","FILTER","IDS","SINGLE","ALL"]},"scopeRef":{"type":"object","additionalProperties":true},"skipRecentlyVerified":{"type":"boolean"},"freshnessDays":{"type":"integer","minimum":0}}}}}},"responses":{"201":{"description":"The created job","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/preview-count":{"post":{"operationId":"verification.jobs.preview_count","summary":"Preview how many emails a job would verify, WITHOUT spending credits. (scope: verification:read)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scope"],"properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["LIST","FILTER","IDS","SINGLE","ALL"]},"scopeRef":{"type":"object","additionalProperties":true},"skipRecentlyVerified":{"type":"boolean"},"freshnessDays":{"type":"integer","minimum":0}}}}}},"responses":{"200":{"description":"{ count } — the resolved audience size","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/verify-one":{"post":{"operationId":"verification.jobs.verify_one","summary":"Verify a single email inline (spends one credit unless cached). (scope: verification:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"200":{"description":"The verification result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/{id}":{"get":{"operationId":"verification.jobs.get","summary":"Get a verification job with its batches. (scope: verification:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The job","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"verification.jobs.delete","summary":"Delete a verification job and its results. (scope: verification:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/{id}/results":{"get":{"operationId":"verification.jobs.results","summary":"List a job's finalized result rows (cursor-paginated). (scope: verification:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"result","in":"query","schema":{"type":"string"},"description":"Outcome filter (DELIVERABLE|RISKY|CATCH_ALL|INVALID|UNKNOWN)"},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"A cursor page of results","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/{id}/export":{"get":{"operationId":"verification.export.read","summary":"Export a job's results as CSV (inline text) or XLSX (base64). (scope: verification:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string","enum":["csv","xlsx"],"default":"csv"}}],"responses":{"200":{"description":"The exported results envelope","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/{id}/cancel":{"post":{"operationId":"verification.jobs.cancel","summary":"Cancel an in-flight verification job. (scope: verification:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancel result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/jobs/{id}/retry":{"post":{"operationId":"verification.jobs.retry","summary":"Resubmit a job's unfinished emails. (scope: verification:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ submitted } — resubmitted count","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/usage":{"get":{"operationId":"verification.usage.read","summary":"Verification usage (submitted/reused per month) with history. (scope: verification:read)","parameters":[{"name":"months","in":"query","schema":{"type":"integer","minimum":1,"maximum":24,"default":12}}],"responses":{"200":{"description":"The usage summary","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/stats":{"get":{"operationId":"verification.stats","summary":"Aggregate verification stats over a look-back window. (scope: verification:read)","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}}],"responses":{"200":{"description":"The stats","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/schedules":{"get":{"operationId":"verification.schedules.read","summary":"List recurring verification schedules. (scope: verification:read)","responses":{"200":{"description":"{ items } — the schedules","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"verification.schedules.write","summary":"Create a recurring verification schedule. (scope: verification:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scope","intervalDays"],"properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["LIST","FILTER","IDS","SINGLE","ALL"]},"scopeRef":{"type":"object","additionalProperties":true},"intervalDays":{"type":"integer","minimum":1},"enabled":{"type":"boolean"},"skipRecentlyVerified":{"type":"boolean"},"freshnessDays":{"type":"integer","minimum":0,"nullable":true}}}}}},"responses":{"201":{"description":"The created schedule","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/schedules/{id}":{"patch":{"operationId":"verification.schedules.update","summary":"Update a verification schedule (optionally run now). (scope: verification:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["LIST","FILTER","IDS","SINGLE","ALL"]},"scopeRef":{"type":"object","additionalProperties":true},"intervalDays":{"type":"integer","minimum":1},"enabled":{"type":"boolean"},"skipRecentlyVerified":{"type":"boolean"},"freshnessDays":{"type":"integer","minimum":0,"nullable":true},"runNow":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The updated schedule","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Schedule not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"verification.schedules.delete","summary":"Delete a verification schedule. (scope: verification:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/verification/settings":{"get":{"operationId":"verification.settings.read","summary":"Get the workspace's verification settings (provider, cache TTL, freshness defaults). (scope: verification:read)","responses":{"200":{"description":"The verification settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"verification.settings.write","summary":"Update the workspace's verification settings. (scope: verification:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string"},"skipRecentlyVerifiedDefault":{"type":"boolean"},"defaultFreshnessDays":{"type":"integer","minimum":0},"cacheTtlDays":{"type":"integer","minimum":0}}}}}},"responses":{"200":{"description":"The updated settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks":{"get":{"operationId":"webhooks.manage.read","summary":"List the workspace's outbound webhook subscriptions. (scope: webhooks:read)","responses":{"200":{"description":"The workspace webhook subscriptions","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"webhooks.manage.write","summary":"Create an outbound webhook subscription (returns the signing secret once). (scope: webhooks:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Empty = all event types"},"enabled":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"The created subscription with its signing secret","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"webhooks.manage.test","summary":"Fire a one-off TEST delivery to a webhook subscription. (scope: webhooks:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The enqueued test delivery","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks/{id}":{"delete":{"operationId":"webhooks.manage.delete","summary":"Delete an outbound webhook subscription. (scope: webhooks:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion acknowledgement","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks/deliveries/dlq":{"get":{"operationId":"webhooks.dlq.read","summary":"List dead-lettered webhook deliveries (delivery attempts that exhausted retries). (scope: webhooks:read)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Dead-lettered webhook deliveries","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks/deliveries/{id}/requeue":{"post":{"operationId":"webhooks.dlq.write","summary":"Requeue a dead-lettered webhook delivery for another attempt (idempotent). (scope: webhooks:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The re-armed delivery","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/crm/connections":{"get":{"operationId":"crm.connections","summary":"List the workspace's connected CRMs (HubSpot, Salesforce, Pipedrive). (scope: crm:read)","responses":{"200":{"description":"The workspace CRM connections","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/crm/connections/oauth/start":{"post":{"operationId":"crm.connect","summary":"Start a CRM OAuth connect — returns a browser consent URL (cannot complete headless). (scope: crm:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"type":"string","enum":["HUBSPOT","SALESFORCE","PIPEDRIVE"]},"loginHost":{"type":"string","description":"Self-hosted/region login host, if the provider needs one"},"returnTo":{"type":"string","description":"URL to return to after consent"}}}}}},"responses":{"200":{"description":"The provider OAuth consent URL","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/crm/connections/{id}":{"delete":{"operationId":"crm.connect.disconnect","summary":"Disconnect a CRM (revoke its token). (scope: crm:write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Disconnect acknowledgement","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/crm/connections/{id}/segments":{"get":{"operationId":"crm.segments","summary":"List the segments/lists available on a connected CRM. (scope: crm:read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The connection's segments/lists","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/crm/import":{"post":{"operationId":"crm.import","summary":"Import a CRM segment as campaign recipients (idempotent, suppression-aware). (scope: crm:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["campaignId","connectionId","segmentId"],"properties":{"campaignId":{"type":"string"},"connectionId":{"type":"string"},"segmentId":{"type":"string"}}}}}},"responses":{"202":{"description":"The import-job summary (valid/duplicate/invalid/blocked counts)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/analytics/report":{"get":{"operationId":"analytics.report","summary":"Read campaign or workspace analytics: intelligence timeseries, full report, a breakdown dimension, or revenue attribution. (scope: analytics:read)","parameters":[{"name":"view","in":"query","required":true,"schema":{"type":"string","enum":["timeseries","report","breakdown","attribution"]}},{"name":"campaignId","in":"query","schema":{"type":"string"},"description":"Required for view=breakdown"},{"name":"campaignIds","in":"query","schema":{"type":"string"},"description":"Comma-separated campaign ids"},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365}},{"name":"trailingWindowDays","in":"query","schema":{"type":"integer","minimum":1}},{"name":"breakdownLimit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"dimension","in":"query","schema":{"type":"string","enum":["mailbox","domain","step"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"model","in":"query","schema":{"type":"string","enum":["FIRST_TOUCH","LAST_TOUCH","LINEAR","TIME_DECAY"]}}],"responses":{"200":{"description":"The requested analytics view","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/analytics/report-links":{"get":{"operationId":"analytics.report_links.list","summary":"List the workspace's shareable white-labeled report links. (scope: analytics:read)","responses":{"200":{"description":"The workspace report links","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"analytics.report_links.create","summary":"Create a shareable white-labeled report link (returns the share URL once). (scope: analytics:read)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reportType":{"type":"string","enum":["campaign-summary"]},"label":{"type":"string","maxLength":120},"ttlDays":{"type":"integer","minimum":1,"maximum":365}}}}}},"responses":{"201":{"description":"The created report link with its one-time share URL","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/analytics/report-links/{linkId}/revoke":{"post":{"operationId":"analytics.report_links.revoke","summary":"Revoke a shareable report link. (scope: analytics:read)","parameters":[{"name":"linkId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The revoked link id","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Active report link not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/account":{"get":{"operationId":"account.get","summary":"Get the calling identity: name, email, plan, and the workspaces it can access. (scope: account:read)","responses":{"200":{"description":"The calling identity + accessible workspaces","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/workspaces":{"get":{"operationId":"workspaces.list","summary":"List all workspaces the calling identity can access, plus its current workspace. (scope: account:read)","responses":{"200":{"description":"Accessible workspaces + current","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"workspace.create","summary":"Create a new workspace owned by the calling account. (scope: workspace:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"timezone":{"type":"string","maxLength":64},"defaultCurrency":{"type":"string","minLength":3,"maxLength":3}}}}}},"responses":{"201":{"description":"The created workspace","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Over the account workspace allowance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/workspace":{"get":{"operationId":"workspace.get","summary":"Consolidated read of the active workspace: settings, sending credits, branding, and tracking/portal domain config. (scope: workspace:read)","responses":{"200":{"description":"Settings + credits + branding + domain config","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"workspace.manage","summary":"Update the active workspace's settings (name, timezone, currency, caps, webhooks, attribution) and/or branding. (scope: workspace:write)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","additionalProperties":true},"branding":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"The updated workspace and/or branding","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/workspace/tracking-domain":{"post":{"operationId":"workspace.tracking_domain.read","summary":"Get (workspace:read), or set/verify/detach (workspace:write) the active workspace's custom tracking domain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["get","set","verify","detach"]},"domain":{"type":"string","minLength":3,"maxLength":253,"description":"Required for action=set"}}}}}},"responses":{"200":{"description":"The tracking-domain state","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/workspace/portal-domain":{"post":{"operationId":"workspace.portal_domain.read","summary":"Get (workspace:read), or set/verify/detach (workspace:write) the active workspace's white-label portal domain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["get","set","verify","detach"]},"domain":{"type":"string","minLength":3,"maxLength":253,"description":"Required for action=set"}}}}}},"responses":{"200":{"description":"The portal-domain state","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Portal domain already claimed by another workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/members":{"get":{"operationId":"members.read","summary":"List the active workspace's members and their roles. (scope: members:read)","parameters":[{"name":"role","in":"query","schema":{"type":"string"},"description":"Filter members by role"}],"responses":{"200":{"description":"The workspace members","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"members.write","summary":"Invite a member into the active workspace. (scope: members:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","description":"WORKSPACE_* role (not OWNER)"},"name":{"type":"string","maxLength":80},"clientPermissions":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"The created member","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"User is already a member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/members/{memberId}":{"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"operationId":"members.update","summary":"Change a member's role, and/or set a client member's per-section permissions (omit role to update permissions only). (scope: members:write)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","description":"WORKSPACE_* role"},"clientPermissions":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"The updated member","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"members.remove","summary":"Remove a member from the active workspace. (scope: members:write)","responses":{"200":{"description":"The removed member id","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/invites":{"get":{"operationId":"invites.read","summary":"List the active workspace's pending invites. (scope: members:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The pending invites (paginated)","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"invites.write","summary":"Create a workspace/client invite. (scope: members:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","description":"WORKSPACE_* role (not OWNER)"},"name":{"type":"string","maxLength":120},"clientPermissions":{"type":"object","additionalProperties":true},"deliveryMode":{"type":"string","enum":["LINK","BRANDED_EMAIL"]}}}}}},"responses":{"201":{"description":"The created invite + accept URL","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Workspace lacks the white-label entitlement or is over its client-seat limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/invites/{inviteId}/resend":{"parameters":[{"name":"inviteId","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"invites.resend","summary":"Resend a pending invite — rotates its link and extends expiry. (scope: members:write)","responses":{"200":{"description":"The invite + fresh accept URL","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Pending invite not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/invites/{inviteId}":{"parameters":[{"name":"inviteId","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"operationId":"invites.revoke","summary":"Revoke a pending invite. (scope: members:write)","responses":{"200":{"description":"The revoked invite id","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Pending invite not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/billing/status":{"get":{"operationId":"billing.status","summary":"Consolidated billing status: subscription, plan tier, trial, seat allowance, plan catalog, per-credit usage, recent invoices, per-workspace usage roll-up, and credit top-up packs. (scope: billing:read)","responses":{"200":{"description":"Subscription/plan/trial/seat status + plan catalog + per-credit usage + invoices (amounts + Stripe-hosted URLs) + per-workspace usage + top-up packs","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/agency/workspaces":{"get":{"operationId":"agency.workspaces","summary":"List the client workspaces the calling account owns or administers (empty for non-agencies). (scope: agency:read)","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"The client workspaces the account owns/admins (empty for non-agencies)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/billing/checkout":{"post":{"operationId":"billing.checkout","summary":"Start a Stripe billing action for the calling account (sensitive, money): plan checkout/change/cancel, workspace-seat checkout, billing portal, credit top-up checkout, or trial start. Almost all return a Stripe-hosted URL to open in a browser (trial-start completes directly). Never handles card data. (scope: billing:write)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["planCheckout","planChange","planCancel","seatCheckout","portal","topupCheckout","trialStart"]},"planTier":{"type":"string","enum":["SOLO","SCALE"],"description":"Required for planCheckout / planChange"},"trial":{"type":"boolean","description":"planCheckout only — start the one-time free trial"},"interval":{"type":"string","enum":["month","year"],"description":"Billing interval for planCheckout / planChange (default month)"},"quantity":{"type":"integer","minimum":1,"maximum":100,"description":"Extra workspace seats (seatCheckout, default 1)"},"packId":{"type":"string","description":"Credit top-up pack id (required for topupCheckout)"}}}}}},"responses":{"200":{"description":"A Stripe-hosted Checkout/Portal URL ({ url }) to open in a browser — or { trialEndsAt } for trialStart. No Stripe secrets or card data.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient scope for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}