{"openapi":"3.1.0","info":{"title":"Vendita API","version":"1.0.0","description":"Read access to a workspace: agents, campaigns, contacts, conversations, analytics and usage. Authenticate with an API key from Settings → API keys as `Authorization: Bearer vk_live_...`. A key acts with the permissions of the person who created it, narrowed to the scopes it was issued with. Every response carries an `x-request-id` header; quote it when asking for help."},"servers":[{"url":"https://app.vendita.io/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"vk_live_…"}},"schemas":{"CreateAgentRequest":{"type":"object","properties":{"model":{"type":"string"},"agentName":{"type":"string","minLength":1,"maxLength":80,"description":"Max 80 characters."},"businessName":{"type":"string","minLength":1,"maxLength":80,"description":"Max 80 characters."},"websiteUrl":{"type":"string"},"industry":{"type":"string","minLength":1,"maxLength":120,"description":"Max 120 characters."},"businessDescription":{"type":"string","minLength":1,"maxLength":2000,"description":"Max 2,000 characters."},"targetCustomer":{"type":"string","maxLength":300,"default":"","description":"Max 300 characters."},"instructions":{"type":"object","properties":{"channel":{"type":"string","enum":["sms","whatsapp","email"],"default":"sms"},"role":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"goal":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"hardRules":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"escalation":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"additionalInstructions":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"firstMessage":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."}},"additionalProperties":false},"activate":{"type":"boolean","default":false}},"required":["agentName","businessName","websiteUrl","industry","businessDescription"],"additionalProperties":false},"AgentInstructionsRequest":{"type":"object","properties":{"channel":{"type":"string","enum":["sms","whatsapp","email"],"default":"sms"},"role":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"goal":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"hardRules":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"escalation":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"additionalInstructions":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."},"firstMessage":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."}},"additionalProperties":false},"AgentSpec":{"type":"object","properties":{"version":{"type":"number","enum":[2],"default":2,"description":"Spec version. Always 2."},"identity":{"type":"object","properties":{"agentName":{"type":"string","maxLength":120,"minLength":1,"description":"What the agent is called in the workspace."},"businessName":{"type":"string","maxLength":120,"minLength":1,"description":"The real business name: how the agent introduces itself."},"industry":{"type":"string","maxLength":120,"minLength":1},"websiteUrl":{"type":"string","maxLength":500,"nullable":true,"default":null,"description":"Reference only; not fetched."},"businessDescription":{"type":"string","maxLength":2000,"minLength":1,"description":"What the business sells, to whom, and how it creates value."}},"required":["agentName","businessName","industry","businessDescription"],"additionalProperties":false},"audience":{"type":"object","properties":{"targetCustomer":{"type":"string","maxLength":300,"default":"","description":"Who the agent texts, in one sentence."},"qualifiedWhen":{"type":"string","maxLength":600,"default":"","description":"Signals of a fit the agent should move toward a booking."},"notFitWhen":{"type":"string","maxLength":600,"default":"","description":"Signals of a non-fit the agent should close politely."}},"additionalProperties":false},"conversation":{"type":"object","properties":{"role":{"type":"string","maxLength":2000,"default":"","description":"Who the agent is in the conversation."},"goal":{"type":"string","maxLength":2000,"default":"","description":"What a successful conversation ends with."},"firstMessage":{"type":"string","maxLength":2000,"default":"","description":"The default opening text; a campaign can override it. One short SMS: at most 2 segments (about 300 characters, or 134 with an emoji or other non-SMS character). A longer one is refused when it is set."},"hardRules":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":60,"default":[],"description":"Rules the agent never breaks, one per entry."},"escalation":{"type":"string","maxLength":2000,"default":"","description":"When and how to hand to a person."},"tone":{"type":"string","maxLength":600,"default":"","description":"Voice and register."},"additional":{"type":"string","maxLength":4000,"default":"","description":"Anything else, free text."}},"additionalProperties":false},"salesBrain":{"type":"object","properties":{"salesApproach":{"type":"string","maxLength":4000,"default":""},"valueFraming":{"type":"string","maxLength":4000,"default":""},"icpFitSignals":{"type":"string","maxLength":4000,"default":""},"qualificationGuidance":{"type":"string","maxLength":4000,"default":""},"objectionHandling":{"type":"string","maxLength":4000,"default":""},"toneAndBoundaries":{"type":"string","maxLength":4000,"default":""},"callToActionStyle":{"type":"string","maxLength":4000,"default":""}},"additionalProperties":false,"nullable":true,"default":null,"description":"The selling method. Needs foundation knowledge the first time it is set."},"model":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string","maxLength":80,"minLength":1}},"required":["provider","model"],"additionalProperties":false},"tools":{"type":"object","properties":{"booking":{"type":"boolean","default":true,"description":"The platform offers real open times and books the one the contact accepts. Works once the campaign has booking hours (bookingWindows); without them the agent asks what day suits and logs a callback request instead. Set false to switch off."},"followUp":{"type":"boolean","default":true,"description":"When a contact asks to be contacted later, the platform schedules the check-in and gives the agent the date to say. Set false to switch off."},"handoff":{"type":"boolean","default":true,"description":"A complaint, or something only a person can do, passes the conversation to a person: the agent stops replying there, the owner is emailed and conversation.handed_off fires. Set false to switch off."},"callback":{"type":"boolean","default":true,"description":"A contact who asks for a person to call, or cannot make any open time, gets a callback request: an owner email, a calendar entry and callback.requested for a CRM task. Not a booking. Set false to switch off."}},"additionalProperties":false,"default":{"booking":true,"followUp":true,"handoff":true,"callback":true},"description":"What the platform may do for this agent. All on by default; a separate coordinator decides and carries them out, so the instructions never need to mention them."},"examples":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["good","bad"]},"contact":{"type":"string","maxLength":400,"description":"What the contact said."},"agent":{"type":"string","maxLength":400,"description":"What the agent replied."},"why":{"type":"string","maxLength":300,"default":"","description":"Why this is good or bad."}},"required":["kind","contact","agent"],"additionalProperties":false},"maxItems":12,"default":[]}},"required":["identity","audience","conversation","model"],"additionalProperties":false},"SetAgentSpecRequest":{"type":"object","properties":{"spec":{"type":"object","properties":{"version":{"type":"number","enum":[2],"default":2,"description":"Spec version. Always 2."},"identity":{"type":"object","properties":{"agentName":{"type":"string","maxLength":120,"minLength":1,"description":"What the agent is called in the workspace."},"businessName":{"type":"string","maxLength":120,"minLength":1,"description":"The real business name: how the agent introduces itself."},"industry":{"type":"string","maxLength":120,"minLength":1},"websiteUrl":{"type":"string","maxLength":500,"nullable":true,"default":null,"description":"Reference only; not fetched."},"businessDescription":{"type":"string","maxLength":2000,"minLength":1,"description":"What the business sells, to whom, and how it creates value."}},"required":["agentName","businessName","industry","businessDescription"],"additionalProperties":false},"audience":{"type":"object","properties":{"targetCustomer":{"type":"string","maxLength":300,"default":"","description":"Who the agent texts, in one sentence."},"qualifiedWhen":{"type":"string","maxLength":600,"default":"","description":"Signals of a fit the agent should move toward a booking."},"notFitWhen":{"type":"string","maxLength":600,"default":"","description":"Signals of a non-fit the agent should close politely."}},"additionalProperties":false},"conversation":{"type":"object","properties":{"role":{"type":"string","maxLength":2000,"default":"","description":"Who the agent is in the conversation."},"goal":{"type":"string","maxLength":2000,"default":"","description":"What a successful conversation ends with."},"firstMessage":{"type":"string","maxLength":2000,"default":"","description":"The default opening text; a campaign can override it. One short SMS: at most 2 segments (about 300 characters, or 134 with an emoji or other non-SMS character). A longer one is refused when it is set."},"hardRules":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":60,"default":[],"description":"Rules the agent never breaks, one per entry."},"escalation":{"type":"string","maxLength":2000,"default":"","description":"When and how to hand to a person."},"tone":{"type":"string","maxLength":600,"default":"","description":"Voice and register."},"additional":{"type":"string","maxLength":4000,"default":"","description":"Anything else, free text."}},"additionalProperties":false},"salesBrain":{"type":"object","properties":{"salesApproach":{"type":"string","maxLength":4000,"default":""},"valueFraming":{"type":"string","maxLength":4000,"default":""},"icpFitSignals":{"type":"string","maxLength":4000,"default":""},"qualificationGuidance":{"type":"string","maxLength":4000,"default":""},"objectionHandling":{"type":"string","maxLength":4000,"default":""},"toneAndBoundaries":{"type":"string","maxLength":4000,"default":""},"callToActionStyle":{"type":"string","maxLength":4000,"default":""}},"additionalProperties":false,"nullable":true,"default":null,"description":"The selling method. Needs foundation knowledge the first time it is set."},"model":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string","maxLength":80,"minLength":1}},"required":["provider","model"],"additionalProperties":false},"tools":{"type":"object","properties":{"booking":{"type":"boolean","default":true,"description":"The platform offers real open times and books the one the contact accepts. Works once the campaign has booking hours (bookingWindows); without them the agent asks what day suits and logs a callback request instead. Set false to switch off."},"followUp":{"type":"boolean","default":true,"description":"When a contact asks to be contacted later, the platform schedules the check-in and gives the agent the date to say. Set false to switch off."},"handoff":{"type":"boolean","default":true,"description":"A complaint, or something only a person can do, passes the conversation to a person: the agent stops replying there, the owner is emailed and conversation.handed_off fires. Set false to switch off."},"callback":{"type":"boolean","default":true,"description":"A contact who asks for a person to call, or cannot make any open time, gets a callback request: an owner email, a calendar entry and callback.requested for a CRM task. Not a booking. Set false to switch off."}},"additionalProperties":false,"default":{"booking":true,"followUp":true,"handoff":true,"callback":true},"description":"What the platform may do for this agent. All on by default; a separate coordinator decides and carries them out, so the instructions never need to mention them."},"examples":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["good","bad"]},"contact":{"type":"string","maxLength":400,"description":"What the contact said."},"agent":{"type":"string","maxLength":400,"description":"What the agent replied."},"why":{"type":"string","maxLength":300,"default":"","description":"Why this is good or bad."}},"required":["kind","contact","agent"],"additionalProperties":false},"maxItems":12,"default":[]}},"required":["identity","audience","conversation","model"],"additionalProperties":false},"changeNote":{"type":"string","maxLength":300,"default":"","description":"What changed and why; shown in the version list."}},"required":["spec"],"additionalProperties":false},"SetAgentActionsRequest":{"type":"object","properties":{"booking":{"type":"boolean","description":"Offer real open times and book the one the contact accepts. Needs booking hours on the campaign."},"followUp":{"type":"boolean","description":"Schedule a later check-in when a contact asks to be contacted later."},"callback":{"type":"boolean","description":"Log a callback request (owner email, calendar entry, callback.requested) when a contact asks for a person to call or cannot make any open time."},"handoff":{"type":"boolean","description":"Pass a complaint, or something only a person can do, to a person; the agent stops replying in that conversation."}},"additionalProperties":false},"AgentActions":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid"},"actions":{"type":"object","properties":{"booking":{"type":"boolean"},"followUp":{"type":"boolean"},"callback":{"type":"boolean"},"handoff":{"type":"boolean"}},"required":["booking","followUp","callback","handoff"],"additionalProperties":false},"version":{"type":["integer","null"],"description":"The version that records the latest change; null for an agent never versioned."},"notes":{"type":"array","items":{"type":"string"}}},"required":["agentId","actions","version","notes"],"additionalProperties":false},"AgentSpecView":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid"},"version":{"type":["integer","null"],"description":"Active version; null until first written through the spec or its instructions."},"spec":{"$ref":"#/components/schemas/AgentSpec"}},"required":["agentId","version","spec"],"additionalProperties":false},"AgentSpecResult":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid"},"version":{"type":"integer"},"spec":{"$ref":"#/components/schemas/AgentSpec"},"salesBrainApplied":{"type":"boolean"},"note":{"type":["string","null"]}},"required":["agentId","version","spec","salesBrainApplied","note"],"additionalProperties":false},"AgentVersion":{"type":"object","properties":{"version":{"type":"integer"},"changeNote":{"type":["string","null"]},"createdByActor":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"active":{"type":"boolean"}},"required":["version","changeNote","createdByActor","createdAt","active"],"additionalProperties":false},"SalesBrainRequest":{"type":"object","properties":{"salesBrainName":{"type":"string","minLength":1,"maxLength":100,"description":"Max 100 characters."},"salesApproach":{"type":"string","minLength":1,"maxLength":500,"description":"Max 500 characters."},"valueFraming":{"type":"string","minLength":1,"maxLength":2000,"description":"Max 2,000 characters."},"icpFitSignals":{"type":"string","minLength":1,"maxLength":2000,"description":"Max 2,000 characters."},"qualificationGuidance":{"type":"string","minLength":1,"maxLength":2000,"description":"Max 2,000 characters."},"objectionHandling":{"type":"string","minLength":1,"maxLength":2000,"description":"Max 2,000 characters."},"toneAndBoundaries":{"type":"string","minLength":1,"maxLength":2000,"description":"Max 2,000 characters."},"callToActionStyle":{"type":"string","maxLength":2000,"default":"","description":"Max 2,000 characters."}},"required":["salesBrainName","salesApproach","valueFraming","icpFitSignals","qualificationGuidance","objectionHandling","toneAndBoundaries"],"additionalProperties":false},"CreateCampaignRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"agentId":{"type":"string","format":"uuid","nullable":true,"default":null},"contactsPerDay":{"type":"integer","minimum":1,"maximum":500},"messagingWindowStart":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"messagingWindowEnd":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string","minLength":1},"bumpAfterHours":{"type":"integer","minimum":1,"maximum":720},"bumpCount":{"type":"integer","minimum":0,"maximum":5},"tags":{"type":"array","items":{"type":"string","minLength":1}},"calendarLink":{"anyOf":[{"type":"string","format":"uri","nullable":true,"default":null},{"type":"string","enum":[""]}]},"replyAfterMinutes":{"type":"integer","minimum":0,"maximum":1440},"qualifiedWhen":{"anyOf":[{"type":"string","maxLength":1000,"nullable":true,"default":null},{"type":"string","enum":[""]}]},"notFitWhen":{"anyOf":[{"type":"string","maxLength":1000,"nullable":true,"default":null},{"type":"string","enum":[""]}]},"bookingAvailability":{"type":"string","maxLength":500,"nullable":true,"description":"Deprecated: do not set. The agent takes its hours from bookingWindows, and this text is ignored whenever bookingWindows is set. It is only read for an old campaign with no bookingWindows, as the literal sentence \"You are available ...\". Never put notes, caveats or instructions here; nothing in a campaign is a place for notes to self."},"bookingWindows":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["day","start","end"],"additionalProperties":false},"maxItems":21,"nullable":true},"bookingSlotMinutes":{"type":"integer","minimum":15,"maximum":120},"calendarConnectionId":{"type":"string","format":"uuid","nullable":true,"description":"The connected calendar this campaign books against (an id from list_calendar_connections). Its busy time is removed from the open times, and a time is only booked after the calendar has been re-read. If the calendar cannot be read the agent offers no times and takes a callback request instead. null detaches it; leave it out to keep what is set."},"openingMessage":{"type":"string","minLength":1,"maxLength":1600,"description":"The opening SMS: one short text, at most 2 SMS segments (about 300 characters, or 134 if it contains an emoji or other non-SMS character). Longer is refused. Personalisation uses single braces: {firstName}, {company}, {jobTitle}. Omit to use the agent's first message."}},"required":["name"],"additionalProperties":false},"UpdateCampaignRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Max 100 characters."},"agentId":{"type":"string","format":"uuid","nullable":true},"contactsPerDay":{"type":"integer","minimum":1,"maximum":500},"messagingWindowStart":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"messagingWindowEnd":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string","minLength":1},"bumpAfterHours":{"type":"integer","minimum":1,"maximum":720},"bumpCount":{"type":"integer","minimum":0,"maximum":5},"tags":{"type":"array","items":{"type":"string","minLength":1}},"calendarLink":{"anyOf":[{"type":"string","format":"uri","nullable":true,"default":null},{"type":"string","enum":[""]}]},"replyAfterMinutes":{"type":"integer","minimum":0,"maximum":1440},"qualifiedWhen":{"anyOf":[{"type":"string","maxLength":1000,"nullable":true,"default":null},{"type":"string","enum":[""]}]},"notFitWhen":{"anyOf":[{"type":"string","maxLength":1000,"nullable":true,"default":null},{"type":"string","enum":[""]}]},"bookingAvailability":{"type":"string","maxLength":500,"nullable":true,"description":"Deprecated: do not set. The agent takes its hours from bookingWindows, and this text is ignored whenever bookingWindows is set. It is only read for an old campaign with no bookingWindows, as the literal sentence \"You are available ...\". Never put notes, caveats or instructions here; nothing in a campaign is a place for notes to self."},"bookingWindows":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["day","start","end"],"additionalProperties":false},"maxItems":21,"nullable":true},"bookingSlotMinutes":{"type":"integer","minimum":15,"maximum":120},"calendarConnectionId":{"type":"string","format":"uuid","nullable":true,"description":"The connected calendar this campaign books against (an id from list_calendar_connections). Its busy time is removed from the open times, and a time is only booked after the calendar has been re-read. If the calendar cannot be read the agent offers no times and takes a callback request instead. null detaches it; leave it out to keep what is set."},"openingMessage":{"type":"string","minLength":1,"maxLength":1600,"description":"The opening SMS: one short text, at most 2 SMS segments (about 300 characters, or 134 if it contains an emoji or other non-SMS character). Longer is refused. Personalisation uses single braces: {firstName}, {company}, {jobTitle}. Omit to use the agent's first message."}},"additionalProperties":false},"ImportContactsRequest":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"default":""},"firstName":{"type":"string","maxLength":100,"default":""},"lastName":{"type":"string","maxLength":100,"default":""},"phone":{"type":"string","maxLength":50,"default":""},"company":{"type":"string","maxLength":200,"default":""},"jobTitle":{"type":"string","maxLength":200,"default":""},"productCategory":{"type":"string","maxLength":100,"default":""},"city":{"type":"string","maxLength":100,"default":""},"state":{"type":"string","maxLength":100,"default":""},"postal":{"type":"string","maxLength":30,"default":""},"country":{"type":"string","maxLength":100,"default":""},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"default":[]}},"additionalProperties":false},"minItems":1,"maxItems":1000},"segment":{"type":"string","enum":["new","uncontacted","contacted_not_booked","booked_not_quoted","quoted_not_sold","sold_not_serviced","existing_customer"]}},"required":["rows","segment"],"additionalProperties":false},"EnrollContactsRequest":{"type":"object","properties":{"contactIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":5000},"filter":{"type":"object","properties":{"segment":{"type":"string","enum":["new","uncontacted","contacted_not_booked","booked_not_quoted","quoted_not_sold","sold_not_serviced","existing_customer"]},"tag":{"type":"string","minLength":1},"query":{"type":"string","minLength":1}},"additionalProperties":false},"limit":{"type":"integer","minimum":1,"maximum":5000,"default":500}},"additionalProperties":false},"ComplianceRequest":{"type":"object","properties":{"acknowledged":{"type":"boolean","enum":[true]}},"required":["acknowledged"],"additionalProperties":false},"SandboxMessageRequest":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000,"description":"What the contact says. Max 4,000 characters."},"reset":{"type":"boolean","default":false}},"required":["message"],"additionalProperties":false},"StartSimulationRequest":{"type":"object","properties":{"size":{"type":"integer","minimum":8,"maximum":1000,"default":50,"description":"Conversations to run (8–1000). 50 for a quick read, 200 for a reliable rate, 1000 for a release check."},"mix":{"type":"string","enum":["balanced","realistic"],"default":"balanced","description":"balanced: the archetype mix, finds breaks fast. realistic: weighted to live populations, so bookedRate is comparable to a real campaign."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Reproduce a population exactly. Omit for a fresh one."},"campaignId":{"type":"string","format":"uuid","description":"Campaign context (booking windows, qualification rules). Defaults to the agent's most recent campaign."}},"additionalProperties":false},"BusinessProfileRequest":{"type":"object","properties":{"legalName":{"type":"string","maxLength":200,"nullable":true,"description":"Registered legal name."},"tradingName":{"type":"string","maxLength":200,"nullable":true,"description":"Trading name, if different."},"businessNumber":{"type":"string","maxLength":40,"nullable":true,"description":"ABN/ACN (AU), Companies House number (UK) or EIN (US)."},"businessNumberType":{"type":"string","enum":["abn","acn","crn","ein","other"],"nullable":true},"businessType":{"type":"string","enum":["sole_trader","company","partnership","non_profit","government","other"],"nullable":true},"websiteUrl":{"type":"string","maxLength":500,"nullable":true},"allowedDomains":{"type":"array","items":{"type":"string","maxLength":253},"maxItems":20,"description":"Domains your messages may link to, besides your website (e.g. a booking page on another host)."},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":2}},"additionalProperties":false},"representative":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":40},"title":{"type":"string","maxLength":100}},"additionalProperties":false},"useCase":{"type":"string","maxLength":1000,"nullable":true,"description":"What the business texts people about, one or two sentences."},"sampleMessages":{"type":"array","items":{"type":"string","maxLength":400},"maxItems":5,"description":"Two to five real messages the agent sends."},"optInMethod":{"type":"string","enum":["website_form","inbound_sms","verbal","paper","crm_import","other"],"nullable":true},"optInDescription":{"type":"string","maxLength":1000,"nullable":true,"description":"Where and how people agree to be texted."},"monthlyVolume":{"type":"integer","minimum":0,"maximum":10000000,"nullable":true}},"additionalProperties":false},"StartComplianceRequest":{"type":"object","properties":{"country":{"type":"string","enum":["AU","GB","US"],"description":"Where the numbers will be."},"kind":{"type":"string","enum":["au_mobile_bundle","uk_mobile_bundle","us_10dlc","us_toll_free"],"description":"Defaults to the usual kind for the country."}},"required":["country"],"additionalProperties":false},"PurchaseNumberRequest":{"type":"object","properties":{"country":{"type":"string","enum":["AU","GB","US"]},"phoneNumber":{"type":"string","pattern":"^\\+\\d{8,15}$"}},"required":["country","phoneNumber"],"additionalProperties":false},"AutoReloadRequest":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Turn automatic top-ups on or off."},"thresholdDollars":{"type":"integer","minimum":5,"maximum":2000,"description":"Top up when the balance falls under this many dollars. Default 20."},"amountDollars":{"type":"integer","minimum":20,"maximum":2000,"description":"How many dollars each top-up adds. Default 50."}},"required":["enabled"],"additionalProperties":false},"CreditTopUpRequest":{"type":"object","properties":{"amountDollars":{"type":"integer","minimum":20,"maximum":2000,"description":"Whole dollars of credit to buy, 20 to 2000."}},"required":["amountDollars"],"additionalProperties":false},"SimulationPackRequest":{"type":"object","properties":{"simulations":{"type":"integer","minimum":1,"maximum":10,"description":"Simulations to buy: 1, 5 or 10. One simulation is 200 conversations at 5c each ($10)."}},"required":["simulations"],"additionalProperties":false},"CrmImportFilterRequest":{"type":"object","properties":{"filter":{"type":"object","properties":{"module":{"type":"string","maxLength":100,"nullable":true,"description":"The record type to import from, for CRMs that have more than one (Zoho, Salesforce: Leads or Contacts). Take the values from get_crm_import_options.modules; null otherwise."},"listId":{"type":"string","maxLength":200,"nullable":true,"description":"A CRM list or segment to draw from (get_crm_import_options.lists), or null for every contact."},"matchType":{"type":"string","enum":["all","any"],"default":"all","description":"all: every condition must hold. any: at least one."},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":200,"description":"A field name from get_crm_import_options.fields."},"operator":{"type":"string","enum":["EQ","NEQ","IN","NOT_IN","LT","LTE","GT","GTE","BETWEEN","CONTAINS_TOKEN","NOT_CONTAINS_TOKEN","HAS_PROPERTY","NOT_HAS_PROPERTY","IN_LAST_DAYS"]},"values":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"default":[],"description":"Always strings: one for single-value operators, two for BETWEEN, none for HAS_PROPERTY / NOT_HAS_PROPERTY, a number of days for IN_LAST_DAYS."}},"required":["field","operator"],"additionalProperties":false},"maxItems":18,"default":[],"description":"Up to 18 conditions. Which operators a field accepts depends on its type."},"requirePhone":{"type":"boolean","default":true,"description":"Skip records with no phone number. Leave true: a contact without one cannot be texted."}},"additionalProperties":false,"description":"What to import. Contacts the CRM records as opted out are never imported."}},"required":["filter"],"additionalProperties":false},"CrmWriteBackRequest":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true: appointments the agent books, and the callback requests and handoffs it raises, are written to this CRM as events and tasks on the contact's record. false: nothing more is written; records already there stay."}},"required":["enabled"],"additionalProperties":false},"SpendCapRequest":{"type":"object","properties":{"spendCapDollars":{"type":"integer","minimum":0,"maximum":100000,"description":"The most the workspace will be charged in a month beyond its plan price: invoiced contacts on a paid plan, automatic reloads on Free. Default 100."}},"required":["spendCapDollars"],"additionalProperties":false},"Id":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"],"additionalProperties":false},"AgentCreated":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/AgentDetail"},"foundationJobId":{"type":"string","format":"uuid"}},"required":["agent","foundationJobId"],"additionalProperties":false},"SalesBrainCreated":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid"},"knowledgeBaseId":{"type":"string","format":"uuid"}},"required":["agentId","knowledgeBaseId"],"additionalProperties":false},"ImportSummary":{"type":"object","properties":{"imported":{"type":"integer"},"updated":{"type":"integer"},"skipped":{"type":"integer"},"skippedReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer"}},"required":["reason","count"],"additionalProperties":false}}},"required":["imported","updated","skipped","skippedReasons"],"additionalProperties":false},"EnrollOutcome":{"type":"object","properties":{"requested":{"type":"integer"},"enrolled":{"type":"integer"},"alreadyEnrolled":{"type":"integer"},"suppressed":{"type":"integer"},"followUpPending":{"type":"integer"},"limitedByAllowance":{"type":"integer","description":"Contacts not enrolled because nothing pays for them: the allowance is used and the credit or spend cap does not cover them."},"limitedReason":{"type":["string","null"]},"monthlyRemaining":{"type":["integer","null"],"description":"Contacts that can still be paid for after this call; null = no limit."}},"required":["requested","enrolled","alreadyEnrolled","suppressed","followUpPending","limitedByAllowance","limitedReason","monthlyRemaining"],"additionalProperties":false},"LaunchPreview":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"agentId":{"type":["string","null"],"format":"uuid"},"agentName":{"type":["string","null"]}},"required":["id","name","status","agentId","agentName"],"additionalProperties":false},"enrolledContacts":{"type":"integer"},"contactsPerDay":{"type":"integer"},"firstDaySends":{"type":"integer"},"messagingWindow":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"timezone":{"type":"string"}},"required":["start","end","timezone"],"additionalProperties":false},"complianceConfirmed":{"type":"boolean"},"openingMessage":{"type":["string","null"]},"openingMessageSize":{"type":["object","null"],"properties":{"characters":{"type":"integer"},"segments":{"type":"integer","description":"SMS segments the opener sends as. A written message may be at most 2."}},"required":["characters","segments"],"additionalProperties":false},"blockers":{"type":"array","items":{"type":"string","description":"Empty when the campaign can launch."}}},"required":["campaign","enrolledContacts","contactsPerDay","firstDaySends","messagingWindow","complianceConfirmed","openingMessage","openingMessageSize","blockers"],"additionalProperties":false},"LaunchProposal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["campaign.launch"]},"payload":{"type":"object","properties":{"campaignId":{"type":"string","format":"uuid"}},"required":["campaignId"],"additionalProperties":false},"preview":{"$ref":"#/components/schemas/LaunchPreview"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time","description":"Confirm before this time."},"executedAt":{"type":["string","null"],"format":"date-time"},"result":{"type":["object","null"],"description":"Set once confirmed.","additionalProperties":true}},"required":["id","kind","payload","preview","createdAt","expiresAt","executedAt","result"],"additionalProperties":false},"ProposalConfirmed":{"type":"object","properties":{"proposal":{"$ref":"#/components/schemas/LaunchProposal"},"result":{"$ref":"#/components/schemas/Id"},"alreadyExecuted":{"type":"boolean"}},"required":["proposal","result","alreadyExecuted"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","UNAUTHORIZED","FORBIDDEN","VALIDATION","CONFLICT","RATE_LIMITED","EXTERNAL_SERVICE","CONFIGURATION","INTERNAL"]},"message":{"type":"string"},"field":{"type":"string","description":"Set for VALIDATION errors: the query or path parameter at fault."}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"Me":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","slug","timezone"],"additionalProperties":false},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["api_key"]},"id":{"type":"string","format":"uuid"}},"required":["type","id"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"scopes":{"type":"array","items":{"type":"string","enum":["agents:read","agents:write","knowledge:read","knowledge:write","campaigns:read","campaigns:write","campaigns:launch","contacts:read","contacts:write","audiences:read","audiences:write","conversations:read","conversations:write","messages:read","messages:send","crm:read","crm:write","analytics:read","webhooks:read","webhooks:write","numbers:write","compliance:read","compliance:write","billing:read","billing:write","team:read","team:write","api_keys:manage"]}}},"required":["workspace","actor","role","scopes"],"additionalProperties":false},"Agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"hasFoundation":{"type":"boolean"},"hasSalesBrain":{"type":"boolean"},"hasInstructions":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","description","status","hasFoundation","hasSalesBrain","hasInstructions","createdAt"],"additionalProperties":false},"AgentDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"provider":{"type":"string","description":"Usually one of openai, anthropic, google."},"model":{"type":"string"},"channel":{"type":"string","enum":["sms","whatsapp","email"]},"instructions":{"type":["string","null"]},"instructionsSections":{"type":["object","null"],"properties":{"role":{"type":["string","null"]},"goal":{"type":["string","null"]},"hardRules":{"type":["string","null"]},"escalation":{"type":["string","null"]},"additional":{"type":["string","null"]}},"required":["role","goal","hardRules","escalation","additional"],"additionalProperties":false},"firstMessage":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"createdAt":{"type":"string","format":"date-time"},"canDelete":{"type":"boolean"},"businessContext":{"type":["object","null"],"properties":{"businessName":{"type":"string"},"websiteUrl":{"type":["string","null"],"description":"The business website. Passed to the model as a reference; it is not fetched, so put what matters in businessDescription."},"industry":{"type":"string"},"businessDescription":{"type":"string"},"targetCustomer":{"type":["string","null"]}},"required":["businessName","websiteUrl","industry","businessDescription","targetCustomer"],"additionalProperties":false},"foundationKnowledgeBase":{"type":["object","null"],"description":"Linked knowledge base: id, name, summary and content fields.","additionalProperties":true},"salesBrainKnowledgeBase":{"type":["object","null"],"description":"Linked knowledge base: id, name, summary and content fields.","additionalProperties":true},"voiceNumber":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"phoneNumber":{"type":"string"}},"required":["id","phoneNumber"],"additionalProperties":false}},"required":["id","name","description","provider","model","channel","instructions","instructionsSections","firstMessage","status","createdAt","canDelete","businessContext","foundationKnowledgeBase","salesBrainKnowledgeBase","voiceNumber"],"additionalProperties":false},"Campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"agentId":{"type":["string","null"],"format":"uuid"},"agentName":{"type":["string","null"]},"contactsPerDay":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","status","agentId","agentName","contactsPerDay","createdAt","updatedAt"],"additionalProperties":false},"CampaignDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"agentId":{"type":["string","null"],"format":"uuid"},"agentName":{"type":["string","null"]},"contactsPerDay":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messagingWindowStart":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"messagingWindowEnd":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string"},"bumpAfterHours":{"type":"integer"},"bumpCount":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}},"calendarLink":{"type":["string","null"]},"flow":{"type":["object","null"],"description":"The message flow: opener and follow-up steps.","additionalProperties":true},"replyAfterMinutes":{"type":"integer"},"qualifiedWhen":{"type":["string","null"]},"notFitWhen":{"type":["string","null"]},"bookingAvailability":{"type":["string","null"]},"bookingWindows":{"type":["array","null"],"items":{"type":"object","properties":{"day":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"start":{"type":"string"},"end":{"type":"string"}},"required":["day","start","end"],"additionalProperties":false}},"bookingSlotMinutes":{"type":"integer"},"calendarConnectionId":{"type":["string","null"],"format":"uuid"},"complianceConfirmedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","status","agentId","agentName","contactsPerDay","createdAt","updatedAt","messagingWindowStart","messagingWindowEnd","timezone","bumpAfterHours","bumpCount","tags","calendarLink","flow","replyAfterMinutes","qualifiedWhen","notFitWhen","bookingAvailability","bookingWindows","bookingSlotMinutes","calendarConnectionId","complianceConfirmedAt"],"additionalProperties":false},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":["string","null"]},"email":{"type":"string"},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"productCategory":{"type":["string","null"]},"source":{"type":"string","enum":["csv_upload","crm_sync","manual","inbound_sms","webhook"]},"segment":{"type":"string","enum":["new","uncontacted","contacted_not_booked","booked_not_quoted","quoted_not_sold","sold_not_serviced","existing_customer"]},"suburb":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["active","unsubscribed","bounced"]},"tags":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"activeCampaignId":{"type":["string","null"],"format":"uuid"}},"required":["id","firstName","lastName","email","phone","company","jobTitle","productCategory","source","segment","suburb","lastActivityAt","status","tags","createdAt","activeCampaignId"],"additionalProperties":false},"Conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agentId":{"type":"string","format":"uuid"},"agentName":{"type":["string","null"]},"channel":{"type":"string","enum":["chat","sms","voice","embed","whatsapp","email"]},"status":{"type":"string","enum":["active","closed","archived"]},"externalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"enrollmentId":{"type":["string","null"],"format":"uuid"},"enrollmentStatus":{"type":["string","null"]},"contactId":{"type":["string","null"],"format":"uuid"},"isHumanActive":{"type":"boolean"},"campaignId":{"type":["string","null"],"format":"uuid"},"campaignName":{"type":["string","null"]},"opportunityStage":{"type":["string","null"],"enum":["contacted","responded","qualified","booked"]},"contactName":{"type":["string","null"]},"contactPhone":{"type":["string","null"]},"lastMessagePreview":{"type":["string","null"]},"lastMessageAt":{"type":["string","null"],"format":"date-time"}},"required":["id","agentId","agentName","channel","status","externalId","createdAt","updatedAt","enrollmentId","enrollmentStatus","contactId","isHumanActive","campaignId","campaignName","opportunityStage","contactName","contactPhone","lastMessagePreview","lastMessageAt"],"additionalProperties":false},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"sender":{"type":["string","null"],"enum":["ai","human"]},"metadata":{"type":["object","null"],"description":"Event payload for system messages.","additionalProperties":true},"status":{"type":["string","null"],"description":"Delivery state for outbound messages; null for inbound."}},"required":["id","role","content","createdAt","sender","metadata","status"],"additionalProperties":false},"ConversationDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agentId":{"type":"string","format":"uuid"},"agentName":{"type":["string","null"]},"channel":{"type":"string","enum":["chat","sms","voice","embed","whatsapp","email"]},"status":{"type":"string","enum":["active","closed","archived"]},"externalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"enrollmentId":{"type":["string","null"],"format":"uuid"},"enrollmentStatus":{"type":["string","null"]},"contactId":{"type":["string","null"],"format":"uuid"},"isHumanActive":{"type":"boolean"},"campaignId":{"type":["string","null"],"format":"uuid"},"campaignName":{"type":["string","null"]},"opportunityStage":{"type":["string","null"],"enum":["contacted","responded","qualified","booked"]},"contactName":{"type":["string","null"]},"contactPhone":{"type":["string","null"]},"pendingReplyAt":{"type":["string","null"],"format":"date-time","description":"When a scheduled AI reply is due, if one is pending."}},"required":["id","agentId","agentName","channel","status","externalId","createdAt","updatedAt","messages","enrollmentId","enrollmentStatus","contactId","isHumanActive","campaignId","campaignName","opportunityStage","contactName","contactPhone","pendingReplyAt"],"additionalProperties":false},"Analytics":{"type":"object","properties":{"totalOpportunityCount":{"type":"integer"},"rangeOpportunityCount":{"type":"integer"},"kpis":{"$ref":"#/components/schemas/Kpis"},"previousKpis":{"oneOf":[{"$ref":"#/components/schemas/Kpis"},{"type":"null"}]},"stageDistribution":{"type":"array","items":{"type":"object","properties":{"stage":{"type":"string","enum":["contacted","responded","qualified","booked"]},"count":{"type":"integer"}},"required":["stage","count"],"additionalProperties":false}},"outcomeDistribution":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["outcome","label","count"],"additionalProperties":false}},"lossReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"],"additionalProperties":false}},"campaignPerformance":{"type":"array","items":{"type":"object","properties":{"campaignId":{"type":["string","null"],"format":"uuid"},"campaignName":{"type":["string","null"]},"total":{"type":"integer"},"booked":{"type":"integer"}},"required":["campaignId","campaignName","total","booked"],"additionalProperties":false}},"volumeOverTime":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}},"required":["date","count"],"additionalProperties":false}}},"required":["totalOpportunityCount","rangeOpportunityCount","kpis","previousKpis","stageDistribution","outcomeDistribution","lossReasons","campaignPerformance","volumeOverTime"],"additionalProperties":false},"Kpis":{"type":"object","properties":{"total":{"type":"integer"},"active":{"type":"integer"},"booked":{"type":"integer"},"lost":{"type":"integer"}},"required":["total","active","booked","lost"],"additionalProperties":false},"SandboxMessage":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","role","content","createdAt"],"additionalProperties":false},"SandboxSession":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"notes":{"type":["string","null"]},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/SandboxMessage"}}},"required":["id","notes","updatedAt","messages"],"additionalProperties":false},"SandboxTurn":{"type":"object","properties":{"sessionId":{"type":"string","format":"uuid"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/SandboxMessage"}}},"required":["sessionId","updatedAt","messages"],"additionalProperties":false},"Persona":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["convertible","hard","nonconvertible"]},"summary":{"type":"string"},"probes":{"type":"array","items":{"type":"string"}}},"required":["id","name","kind","summary","probes"],"additionalProperties":false},"PersonaSet":{"type":"object","properties":{"version":{"type":"string"},"personas":{"type":"array","items":{"$ref":"#/components/schemas/Persona"}}},"required":["version","personas"],"additionalProperties":false},"MissingField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"why":{"type":"string"}},"required":["key","label","why"],"additionalProperties":false},"ComplianceCase":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"country":{"type":"string","enum":["AU","GB","US"]},"countryName":{"type":"string"},"kind":{"type":"string","enum":["au_mobile_bundle","uk_mobile_bundle","us_10dlc","us_toll_free"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","submitted","pending_review","approved","rejected","action_required"]},"statusLabel":{"type":"string"},"nextStep":{"type":"string"},"missing":{"type":"array","items":{"$ref":"#/components/schemas/MissingField"}},"fixes":{"type":"array","items":{"type":"string"}},"notes":{"type":"array","items":{"type":"string"}},"submittedAt":{"type":["string","null"],"format":"date-time"},"decidedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","country","countryName","kind","title","status","statusLabel","nextStep","missing","fixes","notes","submittedAt","decidedAt","createdAt"],"additionalProperties":false},"PlanOverview":{"type":"object","properties":{"plan":{"type":"string"},"label":{"type":"string"},"monthlyPrice":{"type":["number","null"]},"cardOnFile":{"type":"boolean"},"period":{"type":"string","description":"The usage period's key. Allowances and the spend cap are counted in it."},"periodBasis":{"type":"string","enum":["subscription","calendar"]},"periodStartsAt":{"type":"string","format":"date-time"},"periodResetsAt":{"type":"string","format":"date-time","description":"When the allowance resets. With a subscription this is the billing day, the same period the invoice covers."},"periodLabel":{"type":"string"},"periodResetsLabel":{"type":"string"},"contacts":{"type":"object","properties":{"included":{"type":["integer","null"]},"used":{"type":"integer"},"includedRemaining":{"type":["integer","null"]},"remaining":{"type":["integer","null"],"description":"Contacts that can be paid for right now from the allowance, credit and spend cap together; null = no limit."},"overageUsed":{"type":"integer"},"fromCredit":{"type":"integer"},"onInvoice":{"type":"integer"},"overageRate":{"type":["number","null"]}},"required":["included","used","includedRemaining","remaining","overageUsed","fromCredit","onInvoice","overageRate"],"additionalProperties":false},"credit":{"type":"object","properties":{"balanceDollars":{"type":"number"},"contactsAffordable":{"type":"integer"},"ratePerContact":{"type":"number"},"startingCredit":{"type":"object","properties":{"dollars":{"type":"number"},"status":{"type":"string","enum":["granted","add_a_card","pending","card_already_used","not_applicable"]},"grantedAt":{"type":["string","null"],"format":"date-time"},"note":{"type":"string"}},"required":["dollars","status","grantedAt","note"],"additionalProperties":false},"autoReload":{"type":"object","properties":{"enabled":{"type":"boolean"},"thresholdDollars":{"type":"number"},"amountDollars":{"type":"number"},"active":{"type":"boolean"},"chargedThisMonthDollars":{"type":"number"},"lastFailure":{"type":["object","null"],"properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string"}},"required":["at","reason"],"additionalProperties":false},"note":{"type":"string"}},"required":["enabled","thresholdDollars","amountDollars","active","chargedThisMonthDollars","lastFailure","note"],"additionalProperties":false}},"required":["balanceDollars","contactsAffordable","ratePerContact","startingCredit","autoReload"],"additionalProperties":false},"simulations":{"type":"object","properties":{"includedRuns":{"type":["integer","null"]},"includedRunsUsed":{"type":"integer"},"includedRunsRemaining":{"type":["integer","null"]},"largestIncludedRun":{"type":"integer"},"purchasedConversations":{"type":"integer","description":"Bought from credit and not yet used. They do not expire."},"largestPurchasedRun":{"type":"integer"},"pricePerConversation":{"type":"number"},"packs":{"type":"array","items":{"type":"object","properties":{"simulations":{"type":"integer"},"conversations":{"type":"integer"},"dollars":{"type":"number"}},"required":["simulations","conversations","dollars"],"additionalProperties":false}},"note":{"type":"string"}},"required":["includedRuns","includedRunsUsed","includedRunsRemaining","largestIncludedRun","purchasedConversations","largestPurchasedRun","pricePerConversation","packs","note"],"additionalProperties":false},"spendCap":{"type":"object","properties":{"dollars":{"type":"number"},"appliesTo":{"type":"string","enum":["invoice","auto_reload"]},"overageSpentDollars":{"type":"number"},"remainingDollars":{"type":["number","null"]}},"required":["dollars","appliesTo","overageSpentDollars","remainingDollars"],"additionalProperties":false},"plans":{"type":"array","items":{"type":"object","properties":{"plan":{"type":"string"},"label":{"type":"string"},"monthlyPrice":{"type":["number","null"]},"includedContacts":{"type":"integer"},"ratePerContact":{"type":"number"},"effectivePerContact":{"type":"number"},"current":{"type":"boolean"}},"required":["plan","label","monthlyPrice","includedContacts","ratePerContact","effectivePerContact","current"],"additionalProperties":false}},"summary":{"type":"string"}},"required":["plan","label","monthlyPrice","cardOnFile","period","periodBasis","periodStartsAt","periodResetsAt","periodLabel","periodResetsLabel","contacts","credit","simulations","spendCap","plans","summary"],"additionalProperties":false},"CrmImportPreview":{"type":"object","description":"matchingTotal, listSize, exceedsPagingCeiling, scan, sample, skipped, and warnings: sentences to show the user before they import, present when this CRM account cannot do something an import relies on","additionalProperties":true},"CrmImportFilter":{"type":"object","description":"module, listId, matchType, conditions, requirePhone","additionalProperties":true},"CrmConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["hubspot","pipedrive","zoho-crm","salesforce"]},"providerName":{"type":"string"},"status":{"type":"string","description":"connected, reconnect_required or error."},"configurationStatus":{"type":"string","description":"configured once an import filter is saved."},"syncEnabled":{"type":"boolean"},"writeBackEnabled":{"type":"boolean"},"writeBackSupported":{"type":"boolean"},"connectedAt":{"type":"string","format":"date-time"},"providerAccountName":{"type":["string","null"]},"errorMessage":{"type":["string","null"]}},"required":["id","provider","providerName","status","configurationStatus","syncEnabled","writeBackEnabled","writeBackSupported","connectedAt","providerAccountName","errorMessage"],"additionalProperties":false},"CrmWriteBack":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"supported":{"type":"boolean"},"enabled":{"type":"boolean"},"written":{"type":"integer"},"pending":{"type":"integer"},"failed":{"type":"integer"},"lastError":{"type":["string","null"]},"note":{"type":"string"}},"required":["connectionId","provider","supported","enabled","written","pending","failed","lastError","note"],"additionalProperties":false},"CalendarConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["google-calendar","outlook"]},"providerName":{"type":"string"},"status":{"type":"string","enum":["connected","reconnect_required","disconnected"]},"name":{"type":"string"},"accountEmail":{"type":["string","null"]},"connectedAt":{"type":"string","format":"date-time"},"lastReadAt":{"type":["string","null"],"format":"date-time"},"problem":{"type":["string","null"]},"campaigns":{"type":"integer"}},"required":["id","provider","providerName","status","name","accountEmail","connectedAt","lastReadAt","problem","campaigns"],"additionalProperties":false},"CalendarOverview":{"type":"object","properties":{"available":{"type":"boolean"},"unavailableReason":{"type":["string","null"]},"connectUrl":{"type":"string"},"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["provider","name","description"],"additionalProperties":false}},"connections":{"type":"array","items":{"$ref":"#/components/schemas/CalendarConnection"}}},"required":["available","unavailableReason","connectUrl","providers","connections"],"additionalProperties":false},"CampaignAvailability":{"type":"object","properties":{"campaignId":{"type":"string","format":"uuid"},"timezone":{"type":"string"},"hasBookingHours":{"type":"boolean"},"slotMinutes":{"type":"integer"},"calendar":{"type":"object","properties":{"state":{"type":"string","enum":["none","ok","unavailable"]},"connectionId":{"type":["string","null"],"format":"uuid"},"name":{"type":["string","null"]},"provider":{"type":["string","null"]},"problem":{"type":["string","null"]}},"required":["state","connectionId","name","provider","problem"],"additionalProperties":false},"calendarBusy":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"],"additionalProperties":false}},"recordedMeetings":{"type":"integer"},"openTimes":{"type":"array","items":{"type":"string"}},"openTimesTotal":{"type":"integer"},"note":{"type":"string"}},"required":["campaignId","timezone","hasBookingHours","slotMinutes","calendar","calendarBusy","recordedMeetings","openTimes","openTimesTotal","note"],"additionalProperties":false},"CrmOverview":{"type":"object","properties":{"available":{"type":"boolean"},"unavailableReason":{"type":["string","null"]},"connectUrl":{"type":"string","description":"Where a person connects a CRM: authorising needs a browser."},"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["provider","name","description"],"additionalProperties":false}},"connections":{"type":"array","items":{"$ref":"#/components/schemas/CrmConnection"}}},"required":["available","unavailableReason","connectUrl","providers","connections"],"additionalProperties":false},"CrmImportRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","completed","failed","stopped_at_limit"]},"imported":{"type":"integer"},"updated":{"type":"integer"},"skipped":{"type":"integer"},"skip_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"],"additionalProperties":false}},"notices":{"type":"array","items":{"type":"string","description":"Something to tell the user about a run that did not fail, for example an opt-out field the CRM would not let the import read."}},"error":{"type":["string","null"],"description":"Why the run failed, in a sentence. Null unless status is failed."},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}},"required":["id","status","imported","updated","skipped","skip_reasons","notices","error","started_at","finished_at"],"additionalProperties":false},"CreditLedgerEntry":{"type":"object","properties":{"id":{"type":"integer"},"kind":{"type":"string","enum":["starting_credit","top_up","auto_reload","usage","adjustment","refund","simulations"]},"amountDollars":{"type":"number"},"balanceAfterDollars":{"type":"number"},"contacts":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","amountDollars","balanceAfterDollars","contacts","createdAt"],"additionalProperties":false},"SimulationPurchaseProposal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["simulations.purchase"]},"payload":{"type":"object","properties":{"simulations":{"type":"integer"}},"required":["simulations"],"additionalProperties":false},"preview":{"type":"object","properties":{"simulations":{"type":"integer"},"conversations":{"type":"integer"},"costDollars":{"type":"number"},"creditBalanceDollars":{"type":"number"},"creditAfterDollars":{"type":"number"},"conversationsAfter":{"type":"integer"},"note":{"type":"string"}},"required":["simulations","conversations","costDollars","creditBalanceDollars","creditAfterDollars","conversationsAfter","note"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time","description":"Confirm before this time."},"executedAt":{"type":["string","null"],"format":"date-time"},"result":{"type":["object","null"],"description":"Set once confirmed.","additionalProperties":true}},"required":["id","kind","payload","preview","createdAt","expiresAt","executedAt","result"],"additionalProperties":false},"CreditTopUpProposal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["credit.top_up"]},"payload":{"type":"object","properties":{"cents":{"type":"integer"}},"required":["cents"],"additionalProperties":false},"preview":{"type":"object","properties":{"amountDollars":{"type":"number"},"balanceDollars":{"type":"number"},"balanceAfterDollars":{"type":"number"},"ratePerContact":{"type":"number"},"contactsAfter":{"type":"integer"},"note":{"type":"string"}},"required":["amountDollars","balanceDollars","balanceAfterDollars","ratePerContact","contactsAfter","note"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time","description":"Confirm before this time."},"executedAt":{"type":["string","null"],"format":"date-time"},"result":{"type":["object","null"],"description":"Set once confirmed.","additionalProperties":true}},"required":["id","kind","payload","preview","createdAt","expiresAt","executedAt","result"],"additionalProperties":false},"NumberReadiness":{"type":"object","properties":{"country":{"type":"string","enum":["AU","GB","US"]},"complianceApproved":{"type":"boolean"},"complianceCaseId":{"type":["string","null"],"format":"uuid"},"paymentMethodOnFile":{"type":"boolean"},"numbersUsed":{"type":"integer"},"numbersAllowed":{"type":["integer","null"]},"blockers":{"type":"array","items":{"type":"string"}},"links":{"type":"object","properties":{"compliance":{"type":"string"},"billing":{"type":"string"}},"required":["compliance","billing"],"additionalProperties":false}},"required":["country","complianceApproved","complianceCaseId","paymentMethodOnFile","numbersUsed","numbersAllowed","blockers","links"],"additionalProperties":false},"AvailableNumber":{"type":"object","properties":{"phoneNumber":{"type":"string"},"friendlyName":{"type":"string"},"locality":{"type":["string","null"]},"region":{"type":["string","null"]},"country":{"type":"string","enum":["AU","GB","US"]},"capabilities":{"type":"object","properties":{"sms":{"type":"boolean"},"voice":{"type":"boolean"}},"required":["sms","voice"],"additionalProperties":false}},"required":["phoneNumber","friendlyName","locality","region","country","capabilities"],"additionalProperties":false},"OwnedNumber":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phoneNumber":{"type":"string"},"country":{"type":["string","null"]},"status":{"type":"string"},"isValidated":{"type":"boolean"},"source":{"type":"string","enum":["purchased","pool"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","phoneNumber","country","status","isValidated","source","createdAt"],"additionalProperties":false},"NumberPurchaseProposal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"preview":{"type":"object","description":"phoneNumber, country, readiness, note","additionalProperties":true}},"required":["id","kind","expiresAt","preview"],"additionalProperties":false},"BusinessDocument":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["registration","address_proof"]},"fileName":{"type":"string"},"uploadedAt":{"type":"string","format":"date-time"}},"required":["id","kind","fileName","uploadedAt"],"additionalProperties":false},"BusinessProfile":{"type":"object","description":"The business profile: legal name, business number, address, representative, use case, sample messages, opt-in.","additionalProperties":true},"ComplianceCountry":{"type":"object","properties":{"country":{"type":"string","enum":["AU","GB","US"]},"countryName":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"approved":{"type":"boolean"},"openCase":{"oneOf":[{"$ref":"#/components/schemas/ComplianceCase"},{"type":"null"}]},"missing":{"type":"array","items":{"$ref":"#/components/schemas/MissingField"}},"afterSubmit":{"type":"string"}},"required":["country","countryName","kind","title","approved","openCase","missing","afterSubmit"],"additionalProperties":false},"ComplianceOverview":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/BusinessProfile"},"prefilled":{"type":"boolean"},"cases":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceCase"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceCountry"}}},"required":["profile","prefilled","cases","countries"],"additionalProperties":false},"Check":{"type":"object","properties":{"rule":{"type":"string"},"severity":{"type":"string","enum":["hard","soft"]},"passed":{"type":"boolean"},"turn":{"type":"integer"},"detail":{"type":"string"},"probability":{"type":"number"}},"required":["rule","severity","passed"],"additionalProperties":false},"Scorecard":{"type":"object","properties":{"objective":{"type":["string","null"],"enum":["booking","callback"]},"agreedTimeRate":{"type":["number","null"],"description":"Success rate over convertible and hard personas, 0..1, measured against the objective: booked when the agent books, callback requested when it does not book (switched off, or ruled out by its instructions). null when the agent can do neither."},"bookingTested":{"type":"boolean"},"convertibleTotal":{"type":"integer"},"convertibleBooked":{"type":"integer"},"convertibleMet":{"type":"integer","description":"Convertible contacts who reached the objective."},"ownRuleBreaks":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"string"},"count":{"type":"integer"}},"required":["rule","count"],"additionalProperties":false}},"outcomes":{"type":"object","description":"Outcome → count.","additionalProperties":true},"hardBreaks":{"type":"integer"},"softBreaks":{"type":"integer"},"brokenRules":{"type":"object","description":"Rule id → failures.","additionalProperties":true},"perPersona":{"type":"array","items":{"type":"object","properties":{"personaId":{"type":"string"},"kind":{"type":"string"},"booked":{"type":"integer"},"runs":{"type":"integer"},"outcomes":{"type":"array","items":{"type":"string"}},"hardBreaks":{"type":"integer"}},"required":["personaId","kind","booked","runs","outcomes","hardBreaks"],"additionalProperties":false}},"threshold":{"type":"object","properties":{"agreedTimeRate":{"type":"number"},"hardBreaks":{"type":"integer"}},"required":["agreedTimeRate","hardBreaks"],"additionalProperties":false},"battleTested":{"type":"boolean"}},"required":["objective","agreedTimeRate","bookingTested","convertibleTotal","convertibleBooked","convertibleMet","ownRuleBreaks","outcomes","hardBreaks","softBreaks","brokenRules","perPersona","threshold","battleTested"],"additionalProperties":false},"SimulationRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agentId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"personaSetVersion":{"type":"string"},"personaModel":{"type":"string"},"repetitions":{"type":"integer"},"total":{"type":"integer"},"completed":{"type":"integer"},"scorecard":{"oneOf":[{"$ref":"#/components/schemas/Scorecard"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"paidFrom":{"type":"string","enum":["included","purchased"]}},"required":["id","agentId","status","personaSetVersion","personaModel","repetitions","total","completed","scorecard","createdAt","finishedAt","paidFrom"],"additionalProperties":false},"SimulationConversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"personaId":{"type":"string"},"personaKind":{"type":"string"},"repetition":{"type":"integer"},"status":{"type":"string"},"outcome":{"type":["string","null"]},"endedReason":{"type":["string","null"]},"turns":{"type":"integer"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/Check"}},"transcript":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","contact"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"error":{"type":["string","null"]}},"required":["id","personaId","personaKind","repetition","status","outcome","endedReason","turns","checks","error"],"additionalProperties":false},"SimulationDetail":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/SimulationRun"},"conversations":{"type":"array","items":{"$ref":"#/components/schemas/SimulationConversation"}}},"required":["run","conversations"],"additionalProperties":false},"LibraryEntry":{"type":"object","properties":{"id":{"type":"string"},"uri":{"type":"string"},"title":{"type":"string"},"version":{"type":"string"},"summary":{"type":"string"},"sources":{"type":"array","items":{"type":"string"}}},"required":["id","uri","title","version","summary","sources"],"additionalProperties":false},"LibraryDocument":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"version":{"type":"string"},"summary":{"type":"string"},"sources":{"type":"array","items":{"type":"string"}},"markdown":{"type":"string"}},"required":["id","title","version","summary","sources","markdown"],"additionalProperties":false},"LibraryHit":{"type":"object","properties":{"docId":{"type":"string"},"docTitle":{"type":"string"},"heading":{"type":"string"},"text":{"type":"string"},"score":{"type":"number"}},"required":["docId","docTitle","heading","text","score"],"additionalProperties":false},"UsageMonthly":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$","description":"UTC month."},"kind":{"type":"string","enum":["sms_segment_out","sms_segment_in","ai_input_tokens","ai_output_tokens","number_day","crm_record_synced","contact_engaged","simulation_conversation"]},"unit":{"type":"string"},"quantity":{"type":"number"},"events":{"type":"integer"}},"required":["period","kind","unit","quantity","events"],"additionalProperties":false}}},"paths":{"/me":{"get":{"operationId":"getMe","summary":"The workspace, role and scopes behind this key.","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents":{"get":{"operationId":"listAgents","summary":"List agents.","x-scope":"agents:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAgent","summary":"Create an agent from a business description.","description":"Creates the agent and starts its foundation knowledge job in the background; poll GET /agents/{id} until hasFoundation is true. Pass instructions to set the prompt now and activate=true to make it live.","x-scope":"agents:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentCreated"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}":{"get":{"operationId":"getAgent","summary":"One agent with its instructions and linked knowledge.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/instructions":{"put":{"operationId":"setAgentInstructions","summary":"Replace the agent prompt.","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInstructionsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Id"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/sales-brain":{"post":{"operationId":"createAgentSalesBrain","summary":"Create the Sales Brain knowledge base (needs foundation knowledge first).","x-scope":"knowledge:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesBrainRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SalesBrainCreated"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/activate":{"post":{"operationId":"activateAgent","summary":"Mark a draft agent active.","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Id"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/spec":{"get":{"operationId":"getAgentSpec","summary":"The whole agent as one spec (v2): the active version, or the live columns lifted when none exists.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentSpecView"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"setAgentSpec","summary":"Replace the agent with a full spec: validates, records the next version, compiles it into the live prompt.","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAgentSpecRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentSpecResult"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/actions":{"get":{"operationId":"getAgentActions","summary":"What the platform may do for this agent (booking, follow-up, callback, handoff) and what still stands in the way of each.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentActions"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"setAgentActions","summary":"Switch one or more actions on or off without sending the whole spec. Records a version; the instructions are untouched.","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAgentActionsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentActions"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/versions":{"get":{"operationId":"listAgentVersions","summary":"Every version of the agent, newest first, with its change note and which is active.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersion"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/versions/{version}/activate":{"post":{"operationId":"activateAgentVersion","summary":"Re-apply a version's spec and make it active (rollback or roll forward).","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentSpecResult"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/sandbox":{"get":{"operationId":"getAgentSandbox","summary":"The sandbox conversation for an agent.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SandboxSession"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sendAgentSandboxMessage","summary":"Talk to the agent as a contact would; nothing is sent to a real contact.","description":"Uses the agent's real instructions, Sales Brain and knowledge. The conversation persists per agent; reset=true starts fresh. Costs model tokens.","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxMessageRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SandboxTurn"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/simulations":{"get":{"operationId":"listSimulations","summary":"Recent simulation runs for an agent, newest first.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SimulationRun"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"startSimulation","summary":"Run the agent against the simulated contact set in the background.","description":"Each conversation is a worker job; poll GET /simulations/{id}. The scorecard gives the agreed-time rate, rule breaks and transcripts. Costs model tokens; nothing reaches a real contact.","x-scope":"agents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSimulationRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulationRun"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/simulations/{id}":{"get":{"operationId":"getSimulation","summary":"A run with its scorecard and conversations.","x-scope":"agents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"transcripts","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include full transcripts."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulationDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/personas":{"get":{"operationId":"listPersonas","summary":"The simulated contacts an agent is tested against.","x-scope":null,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PersonaSet"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/catalog/sync":{"post":{"operationId":"syncBillingCatalog","summary":"Internal workspaces only: create or update the Stripe catalogue from the code definition. Idempotent.","x-scope":"billing:write","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Prices by lookup key and meter ids","additionalProperties":true}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crm/connections":{"get":{"operationId":"getCrmConnections","summary":"Which CRMs can be connected (HubSpot, Salesforce, Pipedrive, Zoho), where a person connects one, and what is connected now. The platform reads a CRM to import contacts, and writes to it only when write-back is switched on for that connection.","x-scope":"crm:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmOverview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crm/connections/{id}/write-back":{"get":{"operationId":"getCrmWriteBack","summary":"Whether the agent's bookings, callback requests and handoffs are written to this CRM, and how many records are in step, pending or failing.","x-scope":"crm:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmWriteBack"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"setCrmWriteBack","summary":"Switch write-back on or off for this connection. On: for contacts imported from this CRM, a booked appointment is written as an event on their record and a callback request or handoff as a task. Contacts, leads and deals are never changed. Off by default.","x-scope":"crm:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmWriteBackRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmWriteBack"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crm/connections/{id}/import/options":{"get":{"operationId":"getCrmImportOptions","summary":"The fields, lists and record types an import filter can use for this connection, and the filter saved on it.","x-scope":"crm:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"module","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"fields, lists, listNoun, modules, filter, filterStale","additionalProperties":true}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crm/connections/{id}/import/preview":{"post":{"operationId":"previewCrmImport","summary":"How many CRM records a filter matches, with a sample. Saves and imports nothing.","x-scope":"crm:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmImportFilterRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportPreview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crm/connections/{id}/import/filter":{"put":{"operationId":"saveCrmImportFilter","summary":"Save what to import. Moves no contact.","x-scope":"crm:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmImportFilterRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportFilter"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crm/connections/{id}/import":{"get":{"operationId":"getCrmImport","summary":"The most recent import for this connection, or null.","x-scope":"crm:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/CrmImportRun"},{"type":"null"}]}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"startCrmImport","summary":"Start importing the contacts the saved filter matches. Runs in the background, a page at a time; poll GET. Opted-out records and records without a phone number are skipped and counted.","x-scope":"crm:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportRun"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calendars":{"get":{"operationId":"getCalendars","summary":"Connected calendars (Google Calendar, Microsoft 365) with their status, which can be connected, and where a person connects one. A calendar is read as free/busy only. Attach one to a campaign with calendarConnectionId.","x-scope":"campaigns:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarOverview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/availability":{"get":{"operationId":"getCampaignAvailability","summary":"What the agent could offer for this campaign right now: its booking hours, whether its calendar could be read, the busy time read from it (when, never what), and the next open times.","x-scope":"campaigns:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignAvailability"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/integrations/crm/readiness":{"get":{"operationId":"getCrmReadiness","summary":"Internal workspaces only: whether each CRM integration exists in Nango with its own OAuth application, so the connect surface can be offered to customers.","x-scope":"crm:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Flags, per-provider readiness and problems","additionalProperties":true}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plan":{"get":{"operationId":"getPlan","summary":"The plan as the user sees it: included contacts, used, the credit balance and what it buys, the next contact's price, the spend cap, every plan's price per contact, and the equation in one sentence.","x-scope":"billing:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanOverview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plan/spend-cap":{"put":{"operationId":"setSpendCap","summary":"The most the workspace is charged in a month beyond its plan price: invoiced contacts on a paid plan, automatic reloads on Free (default $100).","x-scope":"billing:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendCapRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanOverview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plan/auto-reload":{"put":{"operationId":"setAutoReload","summary":"Turn automatic credit top-ups on or off and set the threshold and amount. Acts on the Free plan; the card is charged when the balance falls under the threshold, up to the spend cap.","x-scope":"billing:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoReloadRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanOverview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plan/simulations":{"post":{"operationId":"proposeSimulationPurchase","summary":"Step 1 of 2: a proposal to buy 1, 5 or 10 simulations (200 conversations each, 5c a conversation) from the credit balance; confirm with POST /proposals/{id}/confirm. The card is not charged.","x-scope":"billing:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationPackRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulationPurchaseProposal"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plan/credit":{"get":{"operationId":"listCreditLedger","summary":"The credit balance's history, newest first: starting credit, top-ups, automatic reloads and usage.","x-scope":"billing:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditLedgerEntry"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"proposeCreditTopUp","summary":"Step 1 of 2: a proposal to buy credit with the card on file; confirm with POST /proposals/{id}/confirm. Nothing is charged until then.","x-scope":"billing:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTopUpRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditTopUpProposal"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers":{"get":{"operationId":"listNumbers","summary":"Numbers this workspace sends from.","x-scope":"agents:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OwnedNumber"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers/readiness":{"get":{"operationId":"getNumberReadiness","summary":"Whether a number can be bought for a country, and what must happen first (?country=AU|GB|US).","x-scope":"agents:read","parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string","enum":["AU","GB","US"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NumberReadiness"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers/search":{"get":{"operationId":"searchNumbers","summary":"Available numbers in a country, once verification there is approved.","x-scope":"numbers:write","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","enum":["AU","GB","US"]}},{"name":"contains","in":"query","required":false,"schema":{"type":"string"}},{"name":"areaCode","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"readiness":{"$ref":"#/components/schemas/NumberReadiness"},"numbers":{"type":"array","items":{"$ref":"#/components/schemas/AvailableNumber"}}},"required":["readiness","numbers"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers/purchase":{"post":{"operationId":"proposeNumberPurchase","summary":"Step 1 of 2: a proposal to buy a number; confirm with POST /proposals/{id}/confirm. Fails with the blockers when the gate is not passed.","x-scope":"numbers:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseNumberRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NumberPurchaseProposal"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers/{id}":{"delete":{"operationId":"releaseNumber","summary":"Give a purchased number back to the carrier.","x-scope":"numbers:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"released":{"type":"boolean"}},"required":["released"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance":{"get":{"operationId":"getCompliance","summary":"Verification status per country and the business profile, with what is still missing.","x-scope":"compliance:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ComplianceOverview"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/profile":{"put":{"operationId":"setBusinessProfile","summary":"Save or update the business profile every country reuses. Send only the fields you are changing.","x-scope":"compliance:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessProfileRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BusinessProfile"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/cases":{"post":{"operationId":"startCompliance","summary":"Open (or return the open) verification case for a country.","x-scope":"compliance:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartComplianceRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ComplianceCase"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/cases/{id}":{"get":{"operationId":"getComplianceCase","summary":"One compliance case with status, next step, missing fields and fixes.","x-scope":"compliance:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ComplianceCase"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/cases/{id}/submit":{"post":{"operationId":"submitCompliance","summary":"Submit a case for review; fails with what is still needed if the profile is incomplete.","description":"Body is optional. Internal workspaces may pass {\"provider\":\"twilio\",\"dryRun\":true} to create the provider objects without sending them for review.","x-scope":"compliance:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ComplianceCase"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/documents":{"post":{"operationId":"uploadComplianceDocument","summary":"Upload a document the registry reads (registration record, proof of address). One per kind; replaces an earlier upload.","x-scope":"compliance:write","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["kind","file"],"properties":{"kind":{"type":"string","enum":["registration","address_proof"]},"file":{"type":"string","format":"binary","description":"PDF, JPEG, PNG or WebP, up to 10 MB."}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BusinessDocument"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/documents/{id}":{"get":{"operationId":"getComplianceDocumentUrl","summary":"A ten-minute link to view a stored document.","x-scope":"compliance:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteComplianceDocument","summary":"Remove a stored document.","x-scope":"compliance:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/blocks":{"get":{"operationId":"listContentBlocks","summary":"Outbound messages the content screen refused (links off your allowed domains, shorteners, restricted content, size), newest first, with what to fix.","x-scope":"messages:read","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","description":"ContentBlock","additionalProperties":true}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/callbacks":{"get":{"operationId":"listCallbackRequests","summary":"Callback requests: contacts who asked for a person to call them (not bookings). Open ones by default, soonest first. Each is task-shaped: who, when they prefer, and why.","x-scope":"conversations:read","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","done","cancelled"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","description":"CallbackRequest","additionalProperties":true}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/callbacks/{id}/complete":{"post":{"operationId":"completeCallbackRequest","summary":"A person made the call: marks the request done and fires callback.completed.","x-scope":"conversations:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"CallbackRequest","additionalProperties":true}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/callbacks/{id}/cancel":{"post":{"operationId":"cancelCallbackRequest","summary":"The call is no longer wanted: cancels the request and removes it from the calendar.","x-scope":"conversations:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"CallbackRequest","additionalProperties":true}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance/regulations":{"get":{"operationId":"getComplianceRegulations","summary":"Internal workspaces only: the provider's own requirement list for a country (?country=AU|GB|US).","x-scope":"compliance:write","parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string","enum":["AU","GB","US"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Provider regulations","additionalProperties":true}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns":{"get":{"operationId":"listCampaigns","summary":"List campaigns.","x-scope":"campaigns:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCampaign","summary":"Create a draft campaign with its settings and opening message.","x-scope":"campaigns:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}":{"get":{"operationId":"getCampaign","summary":"One campaign with its schedule, flow and booking settings.","x-scope":"campaigns:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCampaign","summary":"Change any subset of settings or the opening message.","x-scope":"campaigns:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaignRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/contacts":{"post":{"operationId":"enrollContacts","summary":"Enrol contacts by ids or by filter.","x-scope":"campaigns:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollContactsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EnrollOutcome"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/compliance":{"post":{"operationId":"confirmCampaignCompliance","summary":"Record that enrolled contacts consented to SMS contact. Required before launch.","x-scope":"campaigns:launch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Id"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/launch":{"post":{"operationId":"proposeCampaignLaunch","summary":"Step 1 of 2: preview a launch and get a proposal to confirm.","description":"Nothing is sent. The proposal lists enrolled contacts, first-day sends, the opener and any blockers; confirm it with POST /proposals/{id}/confirm within 15 minutes.","x-scope":"campaigns:launch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchProposal"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/pause":{"post":{"operationId":"pauseCampaign","summary":"Stop new sends.","x-scope":"campaigns:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Id"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/proposals/{id}/confirm":{"post":{"operationId":"confirmProposal","summary":"Step 2 of 2: act on a proposal. Idempotent.","description":"Confirming the same proposal twice returns the first result with alreadyExecuted=true. A launch sends real SMS.","x-scope":"campaigns:launch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProposalConfirmed"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts/import":{"post":{"operationId":"importContacts","summary":"Import up to 1000 contacts into a journey segment.","x-scope":"contacts:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportContactsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportSummary"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action conflicts with current state (for example an expired proposal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts":{"get":{"operationId":"listContacts","summary":"A page of contacts.","x-scope":"contacts:read","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","unsubscribed","bounced"]}},{"name":"segment","in":"query","required":false,"schema":{"type":"string","enum":["new","uncontacted","contacted_not_booked","booked_not_quoted","quoted_not_sold","sold_not_serviced","existing_customer"]}},{"name":"campaignId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Only contacts enrolled in this campaign."},{"name":"tag","in":"query","required":false,"schema":{"type":"string"},"description":"Exact tag match."},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Free text across name, email, company and phone."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"1-based page number."},{"name":"pageSize","in":"query","required":false,"schema":{"type":"string","enum":["50","200","500","1000"]},"description":"Rows per page. Default 50."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"pageCount":{"type":"integer"}},"required":["data","total","page","pageSize","pageCount"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations":{"get":{"operationId":"listConversations","summary":"List conversations, newest activity first.","x-scope":"conversations:read","parameters":[{"name":"stage","in":"query","required":false,"schema":{"type":"string","enum":["contacted","responded","qualified","booked"]},"description":"Only conversations whose opportunity is at this stage."},{"name":"humanActive","in":"query","required":false,"schema":{"type":"boolean"},"description":"Only conversations a person has taken over (true) or not (false)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{id}":{"get":{"operationId":"getConversation","summary":"One conversation with its messages.","x-scope":"conversations:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConversationDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/analytics":{"get":{"operationId":"getAnalytics","summary":"Pipeline analytics for a date range.","x-scope":"analytics:read","parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","enum":["7d","30d","90d","all"]},"description":"Default 30d."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Analytics"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library":{"get":{"operationId":"listLibrary","summary":"Vendita's selling playbooks: read before writing agent instructions or a Sales Brain.","x-scope":null,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LibraryEntry"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library/{id}":{"get":{"operationId":"getLibraryDocument","summary":"One library document as markdown.","x-scope":null,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LibraryDocument"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library/search":{"get":{"operationId":"searchLibrary","summary":"The library sections that best answer a question.","x-scope":null,"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2},"description":"The question or topic."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10},"description":"Default 5."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LibraryHit"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"operationId":"listUsage","summary":"Metered usage for one UTC month, by kind.","x-scope":"billing:read","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"YYYY-MM. Default: the current month."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UsageMonthly"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Missing, malformed, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not hold the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A query or path parameter is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}