{"openapi":"3.1.0","info":{"title":"GetPulseRelay public API","version":"1.1.0","description":"Send WhatsApp, SMS and transactional Email messages and WhatsApp/SMS one-time codes; manage contacts and webhooks. RCS currently uses app workflows and is not a public v1 send channel. Workspace keys (wpr_…) act for their own workspace. Partner keys (wpp_…) provision workspaces for their customers and act for one of them per request with the X-PulseRelay-Workspace header."},"servers":[{"url":"/api/public/v1"}],"components":{"securitySchemes":{"workspaceKey":{"type":"http","scheme":"bearer","description":"Workspace API key (wpr_…)"},"partnerKey":{"type":"http","scheme":"bearer","description":"Partner key (wpp_…); add X-PulseRelay-Workspace for workspace endpoints"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Readable message"},"code":{"type":"string","description":"Stable machine code"},"attempts_remaining":{"type":"integer"}}},"SendMessageRequest":{"type":"object","required":["to"],"allOf":[{"if":{"not":{"properties":{"channel":{"const":"email"}},"required":["channel"]}},"then":{"properties":{"to":{"maxLength":32},"text":{"maxLength":4096}},"not":{"anyOf":[{"required":["subject"]},{"required":["html"]},{"required":["reply_to"]},{"required":["purpose"]}]}}},{"if":{"properties":{"channel":{"const":"email"}},"required":["channel"]},"then":{"required":["subject"],"anyOf":[{"required":["text"]},{"required":["html"]}],"not":{"anyOf":[{"required":["type"]},{"required":["template_name"]},{"required":["variables"]},{"required":["header_media_url"]},{"required":["dlt_template_id"]}]}}},{"if":{"properties":{"channel":{"const":"sms"}},"required":["channel"]},"then":{"required":["text"],"not":{"anyOf":[{"required":["template_name"]},{"properties":{"type":{"const":"template"}},"required":["type"]}]}}},{"if":{"properties":{"channel":{"const":"whatsapp"}}},"then":{"anyOf":[{"properties":{"type":{"const":"text"}},"required":["type","text"],"not":{"required":["template_name"]}},{"properties":{"type":{"const":"template"}},"required":["template_name"]},{"not":{"required":["type"]},"required":["text"]}]}}],"properties":{"channel":{"type":"string","enum":["whatsapp","sms","email"],"default":"whatsapp"},"type":{"type":"string","enum":["template","text"],"description":"WhatsApp only; text needs an open 24-hour window"},"to":{"type":"string","maxLength":254,"description":"One email address for email; an E.164 phone number for WhatsApp/SMS","example":"+919876543210"},"template_name":{"type":"string","minLength":1,"maxLength":512},"language":{"type":"string","default":"en"},"variables":{"type":"array","maxItems":30,"items":{"type":"string","maxLength":1024}},"header_media_url":{"type":"string","format":"uri","description":"https image/video/document for media templates"},"text":{"type":"string","maxLength":100000,"description":"Email plain-text body (up to 100000 characters); SMS or WhatsApp text (up to 4096)"},"subject":{"type":"string","maxLength":200,"description":"Required for email; no line breaks"},"html":{"type":"string","maxLength":200000,"description":"Email HTML body. Supply text, html, or both."},"reply_to":{"type":"string","format":"email","description":"Email reply-to override; defaults to the channel setting"},"purpose":{"type":"string","enum":["transactional"],"description":"Email API supports transactional messages only"},"dlt_template_id":{"type":"string","description":"SMS to India: the registered DLT template the text must match"},"from":{"type":"string","format":"uuid","description":"Workspace sender UUID: WhatsApp number id, SMS channel id, or email channel id (GET /numbers)"},"reference":{"type":"string","maxLength":128},"metadata":{"type":"object","maxProperties":20,"description":"Flat key/value pairs (≤2 KB) stored with the message and echoed in webhooks.","additionalProperties":{"type":["string","number","boolean","null"]}},"not_before":{"type":"string","format":"date-time","description":"Earliest send time, ≤30 days ahead"},"quiet_hours":{"description":"respect (default: the workspace's quiet hours), ignore, or a window for this message","oneOf":[{"type":"string","enum":["respect","ignore"]},{"type":"object","required":["start","end","timezone"],"additionalProperties":false,"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","example":"21:00"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","example":"08:00"},"timezone":{"type":"string","example":"Asia/Kolkata"}}}]}}},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","scheduled","sending","sent","delivered","read","failed","canceled","uncertain"]},"channel":{"type":"string","enum":["whatsapp","sms","email"]},"to":{"type":"string"},"reference":{"type":["string","null"]},"metadata":{"type":"object"},"scheduled_for":{"type":["string","null"],"format":"date-time"},"sent_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"read_at":{"type":["string","null"],"format":"date-time"},"attempts":{"type":"integer"},"wamid":{"type":["string","null"]},"provider_message_id":{"type":["string","null"]},"error":{"type":["string","null"]}}},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phone_e164":{"type":"string"},"name":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"lead_status":{"type":["string","null"]},"opted_out":{"type":"boolean"}}},"ContactInput":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string"},"name":{"type":"string","maxLength":200},"tags":{"type":"array","maxItems":30,"items":{"type":"string","maxLength":64}},"lead_status":{"type":"string","enum":["new","contacted","qualified","customer","lost"]},"attributes":{"type":"object","additionalProperties":{"type":"string"}}}},"Templates":{"type":"object","properties":{"whatsapp":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"status":{"type":"string"},"variables":{"type":"integer","description":"Number of {{n}} body variables"},"body":{"type":"string"}}}},"sms_dlt":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"dlt_template_id":{"type":"string"},"sender_id":{"type":"string"},"category":{"type":"string"},"body":{"type":"string","description":"Registered text; {#var#} marks a variable (≤30 characters)"}}}},"dlt_entity_id_set":{"type":"boolean"}}},"Numbers":{"type":"object","properties":{"email":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"sender":{"type":["string","null"]},"name":{"type":["string","null"]},"is_default":{"type":"boolean"},"status":{"type":"string"}}}},"whatsapp":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phone":{"type":["string","null"]},"label":{"type":["string","null"]},"is_default":{"type":"boolean"},"active":{"type":"boolean"},"paused":{"type":"boolean"},"quality_rating":{"type":["string","null"]},"tier":{"type":["string","null"]}}}},"sms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"sender":{"type":["string","null"]},"name":{"type":["string","null"]},"is_default":{"type":"boolean"},"status":{"type":"string"}}}}}},"OtpSendRequest":{"type":"object","required":["to"],"allOf":[{"if":{"properties":{"channel":{"const":"whatsapp"}}},"then":{"required":["template_name"]}},{"if":{"properties":{"channel":{"const":"sms"}},"required":["channel"]},"then":{"required":["text"],"properties":{"text":{"pattern":"\\{code\\}"}}}}],"properties":{"to":{"type":"string"},"channel":{"type":"string","enum":["whatsapp","sms"],"default":"whatsapp"},"template_name":{"type":"string","description":"WhatsApp AUTHENTICATION template"},"language":{"type":"string","default":"en"},"text":{"type":"string","maxLength":500,"description":"SMS text containing {code}"},"dlt_template_id":{"type":"string"},"from":{"type":"string","format":"uuid"},"code_length":{"type":"integer","minimum":4,"maximum":8,"default":6},"ttl_seconds":{"type":"integer","minimum":60,"maximum":1800,"default":600},"max_attempts":{"type":"integer","minimum":1,"maximum":10,"default":5},"reference":{"type":"string","maxLength":128},"metadata":{"type":"object","maxProperties":20,"description":"Flat key/value pairs (≤2 KB) stored with the message and echoed in webhooks.","additionalProperties":{"type":["string","number","boolean","null"]}}}},"OtpChallenge":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","verified","expired","failed","canceled"]},"channel":{"type":"string"},"to":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"attempts":{"type":"integer"},"max_attempts":{"type":"integer"},"reference":{"type":["string","null"]},"delivery":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","sent","failed","uncertain"]},"error":{"type":["string","null"]}}}}},"OtpVerifyRequest":{"type":"object","required":["id","code"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","pattern":"^\\d{4,8}$"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventName"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"secret":{"type":"string","description":"Signing secret; returned only when the webhook is created"}}},"WebhookInput":{"type":"object","required":["url","events"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"Public https:// address"},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/WebhookEventName"}},"name":{"type":"string","maxLength":80}}},"WebhookEventName":{"type":"string","enum":["voice.outreach_finished","message.received","message.status","message.sent","message.failed","campaign.finished","contact.created","contact.opted_out","contact.opted_in"]},"VoiceOutreachInput":{"type":"object","additionalProperties":false,"required":["request_id","contact_id","permission_ref","scheduled_for","context"],"allOf":[{"if":{"properties":{"context":{"properties":{"purpose":{"const":"profile_counselling"}},"required":["purpose"]}}},"then":{"required":["counselling_profile"]},"else":{"not":{"required":["counselling_profile"]}}}],"properties":{"request_id":{"type":"string","format":"uuid","description":"Stable across retries"},"contact_id":{"type":"string","format":"uuid"},"permission_ref":{"type":"string","minLength":3,"maxLength":240},"scheduled_for":{"type":"string","format":"date-time"},"counselling_profile":{"$ref":"#/components/schemas/VoiceCounsellingProfile"},"context":{"type":"object","additionalProperties":false,"required":["lead_ref","purpose","stage"],"properties":{"lead_ref":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,96}$"},"purpose":{"type":"string","enum":["lead_verification","re_engagement","profile_counselling","appointment_reminder","document_reminder","fee_reminder"]},"stage":{"type":"string","enum":["new","contacted","qualified","application_started","enrolled"]},"programme_code":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,96}$"},"prior_outcome":{"type":"string","enum":["no_answer","asked_to_call_back","interested","reminder_sent"]},"appointment_at":{"type":"string","format":"date-time","description":"Required for appointment reminders; omitted otherwise"},"fee_kind":{"type":"string","enum":["application_fee","deposit"]},"admissions_webhook_id":{"type":"string","format":"uuid","description":"Edulexa subscription used to confirm current permission immediately before dispatch."}}}}},"VoiceCounsellingProfile":{"type":"object","additionalProperties":false,"description":"A structured profile the learner has permitted the institute to use for this call.","required":["observed_on","source","profile_permission_ref"],"properties":{"source":{"type":"string","enum":["enquiry","crm","learner_resume"]},"observed_on":{"type":"string","format":"date"},"profile_permission_ref":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]{2,95}$"},"goal":{"type":"string","enum":["leadership","management","product","data_ai","finance","technology"]},"track":{"type":"string","enum":["operations","engineering","sales_marketing","finance","data_ai","product","people","general_management","other"]},"skills":{"type":"array","maxItems":6,"items":{"type":"string","enum":["analytics","programming","project_management","product_discovery","people_management","digital_marketing","financial_analysis","process_improvement"]}},"education":{"type":"string","enum":["secondary","diploma","bachelors","postgraduate"]},"experience_years":{"type":"integer","minimum":0,"maximum":65},"format":{"type":"string","enum":["online","hybrid","campus"]},"max_fee_inr":{"type":"integer","minimum":0,"maximum":10000000},"max_weekly_hours":{"type":"integer","minimum":1,"maximum":60}}},"WebhookEnvelope":{"type":"object","description":"POSTed to your URL. Headers: X-PulseRelay-Event, X-PulseRelay-Signature (sha256=<hex HMAC-SHA256 of the raw body with your secret>), X-PulseRelay-Delivery (= id, the same on retries), X-PulseRelay-Attempt. Failures (network, 408, 425, 429, 5xx) are retried after ~30 s, 2 min, 10 min, 30 min, 2 h and 6 h.","required":["id","event","tenant_id","created_at","data"],"properties":{"id":{"type":"string","format":"uuid"},"event":{"$ref":"#/components/schemas/WebhookEventName"},"tenant_id":{"type":"string","format":"uuid","description":"Workspace id"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object"}}},"MessageEvent":{"type":"object","description":"data of message.sent, message.status and message.failed","properties":{"id":{"type":"string","format":"uuid","description":"Message (job) id from POST /messages"},"reference":{"type":["string","null"]},"metadata":{"type":"object"},"channel":{"type":"string"},"to":{"type":["string","null"]},"status":{"type":"string","enum":["sent","delivered","read","failed"]},"wamid":{"type":["string","null"]},"provider_message_id":{"type":["string","null"]},"error":{"type":["string","null"]},"error_code":{"type":["string","null"]},"otp_id":{"type":"string","format":"uuid"},"timestamp":{"type":["string","null"],"format":"date-time"}}},"ConsentEvent":{"type":"object","description":"data of contact.opted_out and contact.opted_in","properties":{"phone":{"type":["string","null"]},"contact_id":{"type":["string","null"]},"channel":{"type":"string","enum":["whatsapp","sms","email","all"]},"scope":{"type":"string","enum":["all_channels","email"],"description":"A STOP blocks every channel of the workspace"},"source":{"type":"string"},"keyword":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}}},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"external_ref":{"type":["string","null"]},"timezone":{"type":"string"},"locale":{"type":"string"},"suspended":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"quiet_hours":{"$ref":"#/components/schemas/QuietHours"},"readiness":{"type":"object","properties":{"whatsapp_connected":{"type":"boolean"},"sms_connected":{"type":"boolean"},"dlt_entity_id_set":{"type":"boolean"},"approved_whatsapp_templates":{"type":"integer"},"dlt_templates":{"type":"integer"}}}}},"QuietHours":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"},"start":{"type":["string","null"],"example":"21:00"},"end":{"type":["string","null"],"example":"08:00"}}},"WorkspaceInput":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":2,"maxLength":120},"external_ref":{"type":"string","maxLength":128,"description":"Your id for this customer; provisioning is idempotent on it"},"timezone":{"type":"string","default":"UTC"},"locale":{"type":"string","default":"en"},"quiet_hours":{"$ref":"#/components/schemas/QuietHours"}}},"WorkspacePatch":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":2,"maxLength":120},"timezone":{"type":"string"},"locale":{"type":"string"},"quiet_hours":{"$ref":"#/components/schemas/QuietHours"}}},"WorkspaceKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"key_prefix":{"type":"string"},"key":{"type":"string","description":"wpr_… workspace key; shown once"},"created_at":{"type":"string","format":"date-time"}}}}},"security":[{"workspaceKey":[]},{"partnerKey":[]}],"paths":{"/workspace":{"get":{"summary":"Identity of the authenticated workspace","description":"Workspace keys only. Returns the key's workspace identity; caller-supplied workspace headers do not select it.","security":[{"workspaceKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","apiVersion"],"properties":{"id":{"type":"string","format":"uuid"},"apiVersion":{"const":"public-v1"}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"summary":"Queue WhatsApp, SMS or transactional Email","description":"Validated, queued and tried once immediately. Provider failures are retried with backoff (watch message.sent / message.failed webhooks).","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Retry safely: a repeated key replays the first response (Idempotent-Replay: true).","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"202":{"description":"Queued (and possibly already sent)","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Message"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"idempotency_in_progress: wait and retry the identical request with the same key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Rule refused it: opted_out, outside_window, variables_mismatch, invalid_from, dlt_no_match, dlt_no_entity, …","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{messageId}":{"get":{"summary":"Status of one message","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Message"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Message status temporarily unavailable; retry the status lookup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts":{"get":{"summary":"List contacts","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create or update a contact","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactInput"}}}},"responses":{"201":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Create a contact or return the existing contact ID","description":"Keeps existing contact details and consent. New contacts have no marketing consent.","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workspace_id","phone","name"],"properties":{"workspace_id":{"type":"string","format":"uuid"},"phone":{"type":"string","minLength":5,"maxLength":32},"name":{"type":"string","minLength":1,"maxLength":200}}}}}},"responses":{"200":{"description":"Existing contact","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-setup":{"get":{"summary":"Check the authenticated workspace's AI counselling setup","description":"Requires webhooks:manage. Reports the published carrier deployment, approved voice knowledge, programme availability, and the selected result subscription.","security":[{"workspaceKey":[]},{"partnerKey":[]}],"parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}},{"name":"webhook_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["workspace_id","voice","catalogue_ready","results_subscription_active"],"properties":{"workspace_id":{"type":"string","format":"uuid"},"voice":{"type":["object","null"],"description":"Null when voice route configuration could not be read.","properties":{"configured":{"type":"boolean"},"inbound_number":{"type":["string","null"]},"carrier_verified":{"type":"boolean"},"knowledge_verified":{"type":"boolean"},"counselling_tools_configured":{"type":"boolean"},"outbound_enabled":{"type":"boolean"},"outreach_key_matches":{"type":"boolean"}}},"catalogue_ready":{"type":["boolean","null"]},"results_subscription_active":{"type":["boolean","null"]}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Verify one signed voice result callback","description":"Requires webhooks:manage. Sends a signed voice.setup_probe to one active voice result subscription. The receiver acknowledges its event ID. No call is placed.","security":[{"workspaceKey":[]},{"partnerKey":[]}],"parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workspace_id","webhook_id"],"additionalProperties":false,"properties":{"workspace_id":{"type":"string","format":"uuid"},"webhook_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["acknowledged"],"properties":{"acknowledged":{"type":"boolean"}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-sync":{"get":{"summary":"Recover the workspace's voice results and opt-outs","description":"Returns up to 100 entries from the ordered feed for an active voice results subscription. Save the last cursor after applying the entries. Omit after to read from the beginning.","security":[{"workspaceKey":[]}],"parameters":[{"name":"webhook_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"after","in":"query","schema":{"type":"string","pattern":"^\\d{1,16}$"}},{"name":"include_inbound","in":"query","schema":{"const":"1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["workspace_id","events"],"properties":{"workspace_id":{"type":"string","format":"uuid"},"events":{"type":"array","items":{"type":"object","required":["cursor","kind","data"],"properties":{"cursor":{"type":"string"},"kind":{"enum":["result","opt_out","inbound"]},"data":{"type":"object"}}}}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Voice recovery is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-catalogue":{"post":{"summary":"Synchronize approved Edulexa programmes","description":"Publishes the Edulexa portion of the catalogue using the configured outreach key.","security":[{"workspaceKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["programmes"],"properties":{"programmes":{"type":"array","maxItems":50,"items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"revision":{"type":["string","null"]}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Catalogue revision or programme codes conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Programme catalogue is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-outreach":{"post":{"summary":"Schedule a permissioned CRM outreach call","description":"Requires the workspace key configured for the voice pilot. Profile counselling also requires a permissioned profile and an active published programme.","security":[{"workspaceKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceOutreachInput"}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Call rejected or outbound calling paused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Read an outreach call and its structured outcome","security":[{"workspaceKey":[]}],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"counselling_result":{"type":["object","null"],"description":"The learner-confirmed profile, catalogue revision, matched programme (if selected), and requested next step. Also delivered as data.counselling in voice.outreach_finished."},"provider_ref":{"type":["string","null"]},"attempted_at":{"type":["string","null"],"format":"date-time"},"carrier_ended_at":{"type":["string","null"],"format":"date-time"},"last_checked_at":{"type":["string","null"],"format":"date-time"},"duration_seconds":{"type":["number","null"]},"operator_closed_at":{"type":["string","null"],"format":"date-time"}}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Call not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Cancel a scheduled outreach call","security":[{"workspaceKey":[]}],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Call is no longer scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Check or close an aged Edulexa carrier attempt","description":"The configured managed workspace key can check an attempt after 90 minutes. Closing requires carrier confirmation. A late receipt can still resolve the original attempt.","security":[{"workspaceKey":[]}],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["action"],"properties":{"action":{"const":"check"}}},{"type":"object","required":["action","carrier_confirmed"],"properties":{"action":{"const":"close"},"carrier_confirmed":{"const":true}}}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The attempt is still within its reconciliation window","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"summary":"WhatsApp templates and India DLT SMS templates","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Templates"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers":{"get":{"summary":"WhatsApp numbers, SMS senders and email channels (ids for the from field)","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Numbers"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/otp":{"post":{"summary":"Send a one-time code","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Retry safely: a repeated key replays the first response (Idempotent-Replay: true).","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpSendRequest"}}}},"responses":{"202":{"description":"Code created; delivery shows whether it was sent","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/OtpChallenge"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"idempotency_in_progress: wait and retry the identical request with the same key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"template_not_authentication, dlt_promotional, opted_out, …","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"OTP not configured on this platform","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/otp/verify":{"post":{"summary":"Check a one-time code","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpVerifyRequest"}}}},"responses":{"200":{"description":"Verified","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/OtpChallenge"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"already_verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"expired or superseded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"invalid_code (attempts_remaining)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"get":{"summary":"List webhook subscriptions","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a webhook subscription (secret returned once)","parameters":[{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"too_many_webhooks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{webhookId}":{"delete":{"summary":"Delete a webhook subscription","parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-PulseRelay-Workspace","in":"header","required":false,"description":"Partner keys only: id of the child workspace to act for. Ignored for workspace keys.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/workspaces":{"get":{"summary":"List your customers' workspaces","security":[{"partnerKey":[]}],"parameters":[{"name":"external_ref","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Provision a workspace for a customer (idempotent on external_ref)","security":[{"partnerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInput"}}}},"responses":{"200":{"description":"Already existed","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Workspace"},"created":{"type":"boolean"}}}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Workspace"},"created":{"type":"boolean"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/workspaces/{workspaceId}":{"get":{"summary":"One workspace with its readiness","security":[{"partnerKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Workspace"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update name, time zone, locale or quiet hours","security":[{"partnerKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePatch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Workspace"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/workspace-keys":{"post":{"summary":"Create a workspace key for one of your workspaces (shown once)","security":[{"partnerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workspace_id"],"properties":{"workspace_id":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":80}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceKey"}}}}}},"400":{"description":"Invalid request (code: invalid_json, invalid_request, invalid_phone, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan without API access, missing scope, or not a partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace (also returned for other workspaces' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit (Retry-After header) or per-number OTP limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Data-residency contract refused the serving region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal failure; a send may already exist. Reconcile using the original notification key/payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"summary":"This document","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"webhooks":{"message.status":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEnvelope"}}}},"responses":{"200":{"description":"Return 2xx quickly"}}}},"message.sent":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEnvelope"}}}},"responses":{"200":{"description":"Return 2xx quickly"}}}},"message.failed":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEnvelope"}}}},"responses":{"200":{"description":"Return 2xx quickly"}}}},"contact.opted_out":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEnvelope"}}}},"responses":{"200":{"description":"Return 2xx quickly"}}}},"contact.opted_in":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEnvelope"}}}},"responses":{"200":{"description":"Return 2xx quickly"}}}}}}