{"openapi":"3.1.0","info":{"title":"Channel Manager","description":"Channel configuration and Twilio Trust Hub verification","version":"1.0.0"},"paths":{"/v1/twilio-setup":{"post":{"tags":["Twilio Setups"],"summary":"Create Twilio Setup","description":"Create a Twilio setup: subaccount, customer profile, and Trust Hub entities, then submit for review.\n\nAll-or-nothing; a failure unwinds every Twilio resource. STIR/CNAM/regulatory\nbundles come later, once the profile is approved.\n\nRequires the `twilio-setup:create` OAuth2 scope (resource-less — satisfied only by a first-party `\"*\"` setup grant).","operationId":"create-twilio-setup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__create_twilio_setup__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupResponse"}}}},"422":{"description":"Twilio's pre-submission evaluation returned noncompliant for the supplied business info."}},"security":[{"HTTPBearer":[]}]}},"/v1/twilio-setup/{setup_id}":{"get":{"tags":["Twilio Setups"],"summary":"Get Twilio Setup Status","description":"Fetch a Twilio setup's current review status from the database (advanced by webhooks).\n\nRequires the `twilio-setup:read` OAuth2 scope on the target setup.","operationId":"get-twilio-setup-status","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Twilio Setups"],"summary":"Update Twilio Setup","description":"Update a setup's business info, authorized rep, or address, then resubmit the customer profile.\n\nGated on a rejected customer profile (409 otherwise). A pre-flight evaluation 422s\non a noncompliant profile.\n\nRequires the `twilio-setup:write` OAuth2 scope on the target setup.","operationId":"update-twilio-setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__update_twilio_setup__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Customer profile is not in TWILIO_REJECTED status — Trust Hub bundles cannot be edited while approved or under review."},"422":{"description":"Twilio's pre-submission evaluation returned noncompliant for the supplied business info / authorized rep / address. Failure details on customer_profile_last_failure (also returned in the response body)."}}}},"/v1/twilio-setup/{setup_id}/verify-webhook":{"post":{"tags":["Twilio Setups"],"summary":"Validate Twilio Webhook","description":"Validate a Twilio webhook signature against the setup's subaccount auth token.\n\nRequires the `twilio-setup:verify-webhook` OAuth2 scope on the target setup.","operationId":"validate-twilio-webhook","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__validate_twilio_webhook__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__validate_twilio_webhook__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks twilio-setup:verify-webhook scope / access to this setup."},"404":{"description":"Twilio setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/regulation":{"get":{"tags":["Twilio Setups"],"summary":"Get Regulation","description":"Look up the regulatory requirements to buy a phone number of a given country and type.\n\nReshapes Twilio's regulation into the field shape the bundle-submit endpoint\nexpects. 404 when the combination has no requirements.\n\nRequires the `compliance:regulatory:read` OAuth2 scope on the target setup.","operationId":"get-regulation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"iso_country","in":"query","required":true,"schema":{"type":"string","pattern":"^\\w{2}$","title":"Iso Country"}},{"name":"number_type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/TwilioNumberType"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__get_regulation__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found, no regulation matches the (iso_country, number_type) tuple, or the regulation has no end_user or supporting_document requirements (no bundle needed)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/bundle/shaken-stir":{"post":{"tags":["Twilio Setups"],"summary":"Submit Shaken Stir","description":"Submit the SHAKEN/STIR bundle for a setup, once.\n\nNo resubmit path: once a bundle row exists this 409s. Fix a rejected bundle by\nupdating the customer profile, which re-triggers Twilio review.\n\nRequires the `compliance:voice:write` OAuth2 scope on the target setup.","operationId":"submit-shaken-stir","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupBundleResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Customer profile is not approved, or a SHAKEN/STIR bundle already exists. Bundle is not editable post-creation; fix rejections via the customer profile."},"422":{"description":"Twilio's pre-submission evaluation returned noncompliant for the customer profile."}}}},"/v1/twilio-setup/{setup_id}/bundle/cnam":{"post":{"tags":["Twilio Setups"],"summary":"Submit Cnam","description":"Create or resubmit the CNAM caller-ID-name bundle for US/CA outbound calls.\n\nFirst call creates; a rejected bundle resubmits with a new display name. Approved\nor in-review bundles are locked (409).\n\nRequires the `compliance:voice:write` OAuth2 scope on the target setup.","operationId":"submit-cnam","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__submit_cnam__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupBundleResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Customer profile is not approved, bundle is in a non-rejected state (approved / in-review / pending-review), or the supplied display_name matches the stored value (nothing to change)."},"422":{"description":"Twilio's pre-submission evaluation returned noncompliant for the supplied display_name."}}}},"/v1/twilio-setup/{setup_id}/bundle/a2p-messaging-profile":{"post":{"tags":["Twilio Setups"],"summary":"Submit A2P Messaging Profile","description":"Create or resubmit the A2P Messaging Profile bundle, the Trust Hub prerequisite for brand registration.\n\nFirst call creates; a rejected bundle resubmits after a content change. Approved or\nin-review bundles are locked (409). Standard tier only.\n\nRequires the `compliance:sms:write` OAuth2 scope on the target setup.","operationId":"submit-a2p-messaging-profile","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__submit_a2p_messaging_profile__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupBundleResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Customer profile is not approved, bundle is in a non-rejected state (approved / in-review / pending-review), or the supplied attributes match the stored values (nothing to change)."},"422":{"description":"Twilio's pre-submission evaluation returned noncompliant for the supplied messaging-profile attributes."}}}},"/v1/twilio-setup/{setup_id}/bundle/regulatory":{"post":{"tags":["Twilio Setups"],"summary":"Submit Regulatory Bundle","description":"Create or resubmit a Regulatory Compliance bundle for a setup.\n\nfiles are positional against supporting_documents (5 MiB, JPEG/PNG/PDF). First\ncall creates; a rejected bundle resubmits on the same SID. Locked while\npending-review, in-review, or approved (409).\n\nRequires the `compliance:regulatory:write` OAuth2 scope on the target setup.","operationId":"submit-regulatory-bundle","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_submit-regulatory-bundle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioSetupBundleResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found, regulation_sid not found, or the regulation has no end_user or supporting_document requirements (no bundle to submit)."},"409":{"description":"Customer profile is not approved, or a bundle for this regulation_sid exists in a non-rejected state (pending-review / in-review / twilio-approved)."},"413":{"description":"A file exceeds 5 MiB."},"415":{"description":"A file's Content-Type is not JPEG/PNG/PDF."},"422":{"description":"Invalid end_users / supporting_documents JSON, file count mismatch, invalid `address` sub-shape, or Twilio's pre-submission evaluation returned noncompliant."}}}},"/v1/twilio-setup/{setup_id}/bundle/a2p-brand-registration":{"post":{"tags":["Twilio Setups"],"summary":"Submit A2P Brand Registration","description":"Create or resubmit a setup's A2P 10DLC brand registration.\n\nFirst call creates; a call against an unverified brand resubmits (Twilio caps\nresubmits at 3). Needs an approved customer profile and an A2P Messaging Profile\nbundle. 409 in any other brand state.\n\nRequires the `compliance:sms:write` OAuth2 scope on the target setup.","operationId":"submit-a2p-brand-registration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__submit_a2p_brand_registration__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2PBrandRegistrationResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Customer profile not approved, A2P Messaging Profile bundle missing, or existing brand row is in a non-resubmittable state."},"422":{"description":"Tier mismatch (LVS for non-profit / government), brand_type change attempted on resubmit, resubmit limit exceeded, or Twilio rejected the create / update with an actionable 400."}}},"get":{"tags":["Twilio Setups"],"summary":"Get A2P Brand Registration","description":"Read a setup's A2P 10DLC brand registration state. 404 if none.\n\nA verified brand with a live SMS use case also returns the allowed campaign\nuse-case codes from Twilio.\n\nRequires the `compliance:sms:read` OAuth2 scope on the target setup.","operationId":"get-a2p-brand-registration","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2PBrandRegistrationResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup or A2P brand registration not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/bundle":{"get":{"tags":["Twilio Setups"],"summary":"List Twilio Setup Bundles","description":"List a setup's Trust Hub and regulatory bundles.\n\nFilter by policy_sid, or by (iso_country, number_type); the two are mutually\nexclusive and iso_country/number_type are both-or-neither.\n\nRequires ≥1 of compliance:{voice,sms,regulatory}:read on the setup — holding none\nis a 403 (before any load, so it can't probe setup existence); classes you lack the\nscope for are filtered from the response, not 403'd.","operationId":"list-twilio-setup-bundles","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"policy_sid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":64},{"type":"null"}],"title":"Policy Sid"}},{"name":"iso_country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\w{2}$"},{"type":"null"}],"title":"Iso Country"}},{"name":"number_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TwilioNumberType"},{"type":"null"}],"title":"Number Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__list_twilio_setup_bundles__Response"}}}},"404":{"description":"Twilio setup not found."},"422":{"description":"Mutually exclusive query params (policy_sid alongside iso_country/number_type) or only one of (iso_country, number_type) supplied."}}}},"/v1/twilio-setup/{setup_id}/phone-number/available":{"get":{"tags":["Twilio Setups"],"summary":"List Available Phone Numbers","description":"Search Twilio for purchasable phone numbers of a country and type.\n\nResults are narrowed to numbers the setup can actually provision given its\naddress. area_code applies only to local numbers (422 otherwise).\n\nRequires the `twilio-phone-number:read` OAuth2 scope on the target setup.","operationId":"list-available-phone-numbers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"country","in":"query","required":true,"schema":{"type":"string","description":"ISO 3166-1 alpha-2 country code.","pattern":"^\\w{2}$","title":"Country"},"description":"ISO 3166-1 alpha-2 country code."},{"name":"number_type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/TwilioNumberType","description":"Phone number type: local, mobile, toll-free, or national."},"description":"Phone number type: local, mobile, toll-free, or national."},{"name":"area_code","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Area code filter. Only valid when number_type='local' (NANP concept).","title":"Area Code"},"description":"Area code filter. Only valid when number_type='local' (NANP concept)."},{"name":"capabilities","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TwilioPhoneNumberCapability"}},{"type":"null"}],"description":"Required capabilities; repeat query param for multiple values","title":"Capabilities"},"description":"Required capabilities; repeat query param for multiple values"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"description":"Maximum results to return","default":10,"title":"Limit"},"description":"Maximum results to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__list_available_phone_numbers__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Customer profile is not approved."},"422":{"description":"Query parameter failed validation (e.g. area_code on a non-local number_type)."}}}},"/v1/twilio-setup/{setup_id}/phone-number":{"post":{"tags":["Twilio Setups"],"summary":"Provision Phone Number","description":"Purchase a phone number, attach its required compliance bundles, and persist it.\n\n409 unless every required bundle is approved on the setup. 422 on an\naddress-requirement mismatch between the number and the setup.\n\nRequires the `twilio-phone-number:write` OAuth2 scope on the target setup.","operationId":"provision-phone-number","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__provision_phone_number__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioPhoneNumberResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"409":{"description":"Phone number is already owned, the customer profile is not approved, or required Trust Hub / regulatory bundles are missing or unapproved."},"422":{"description":"Body country / number_type does not match the setup, or the chosen number's address requirements do not match the setup."}}},"get":{"tags":["Twilio Setups"],"summary":"List Phone Numbers","description":"List a setup's provisioned phone numbers, optionally filtered by country or use case.\n\nPass use_case_id=\"unassigned\" for numbers with no assignment.\n\nRequires the `twilio-phone-number:read` OAuth2 scope on the target setup.","operationId":"list-phone-numbers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\w{2}$"},{"type":"null"}],"description":"Filter by ISO 3166-1 alpha-2 country code","title":"Country"},"description":"Filter by ISO 3166-1 alpha-2 country code"},{"name":"use_case_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"const":"unassigned","type":"string"},{"type":"null"}],"description":"Filter by top-level use case UUID, or the literal \"unassigned\" for numbers with no assignments.","title":"Use Case Id"},"description":"Filter by top-level use case UUID, or the literal \"unassigned\" for numbers with no assignments."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__twilio__list_phone_numbers__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}":{"delete":{"tags":["Twilio Setups"],"summary":"Delete Phone Number","description":"Release a phone number and detach its bundles.\n\n409 while a toll-free verification is mid-review (Twilio rejects the delete).\n\nRequires the `twilio-phone-number:write` OAuth2 scope on the target setup.","operationId":"delete-phone-number","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup or phone number not found under the setup."},"409":{"description":"Phone number still has use-case assignments; unassign them first."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification":{"post":{"tags":["Twilio Setups"],"summary":"Submit Tollfree Verification","description":"Create or resubmit the toll-free verification for a US/CA toll-free number.\n\nopt_in_proof_files (1-10, JPEG/PNG, ≤5 MiB) are hosted by us and served back to\nTwilio. Only a TWILIO_REJECTED verification can resubmit; any in-flight state → 409.\n\nRequires the `compliance:sms:write` OAuth2 scope on the target setup.","operationId":"submit-tollfree-verification","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_submit-tollfree-verification"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TollfreeVerificationResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup or phone number not found."},"409":{"description":"Verification is in a non-rejected state (pending-review / in-review / twilio-approved)."},"413":{"description":"An opt-in proof file exceeds 5 MiB."},"415":{"description":"An opt-in proof file's Content-Type is not JPEG/PNG."},"422":{"description":"Phone number is not US or CA toll-free, or invalid form input."}}},"get":{"tags":["Twilio Setups"],"summary":"Get Tollfree Verification","description":"Read a phone number's toll-free verification state. 404 if none.\n\nRequires the `compliance:sms:read` OAuth2 scope on the target setup.","operationId":"get-tollfree-verification","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TollfreeVerificationResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup, phone number, or verification not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification/opt-in-proof/{filename}":{"get":{"tags":["Twilio Setups"],"summary":"Get Tollfree Opt In Proof","description":"Stream an uploaded opt-in proof image. Unauthenticated — Twilio's TFV reviewer fetches it.\n\nStreams the bytes directly rather than redirecting, so the URL stays valid across\na multi-day review window. 404 for any key the verification didn't write.","operationId":"get-tollfree-opt-in-proof","parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"The opt-in proof image bytes, streamed from S3 with stored Content-Type.","content":{"application/json":{"schema":{}},"image/jpeg":{},"image/png":{}}},"404":{"description":"Setup or phone number not found, or no opt-in proof with this filename exists."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id}":{"put":{"tags":["Twilio Setups"],"summary":"Assign Phone Number","description":"Assign a phone number to a use case (idempotent).\n\nInbound-voice assignment rewrites the number's voice_url. SMS assignment adds the\nnumber to the Messaging Service pool, gated by TFV approval (US/CA toll-free) or a\nverified A2P campaign (US long-code).\n\nRequires the `twilio-phone-number:write` OAuth2 scope on the target setup.","operationId":"assign-phone-number","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Setup, phone number, or use case not found; or use case has no Twilio binding bound to this setup."},"409":{"description":"Phone number is already assigned to another use case on this channel, or required Trust Hub bundles are missing."},"422":{"description":"Use case channel is not Twilio-served, or input failed validation."}}},"delete":{"tags":["Twilio Setups"],"summary":"Unassign Phone Number","description":"Unassign a phone number from a use case.\n\nInbound-voice unassignment clears the number's voice_url. SMS unassignment detaches\nit from the Messaging Service pool.\n\nRequires the `twilio-phone-number:write` OAuth2 scope on the target setup.","operationId":"unassign-phone-number","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Setup, phone number, use case, or assignment not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ses-setup":{"post":{"tags":["SES Setups"],"summary":"Create Ses Setup","description":"Create a SES setup: tenant, domain identity, and custom MAIL FROM.\n\nThe customer publishes the returned DNS records, then refreshes verification via\nGET. 409 on a domain that already has a setup.\n\nRequires the `ses-setup:create` OAuth2 scope (resource-less — satisfied only by a first-party `\"*\"` setup grant).","operationId":"create-ses-setup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__ses_setup__create_ses_setup__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SesSetupDetailResponse"}}}},"409":{"description":"SES tenant or email identity with this name already exists."},"422":{"description":"Request body failed validation (tenant_name pattern, or domain_identity is not a valid domain name)."}},"security":[{"HTTPBearer":[]}]}},"/v1/ses-setup/{setup_id}":{"get":{"tags":["SES Setups"],"summary":"Get Ses Setup","description":"Fetch a SES setup with a live DNS refresh that self-heals a FAILED DKIM / MAIL FROM\naxis (see module docstring). Tombstoned setups return cached state.\n\nRequires the `ses-setup:read` OAuth2 scope on the target setup.","operationId":"get-ses-setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SesSetupDetailResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"SES setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["SES Setups"],"summary":"Delete Ses Setup","description":"Soft-delete a SES setup and tear down its AWS identity and tenant.\n\n409 while any live use case still references it; delete those first.\n\nRequires the `ses-setup:write` OAuth2 scope on the target setup.","operationId":"delete-ses-setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"SES setup not found (already deleted, or never existed)."},"409":{"description":"Live use cases still reference this setup; delete them first."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/use-case":{"post":{"tags":["Use Cases"],"summary":"Create Use Case","description":"Create a use case on a setup; the channel selects the body variant.\n\nMints the channel's backing resource: a Messaging Service for SMS, a SES\nconfiguration set for email. Voice needs none — channel-manager renders the\nmedia leg from the setup's shared TwiML App. Email requires a DNS-verified\nSES setup. Requires the `use-case:write` OAuth2 scope on the target setup.","operationId":"create-use-case","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Twilio setup, SES setup, or SendBlue setup not found."},"409":{"description":"Customer profile not approved, SES setup DNS not verified, or (entity_name, name) / configuration set name / sender address already in use."},"422":{"description":"Request body failed validation (e.g. sender domain does not match the SES setup's domain identity, or marketing email_type without unsubscribable=true)."}}},"get":{"tags":["Use Cases"],"summary":"List Use Cases","description":"List a setup's use cases, optionally filtered by entity, channel, or deletion state.\n\nRequires the `use-case:read` OAuth2 scope on the setup given by the `setup_id` query parameter.","operationId":"list-use-cases","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","description":"Filter to use cases bound to this setup.","title":"Setup Id"},"description":"Filter to use cases bound to this setup."},{"name":"entity_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"description":"Filter to use cases belonging to this entity.","title":"Entity Name"},"description":"Filter to use cases belonging to this entity."},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Channel"},{"type":"null"}],"description":"Filter by channel.","title":"Channel"},"description":"Filter by channel."},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include soft-deleted use cases (audit trail). Defaults to live only.","default":false,"title":"Include Deleted"},"description":"Include soft-deleted use cases (audit trail). Defaults to live only."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__list_use_cases__Response"}}}},"422":{"description":"Query parameter failed validation."}}}},"/v1/use-case/{use_case_id}":{"get":{"tags":["Use Cases"],"summary":"Get Use Case","description":"Fetch one use case with its channel binding. Tombstoned rows return 404.\n\nRequires the `use-case:read` OAuth2 scope on the target setup.","operationId":"get-use-case","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UseCaseResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"Use case not found (or soft-deleted)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Use Cases"],"summary":"Update Use Case","description":"Patch a use case; restate the immutable channel to select the body variant.\n\nA body channel that disagrees with the stored row is a 409. Supplying inbound_voice_url\non a voice use case creates, updates, or clears the Twilio TwiML App; webhook_url\nopts it into CM orchestration and returns the signing secret once.\n\nRequires the `use-case:write` OAuth2 scope on the target setup.","operationId":"update-use-case","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"Use case not found (or soft-deleted)."},"409":{"description":"Body `channel` does not match the use case's immutable channel."},"422":{"description":"Request body failed validation (no updatable field besides `channel`, description too long, invalid webhook_url, or sender_email_alias out of range)."}}},"delete":{"tags":["Use Cases"],"summary":"Delete Use Case","description":"Soft-delete a use case and its channel binding, tearing down the backing vendor resource.\n\n409 while phone numbers or lines are still assigned (unassign first), or while\nemail templates still exist.\n\nRequires the `use-case:write` OAuth2 scope on the target setup.","operationId":"delete-use-case","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"Use case not found (already deleted, or never existed)."},"409":{"description":"Twilio-served or iMessage use case still has phone numbers assigned. Unassign them before deleting."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/use-case/{use_case_id}/webhook-secret":{"post":{"tags":["Use Cases"],"summary":"Rotate Webhook Secret","description":"Rotate a messaging use case's inbound-turn HMAC signing secret.\n\nReturns the new secret once plus the cutoff after which the old secret stops\nverifying (30-minute dual-sign grace). 400 for voice use cases, which have none.\n\nRequires the `use-case:write` OAuth2 scope on the target setup.","operationId":"rotate-use-case-webhook-secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__rotate_webhook_secret__Response"}}}},"400":{"description":"Use case is a voice channel (no webhook secret)."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"Use case not found (or soft-deleted)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/use-case/{use_case_id}/a2p-campaign":{"post":{"tags":["Use Cases"],"summary":"Submit A2P Campaign","description":"Create the A2P 10DLC campaign that gates long-code SMS for an SMS use case.\n\nNeeds a verified brand registration on the setup. 409 if a campaign already\nexists. 422 if the requested use-case code isn't allowed for the brand.\n\nRequires the `compliance:sms:write` OAuth2 scope on the target setup.","operationId":"submit-a2p-campaign","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__submit_a2p_campaign__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2PCampaignResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"SMS use case not found."},"409":{"description":"A2P Messaging Profile bundle missing or not approved, brand registration missing or not in a vetted state, or a campaign already exists for this SMS use case."},"422":{"description":"us_app_to_person_usecase not in the brand's allowed set, missing CTIA-required STOP/HELP keywords, or Twilio rejected the create with an actionable 400."}}},"get":{"tags":["Use Cases"],"summary":"Get A2P Campaign","description":"Read an SMS use case's A2P 10DLC campaign state. 404 if none.\n\nRequires the `compliance:sms:read` OAuth2 scope on the target setup.","operationId":"get-a2p-campaign","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2PCampaignResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"A2P campaign not found for this SMS use case."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Use Cases"],"summary":"Update A2P Campaign","description":"Update an A2P 10DLC campaign's content, and resubmit it when it failed.\n\n409 while in-progress or suspended. On a verified campaign the four compliance\nbooleans must match the current row, else 422. A failed campaign resubmits unless\nits errors are non-remediable.\n\nRequires the `compliance:sms:write` OAuth2 scope on the target setup.","operationId":"update-a2p-campaign","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__use_case__update_a2p_campaign__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2PCampaignResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"A2P campaign not found for this SMS use case."},"409":{"description":"Campaign is IN_PROGRESS or SUSPENDED — not updatable in the current state."},"422":{"description":"Caller tried to change a boolean on a VERIFIED campaign, or the row's errors contain a non-remediable code."}}},"delete":{"tags":["Use Cases"],"summary":"Delete A2P Campaign","description":"Tear down an SMS use case's A2P 10DLC campaign.\n\n409 while the campaign is mid-review; re-run once Twilio settles.\n\nRequires the `compliance:sms:write` OAuth2 scope on the target setup.","operationId":"delete-a2p-campaign","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Campaign deleted."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"A2P campaign not found for this SMS use case."},"409":{"description":"Campaign is IN_PROGRESS and cannot be deleted."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/outbound-voice/phone-number/select":{"post":{"tags":["Outbound Voice"],"summary":"Select Phone Number","description":"Pick a random From number from an outbound-voice use case's pool.\n\nRequires the `outbound-voice:send` OAuth2 scope on the target setup.","operationId":"select-outbound-voice-phone-number","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__outbound_voice__select_outbound_voice_phone_number__Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioPhoneNumberResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks outbound-voice:send scope / access to this setup."},"404":{"description":"Use case not found (or not bound to outbound_voice), or has no assigned phone numbers."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/voice-call/":{"post":{"tags":["Voice Calls"],"summary":"Create Voice Call","description":"Create a call resource and select its From number. `voice:call` on the setup.","operationId":"create-voice-call","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__create_voice_call__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__create_voice_call__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Use case not found (or not outbound_voice), or has no assigned phone numbers."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Voice Calls"],"summary":"List Voice Calls","description":"List calls under `setup_id`, newest first. `voice:read` on the setup.","operationId":"list-voice-calls","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"use_case_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/VoiceCallDirection"},{"type":"null"}],"title":"Direction"}},{"name":"peer_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"phone"},{"type":"null"}],"title":"Peer Number"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes left-to-right; `+field` asc, `-field` desc. Default `-created_at`.","default":[],"title":"Sort By"},"description":"Sort axes left-to-right; `+field` asc, `-field` desc. Default `-created_at`."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque cursor from a prior response; round-trip it, don't construct it.","title":"Continuation Token"},"description":"Opaque cursor from a prior response; round-trip it, don't construct it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__list_voice_calls__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:read scope / access to this setup."},"422":{"description":"Malformed sort_by, or unparseable continuation_token."}}}},"/v1/voice-call/{call_ref}":{"get":{"tags":["Voice Calls"],"summary":"Get Voice Call","description":"Return one call and its participants. `voice:read` on the call's setup.","operationId":"get-voice-call","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__get_voice_call__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:read scope / access to this setup."},"404":{"description":"Call not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Voice Calls"],"summary":"Delete Voice Call","description":"End the call's conference and stamp ended_at. `voice:call` on the setup.","operationId":"delete-voice-call","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Call not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voice-call/{call_ref}/participant":{"post":{"tags":["Voice Calls"],"summary":"Add Voice Call Participant","description":"Dial or media-stream a leg into the call's conference. `voice:call` on the setup.","operationId":"add-voice-call-participant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/MediaParticipant"},{"$ref":"#/components/schemas/DialParticipant"}],"discriminator":{"propertyName":"kind","mapping":{"media":"#/components/schemas/MediaParticipant","dial":"#/components/schemas/DialParticipant"}},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__add_voice_call_participant__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Call not found."},"409":{"description":"Call has already ended."},"422":{"description":"Twilio rejected the dial target, or an operator / transfer_target leg targets a number not in the use case's allowed_forwarding_numbers."}}}},"/v1/voice-call/{call_ref}/participant/{participant_ref}":{"put":{"tags":["Voice Calls"],"summary":"Update Voice Call Participant","description":"Update a participant's hold / muted / ends_call_on_exit. `voice:call` on the setup.","operationId":"update-voice-call-participant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}},{"name":"participant_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Participant Ref"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__update_voice_call_participant__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Call or participant not found."},"409":{"description":"Participant is not (or no longer) in the conference."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Voice Calls"],"summary":"Delete Voice Call Participant","description":"Remove a participant from the conference. `voice:call` on the setup.","operationId":"delete-voice-call-participant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}},{"name":"participant_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Participant Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Call or participant not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voice-call/{call_ref}/participant/{participant_ref}/redirect":{"post":{"tags":["Voice Calls"],"summary":"Redirect Voice Call Participant","description":"Redirect a leg to a dial or a farewell-and-hangup. `voice:call` on the setup.","operationId":"redirect-voice-call-participant","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}},{"name":"participant_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Participant Ref"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/DialRedirect"},{"$ref":"#/components/schemas/FarewellRedirect"}],"discriminator":{"propertyName":"kind","mapping":{"dial":"#/components/schemas/DialRedirect","farewell":"#/components/schemas/FarewellRedirect"}},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Call or participant not found."},"409":{"description":"Participant is not (or no longer) connected."},"422":{"description":"Dial redirect target is not in the use case's allowed_forwarding_numbers."}}}},"/v1/voice-call/{call_ref}/participant/{participant_ref}/media-stream":{"post":{"tags":["Voice Calls"],"summary":"Start Participant Media Stream","description":"Fork a participant's inbound audio to a wss:// URL. `voice:call` on the setup.","operationId":"start-participant-media-stream","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Ref"}},{"name":"participant_ref","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Participant Ref"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__voice__start_participant_media_stream__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks voice:call scope / access to this setup."},"404":{"description":"Call or participant not found."},"409":{"description":"Participant not yet joined, already left, or a stream is already running."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/":{"post":{"tags":["Emails"],"summary":"Send Email","description":"Send one email through SES, from an inline HTML body or a stored template.\n\nraw_html mode needs subject and body_html; template mode needs template_id and\ntemplate_parameters covering every declared variable. Unsubscribe links are\ninjected by the send path, never the caller. The use case's setup must be\nDNS-verified.\n\nRequires the `email:send` OAuth2 scope on the target setup.","operationId":"send-email","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_send-email"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__send_email__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"Use case not found, or has no live SES binding."},"409":{"description":"Recipient is on the per-use-case or per-setup unsubscribe list."},"413":{"description":"Body or any attachment exceeds the size limit (5 MiB per attachment)."},"422":{"description":"Body or attachment failed validation: invalid HTML template, invalid filename, empty attachment, more than 5 attachments, SES rejected the message, or reply_to_inbound_email_id does not reference an inbound email under the same use case + setup."}},"security":[{"HTTPBearer":[]}]}},"/v1/email/event":{"get":{"tags":["Emails"],"summary":"List email events","description":"List SES events matching the request filters. At least one of `use_case_id` or `setup_id` is required so the underlying `emails` join lands on a leading index. Other filters (`email_id`, `event_type`, `event_at_after`, `event_at_before`) narrow within that scope. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed field: event_at). Default: `-event_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`.","operationId":"list-email-events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to events for emails sent through this use case.","title":"Use Case Id"},"description":"Filter to events for emails sent through this use case."},{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","description":"Filter to events for emails sent from this SES setup.","title":"Setup Id"},"description":"Filter to events for emails sent from this SES setup."},{"name":"email_id","in":"query","required":false,"schema":{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"description":"Narrow to one or more emails' event timelines (set semantics: any match).","default":[],"title":"Email Id"},"description":"Narrow to one or more emails' event timelines (set semantics: any match)."},{"name":"event_type","in":"query","required":false,"schema":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/EventType"},"description":"Filter to one or more SES event types (set semantics: any match).","default":[],"title":"Event Type"},"description":"Filter to one or more SES event types (set semantics: any match)."},{"name":"event_at_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound on event_at.","title":"Event At After"},"description":"Inclusive lower bound on event_at."},{"name":"event_at_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound on event_at.","title":"Event At Before"},"description":"Exclusive upper bound on event_at."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes applied left-to-right; `+field`/`-field`. Default `-event_at` (newest first).","default":[],"title":"Sort By"},"description":"Sort axes applied left-to-right; `+field`/`-field`. Default `-event_at` (newest first)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"The maximum number of events to return.","default":50,"title":"Limit"},"description":"The maximum number of events to return."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque continuation token from a prior response; treat as a black box.","title":"Continuation Token"},"description":"Opaque continuation token from a prior response; treat as a black box."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__list_email_events__Response"}}}},"422":{"description":"Query parameter failed validation, neither use_case_id nor setup_id was supplied, or continuation_token is unparseable."}}}},"/v1/email/unsubscribe/{token}":{"get":{"tags":["Emails"],"summary":"Get Email Unsubscribe Form","description":"Render the unsubscribe confirmation page.\n\nVerifies the token but writes nothing — the form POSTs back to record the\nunsubscribe, so a scanner pre-fetching the link can't opt anyone out. 403 on a\nforged token.","operationId":"get-email-unsubscribe-form","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Confirmation form (HTML). GET never mutates.","content":{"application/json":{"schema":{}}}},"403":{"description":"Token failed parse or HMAC verification."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Emails"],"summary":"Confirm Email Unsubscribe","description":"Record an unsubscribe from the RFC 8058 one-click handshake or the confirmation form.\n\nIdempotent: repeat clicks collapse to one row. A tombstoned target is a silent\nsuccess page, not an error. Returns 403 on a forged token before any lookup.","operationId":"confirm-email-unsubscribe","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Unsubscribe recorded (or silently skipped for tombstoned target).","content":{"application/json":{"schema":{}}}},"403":{"description":"Token failed parse or HMAC verification."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/template":{"post":{"tags":["Emails"],"summary":"Create Email Template","description":"Create a reusable subject/body Jinja template owned by a SES use case.\n\nRequires the `email:template:write` OAuth2 scope on the target setup.","operationId":"create-email-template","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__create_email_template__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__create_email_template__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"SES use case not found, or soft-deleted."},"409":{"description":"Template name already exists within the SES use case."},"422":{"description":"Subject or body template failed validation: Jinja syntax error, subject references unsubscribe variables, or body's unsubscribe-variable usage does not match the use case's unsubscribable flag."}}},"get":{"tags":["Emails"],"summary":"List Email Templates","description":"List a SES use case's email templates, summary fields only.\n\nRequires the `email:template:read` OAuth2 scope on the target setup.","operationId":"list-email-templates","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ses_use_case_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Ses Use Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__list_email_templates__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"SES use case not found, or soft-deleted."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/template/{email_template_id}":{"get":{"tags":["Emails"],"summary":"Get Email Template","description":"Fetch one email template, including its declared subject and body variables.\n\nRequires the `email:template:read` OAuth2 scope on the target setup.","operationId":"get-email-template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__get_email_template__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Email template not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Emails"],"summary":"Update Email Template","description":"Patch an email template's name, description, or subject/body.\n\nRequires the `email:template:write` OAuth2 scope on the target setup.","operationId":"update-email-template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__update_email_template__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__update_email_template__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Email template not found."},"409":{"description":"New template name already exists within the SES use case."},"422":{"description":"No fields provided, or subject/body template failed validation: Jinja syntax error, subject references unsubscribe variables, or body's unsubscribe-variable usage does not match the use case's unsubscribable flag."}}},"delete":{"tags":["Emails"],"summary":"Delete Email Template","description":"Hard-delete an email template.\n\nRequires the `email:template:write` OAuth2 scope on the target setup.","operationId":"delete-email-template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Template Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Email template not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email":{"get":{"tags":["Emails"],"summary":"List emails","description":"List emails matching the request filters. At least one of `use_case_id` or `setup_id` is required so the query stays on a leading index. Other filters (`to_address`, `created_after`, `created_before`, `state`) narrow within that scope. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed field: created_at). Default: `-created_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`.","operationId":"list-emails","security":[{"HTTPBearer":[]}],"parameters":[{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"enum":["inbound","outbound"],"type":"string"},{"type":"null"}],"title":"Direction"}},{"name":"use_case_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to this email use case. At least one of use_case_id or setup_id is required.","title":"Use Case Id"},"description":"Filter to this email use case. At least one of use_case_id or setup_id is required."},{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","description":"Filter to emails sent from this SES setup. At least one of use_case_id or setup_id is required.","title":"Setup Id"},"description":"Filter to emails sent from this SES setup. At least one of use_case_id or setup_id is required."},{"name":"peer_address","in":"query","required":false,"schema":{"type":"array","uniqueItems":true,"items":{"type":"string","format":"email"},"description":"Filter to emails delivered to one or more recipient addresses (set\nsemantics: any match).","default":[],"title":"Peer Address"},"description":"Filter to emails delivered to one or more recipient addresses (set\nsemantics: any match)."},{"name":"in_reply_to_email_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to emails that are replies to this specific outbound/inbound.","title":"In Reply To Email Id"},"description":"Filter to emails that are replies to this specific outbound/inbound."},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound on created_at.","title":"Created After"},"description":"Inclusive lower bound on created_at."},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound on created_at.","title":"Created Before"},"description":"Exclusive upper bound on created_at."},{"name":"state","in":"query","required":false,"schema":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/State"},"description":"Filter to one or more derived states (set semantics: any match).","default":[],"title":"State"},"description":"Filter to one or more derived states (set semantics: any match)."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"created_at\", -1)]`` (newest first).","default":[],"title":"Sort By"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"created_at\", -1)]`` (newest first)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"The maximum number of emails to return.","default":50,"title":"Limit"},"description":"The maximum number of emails to return."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it.","title":"Continuation Token"},"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__list_emails__Response"}}}},"422":{"description":"Query parameter failed validation, neither use_case_id nor setup_id was supplied, or continuation_token is unparseable."}}}},"/v1/email/{email_id}":{"get":{"tags":["Emails"],"summary":"Get Email","description":"Fetch one email by id, inbound or outbound.\n\nRequires the `email:read` OAuth2 scope on the target setup.","operationId":"get-email","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__email__get_email__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Email not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/{email_id}/body":{"get":{"tags":["Emails"],"summary":"Get Email Body","description":"Stream one email's body from S3, inbound or outbound.\n\nContent-Type follows the stored body kind (HTML or plain text).\n\nRequires the `email:read` OAuth2 scope on the target setup.","operationId":"get-email-body","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Email not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/{email_id}/attachment/{filename}":{"get":{"tags":["Emails"],"summary":"Get Email Attachment","description":"Redirect to a presigned URL for one email attachment.\n\nThe filename must be listed on the row, so a caller can't sign a URL for an\narbitrary key under the email's S3 prefix. 404 if the email or filename is unknown.\n\nRequires the `email:read` OAuth2 scope on the target setup.","operationId":"get-email-attachment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to a short-lived S3 presigned URL for the attachment."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Email not found, or attachment with this filename does not exist on the email."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/{email_id}/raw":{"get":{"tags":["Emails"],"summary":"Get Email Raw","description":"Redirect to a presigned URL for the original MIME bundle.\n\nInbound only: outbound sends keep no raw bundle, so an outbound or unknown id is a 404.\n\nRequires the `email:read` OAuth2 scope on the target setup.","operationId":"get-email-raw","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to a short-lived S3 presigned URL for the raw MIME bundle."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"No inbound email with this id (outbound emails retain no raw bundle)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sendblue-setup":{"post":{"tags":["SendBlue Setups"],"summary":"Create Sendblue Setup","description":"Create a SendBlue subaccount with one synchronously-assigned line and register webhooks.\n\n503 when SendBlue has no area-code inventory: it would leak an unusable subaccount\nthat has no teardown API.\n\nRequires the `sendblue-setup:create` OAuth2 scope (resource-less — satisfied only by a first-party `\"*\"` setup grant).","operationId":"create-sendblue-setup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sendblue__create_sendblue_setup__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBlueSetupResponse"}}}},"503":{"description":"SendBlue has no available line inventory to assign; retry later."},"500":{"description":"SendBlue parent-account auth failed, SendBlue upstream error, or AWS Secrets Manager failure."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/sendblue-setup/{setup_id}":{"get":{"tags":["SendBlue Setups"],"summary":"Get Sendblue Setup","description":"Fetch one SendBlue setup with its sendable (unblocked) lines.\n\nRequires the `sendblue-setup:read` OAuth2 scope on the target setup.","operationId":"get-sendblue-setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBlueSetupResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"SendBlue setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sendblue-setup/{setup_id}/phone-number":{"get":{"tags":["SendBlue Setups"],"summary":"List Sendblue Phone Numbers","description":"List every line under a SendBlue setup, including blocked lines (filterable by status).\n\nRequires the `sendblue-phone-number:read` OAuth2 scope on the setup given by the `setup_id` query parameter.","operationId":"list-sendblue-phone-numbers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"array","uniqueItems":true,"items":{"enum":["assigned","blocked"],"type":"string"},"description":"Repeat to include multiple statuses. Defaults to both.","default":["assigned","blocked"],"title":"Status"},"description":"Repeat to include multiple statuses. Defaults to both."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sendblue__list_phone_numbers__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"SendBlue setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sendblue-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id}":{"put":{"tags":["SendBlue Setups"],"summary":"Assign Phone Number","description":"Assign a SendBlue line to an iMessage use case.\n\nA line serves at most one use case. 404 if the use case has no SendBlue binding\nor belongs to a different setup.\n\nRequires the `sendblue-phone-number:write` OAuth2 scope on the target setup.","operationId":"assign-sendblue-phone-number","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Setup, phone number, or iMessage use case not found."},"409":{"description":"Phone number is blocked, or already assigned to this use case."},"422":{"description":"Phone number or binding belongs to a different SendBlue setup."}}},"delete":{"tags":["SendBlue Setups"],"summary":"Unassign Phone Number","description":"Unassign a SendBlue line from an iMessage use case.\n\nRequires the `sendblue-phone-number:write` OAuth2 scope on the target setup.","operationId":"unassign-sendblue-phone-number","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Number Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"Setup, phone number, iMessage use case, or assignment not found."},"422":{"description":"Phone number or binding belongs to a different SendBlue setup."}}}},"/v1/whatsapp-setup":{"post":{"tags":["WhatsApp Setups"],"summary":"Create Whatsapp Setup","description":"Register a business identity and return its Hosted Embedded Signup URL.\n\nRequires the `whatsapp-setup:create` OAuth2 scope (action-only, resource `\"*\"` —\nno setup exists yet, so only a first-party `[\"*\"]` grant passes).","operationId":"create-whatsapp-setup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__whatsapp_setup__create_whatsapp_setup__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__whatsapp_setup__create_whatsapp_setup__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the whatsapp-setup:create scope."},"409":{"description":"A live WhatsApp setup already exists for this Meta business portfolio."},"422":{"description":"friendly_name or meta_business_portfolio_id failed validation."}},"security":[{"HTTPBearer":[]}]}},"/v1/whatsapp-setup/{setup_id}":{"get":{"tags":["WhatsApp Setups"],"summary":"Get Whatsapp Setup","description":"Fetch one WhatsApp setup.\n\nRequires the `whatsapp-setup:read` OAuth2 scope on the target setup; the check\nruns before the load so a 404 can't probe which setup ids exist.","operationId":"get-whatsapp-setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__whatsapp_setup__get_whatsapp_setup__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"WhatsApp setup not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["WhatsApp Setups"],"summary":"Delete Whatsapp Setup","description":"Tear down a WhatsApp setup: business token, app subscription, then the row.\n\nRequires the `whatsapp-setup:write` OAuth2 scope on the target setup.","operationId":"delete-whatsapp-setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"WhatsApp setup not found (already deleted, or never existed)."},"500":{"description":"AWS Secrets Manager failure, or Meta Graph returned 5xx on the unsubscribe."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/imessage/":{"post":{"tags":["iMessages"],"summary":"Send Imessage","description":"Send one iMessage from the use case's pool, sticky per contact.\n\nAt least one of content or media is required, one media file at most. 422 when\nthe pool is empty, a pre-reply limit applies, or SendBlue rejects the send.\n\nRequires the `imessage:send` OAuth2 scope on the target setup.","operationId":"send-imessage","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_send-imessage"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__imessage__messages__OutboundMessage"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"Use case not found, or has no live SendBlue binding."},"413":{"description":"media file exceeds the 20 MiB limit."},"422":{"description":"Body / media failed validation: empty content + no media, invalid filename, empty media file, no live SendBlue lines available, a SendBlue before-the-first-reply limit (message count, length, media, or a link / phone number / email address), or SendBlue rejected the send."}},"security":[{"HTTPBearer":[]}]}},"/v1/imessage":{"get":{"tags":["iMessages"],"summary":"List iMessages","description":"List inbound + outbound iMessages, interleaved chronologically. At least one of `use_case_id`, `peer_number`, or `our_number` is required so the query stays on a leading index per leg. Optional `direction=inbound|outbound` prunes one leg. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed field: occurred_at, the UNION-projected column that maps to `sent_at` on outbound and `received_at` on inbound). Default: `-occurred_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`.","operationId":"list-imessages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"use_case_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to one top-level use case.","title":"Use Case Id"},"description":"Filter to one top-level use case."},{"name":"peer_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"phone"},{"type":"null"}],"description":"E.164 peer; matches inbound `from_number` and outbound `to_number`.","title":"Peer Number"},"description":"E.164 peer; matches inbound `from_number` and outbound `to_number`."},{"name":"our_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"phone"},{"type":"null"}],"description":"E.164 line of ours; matches inbound `to_number` and outbound `from_number`.","title":"Our Number"},"description":"E.164 line of ours; matches inbound `to_number` and outbound `from_number`."},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"enum":["inbound","outbound"],"type":"string"},{"type":"null"}],"description":"Restrict to one direction. None returns both, interleaved.","title":"Direction"},"description":"Restrict to one direction. None returns both, interleaved."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes applied left-to-right; `+occurred_at` / `-occurred_at`. Default `-occurred_at`.","default":[],"title":"Sort By"},"description":"Sort axes applied left-to-right; `+occurred_at` / `-occurred_at`. Default `-occurred_at`."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"description":"Maximum number of rows to return per page.","default":50,"title":"Limit"},"description":"Maximum number of rows to return per page."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque continuation token from a prior response; the server decodes it.","title":"Continuation Token"},"description":"Opaque continuation token from a prior response; the server decodes it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__imessage__list_messages__Response"}}}},"422":{"description":"Query parameter failed validation, none of use_case_id / peer_number / our_number was supplied, or continuation_token is unparseable."}}}},"/v1/imessage/{message_id}/media":{"get":{"tags":["iMessages"],"summary":"Get Message Media","description":"Redirect to a presigned URL for an iMessage's media. 404 if the message carries none.\n\nRequires the `imessage:read` OAuth2 scope on the target setup.","operationId":"get-imessage-media","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to a short-lived (5-minute) S3 presigned URL for the media artifact."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"iMessage not found, or the row exists but carries no media artifact."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/imessage/{message_id}":{"get":{"tags":["iMessages"],"summary":"Get Message","description":"Fetch one iMessage by id, inbound or outbound.\n\nRequires the `imessage:read` OAuth2 scope on the target setup.","operationId":"get-imessage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"iMessage not found in either the inbound or outbound table."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/whatsapp/template":{"post":{"tags":["WhatsApp Messages"],"summary":"Create Whatsapp Message Template","description":"Create a new WhatsApp message template on the setup's WABA.\n\nRequires the `whatsapp:template:write` OAuth2 scope on the target setup.","operationId":"create-whatsapp-message-template","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/src__routes__whatsapp_message__create_whatsapp_message_template__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__whatsapp_message__create_whatsapp_message_template__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"WhatsApp setup not found, or soft-deleted."},"409":{"description":"A live template with this name and language already exists on the setup."},"422":{"description":"Request failed validation: header media missing, of an unsupported type, or oversized; header media supplied for a non-media header; or the header/body text placeholders do not match the declared parameter names."}},"security":[{"HTTPBearer":[]}]}},"/v1/whatsapp/":{"post":{"tags":["WhatsApp Messages"],"summary":"Send Whatsapp Message","description":"Send a WhatsApp message from a use case's number to a BSUID-addressed recipient.\n\nFree-form only (no templates): the recipient must have messaged this use case\nwithin 23 hours (one hour inside Meta's 24, so an accepted send can't die at the\nwindow edge). Requires the `whatsapp:send` OAuth2 scope on the target setup.","operationId":"send-whatsapp-message","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TextMessageRequest"},{"$ref":"#/components/schemas/ImageMessageRequest"},{"$ref":"#/components/schemas/VideoMessageRequest"},{"$ref":"#/components/schemas/AudioMessageRequest"},{"$ref":"#/components/schemas/DocumentMessageRequest"},{"$ref":"#/components/schemas/StickerMessageRequest"},{"$ref":"#/components/schemas/ReactionMessageRequest"}],"title":"Request","discriminator":{"propertyName":"message_type","mapping":{"text":"#/components/schemas/TextMessageRequest","image":"#/components/schemas/ImageMessageRequest","video":"#/components/schemas/VideoMessageRequest","audio":"#/components/schemas/AudioMessageRequest","document":"#/components/schemas/DocumentMessageRequest","sticker":"#/components/schemas/StickerMessageRequest","reaction":"#/components/schemas/ReactionMessageRequest"}}}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__whatsapp_message__send_whatsapp_message__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"WhatsApp use case not found, or target message not found for this recipient."},"422":{"description":"Request failed validation, or the send was rejected: no inbound message from this recipient in the last 23 hours, Meta refused the media upload, the recipient cannot receive the message, Meta rejected a parameter, or a reaction removal targeted a message with no reaction."}},"security":[{"HTTPBearer":[]}]}},"/v1/sms/":{"post":{"tags":["SMS"],"summary":"Send Sms Message","description":"Send an SMS or MMS from one of the use case's numbers.\n\nA2P and toll-free senders only reach recipients who've opted in, and never\nanyone who's opted out.\n\nRequires the `sms:send` OAuth2 scope on the target setup.","operationId":"send-sms-message","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_send-sms-message"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sms__send_sms_message__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"SMS use case not found."},"422":{"description":"Request rejected: no phone number assigned, no verified A2P campaign for a US long-code sender pool, no recorded opt-in for a US/CA toll-free or US long-code sender pool, message content does not match the registered use case, invalid recipient, recipient opted out, destination region not permitted, or A2P brand suspended."}},"security":[{"HTTPBearer":[]}]}},"/v1/sms/opt-in":{"post":{"tags":["SMS"],"summary":"Send Sms Opt In Message","description":"Send the registered consent message and record the recipient's opt-in.\n\nCopy and sending line come from the use case's verified A2P campaign or approved\ntoll-free verification; 422 if neither backs it. Idempotent per recipient. 409\nwhen the recipient has a live opt-out — an opt-in can't reverse a STOP.\n\nRequires the `sms:consent:write` OAuth2 scope on the target setup.","operationId":"send-sms-opt-in-message","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sms__send_sms_opt_in_message__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this use case."},"404":{"description":"SMS use case not found."},"409":{"description":"The recipient has a live setup-wide opt-out (a prior STOP); an opt-in cannot reverse it."},"422":{"description":"Neither a verified A2P campaign nor an approved US/CA toll-free verification backs the SMS use case, or Twilio rejected the destination (invalid / landline / opted out / region not permitted / brand suspended)."}},"security":[{"HTTPBearer":[]}]}},"/v1/sms/remove-setup-opt-out":{"post":{"tags":["SMS"],"summary":"Remove Sms Setup Opt Out","description":"Operator-clear a setup-wide SMS opt-out, recording the reason for audit.\n\nThe only way to re-enable sending after a STOP. 409 while a live toll-free\nopt-out for the recipient remains: route them through START/UNSTOP first.\n\nRequires the `sms:consent:write` OAuth2 scope on the target setup.","operationId":"remove-sms-setup-opt-out","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sms__remove_sms_setup_opt_out__Request"}}},"required":true},"responses":{"204":{"description":"Opt-out cleared; the recipient can be sent to again on this setup."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"No live setup-wide opt-out exists for this setup and phone number."},"409":{"description":"A live toll-free opt-out exists for this recipient under the setup; clear it via a recipient-initiated START/UNSTOP first."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/sms/opt-out":{"get":{"tags":["SMS"],"summary":"List SMS setup opt-outs","description":"List setup-wide SMS opt-outs (STOP records) for the setup given by the required `setup_id` query parameter. Live rows only by default; pass `include_deleted=true` for the cleared/audit history. Optional `user_phone_number` exact-match filter. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed field: created_at). Default: `-created_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`.","operationId":"list-sms-setup-opt-outs","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"user_phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"phone"},{"type":"null"}],"description":"Optional exact-match filter — the opted-out recipient's E.164 number.","title":"User Phone Number"},"description":"Optional exact-match filter — the opted-out recipient's E.164 number."},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include cleared (soft-deleted) opt-outs. Default False → live rows only.","default":false,"title":"Include Deleted"},"description":"Include cleared (soft-deleted) opt-outs. Default False → live rows only."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"created_at\", -1)]`` (newest first).","default":[],"title":"Sort By"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"created_at\", -1)]`` (newest first)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"The maximum number of opt-outs to return.","default":50,"title":"Limit"},"description":"The maximum number of opt-outs to return."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it.","title":"Continuation Token"},"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sms__list_sms_setup_opt_outs__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"422":{"description":"A query parameter failed validation, or continuation_token is unparseable."}}}},"/v1/sms":{"get":{"tags":["SMS"],"summary":"List SMS messages","description":"List inbound + outbound SMS messages, interleaved chronologically. At least one of `use_case_id` or `peer_phone_number` is required so the query stays on a leading index per leg. Optional `direction=inbound|outbound` prunes one leg. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed field: created_at). Default: `-created_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`.","operationId":"list-sms-messages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"setup_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}},{"name":"use_case_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"enum":["inbound","outbound"],"type":"string"},{"type":"null"}],"title":"Direction"}},{"name":"peer_phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"phone"},{"type":"null"}],"title":"Peer Phone Number"}},{"name":"is_mms","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Mms"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"created_at\", -1)]`` (newest first).","default":[],"title":"Sort By"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"created_at\", -1)]`` (newest first)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"The maximum number of SMS messages to return.","default":50,"title":"Limit"},"description":"The maximum number of SMS messages to return."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it.","title":"Continuation Token"},"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sms__list_sms_messages__Response"}}}},"422":{"description":"Query parameter failed validation, neither use_case_id nor peer_phone_number was supplied, or continuation_token is unparseable."}}}},"/v1/sms/public/{attachment_id}":{"get":{"tags":["SMS"],"summary":"Get Sms Message Attachment Publicly","description":"Redirect to a presigned URL for the public MMS media Twilio fetches.\n\nUnauthenticated: attachment_id is an unguessable capability hash, so there's no\nDB lookup and a forged id resolves to a 404 at S3. The public copy is ephemeral.","operationId":"get-sms-message-attachment-publicly","parameters":[{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to a short-lived S3 presigned URL for the public media object."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sms/{sms_id}/attachment/{attachment_name}":{"get":{"tags":["SMS"],"summary":"Get Sms Message Attachment","description":"Redirect to a presigned URL for one MMS attachment, the retained private copy.\n\nThe name must be listed on the row, so a caller can't sign a URL for an arbitrary\nkey. 404 if the message or name is unknown.\n\nRequires the `sms:read` OAuth2 scope on the target setup.","operationId":"get-sms-message-attachment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sms_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sms Id"}},{"name":"attachment_name","in":"path","required":true,"schema":{"type":"string","title":"Attachment Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"307":{"description":"Redirect to a short-lived S3 presigned URL for the attachment."},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"SMS message not found, or no attachment with this name on the message."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sms/{message_id}":{"get":{"tags":["SMS"],"summary":"Get Sms Message","description":"Fetch one SMS or MMS by id, inbound or outbound.\n\nRequires the `sms:read` OAuth2 scope on the target setup.","operationId":"get-sms-message","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__sms__get_sms_message__Response"}}}},"401":{"description":"Missing, expired, or invalid bearer token."},"403":{"description":"Token lacks the required scope or access to this setup."},"404":{"description":"SMS message not found in either the inbound or outbound table."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/oauth/token":{"post":{"tags":["OAuth2"],"summary":"Get Token","description":"Exchange client credentials for a 1-hour access token (client_credentials grant).\n\nAuthenticate via HTTP Basic or client_id/client_secret in the form body; the\nrequested scopes are intersected down to the client's grant. No refresh token.","operationId":"oauth2-token","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/src__routes__auth__get_token__Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__auth__get_token__Response"}}}},"401":{"description":"Missing client credentials."},"403":{"description":"Invalid client credentials."},"422":{"description":"Malformed token request (e.g. unsupported grant_type)."}},"security":[{"HTTPBasic":[]}]}},"/v1/oauth/client":{"post":{"tags":["OAuth2"],"summary":"Create Oauth2 Client","description":"Register an OAuth2 client for machine-to-machine auth; the secret is returned once.\n\nRequires the `clients:admin` OAuth2 scope (resource-less; exact-name grant only — not matched by a wildcard scope).","operationId":"create-oauth2-client","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__auth__create_oauth2_client__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__auth__create_oauth2_client__Response"}}}},"404":{"description":"One or more allowed_setup_ids do not exist."},"422":{"description":"Request body failed validation (name pattern, or empty scopes/setups)."}},"security":[{"HTTPBearer":[]}]}},"/v1/oauth/client/{client_id}":{"put":{"tags":["OAuth2"],"summary":"Update Oauth2 Client","description":"Patch an OAuth2 client's grants. The secret is never changed here — rotate it instead.\n\nRequires the `clients:admin` OAuth2 scope (resource-less; exact-name grant only — not matched by a wildcard scope).","operationId":"update-oauth2-client","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__auth__update_oauth2_client__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__auth__update_oauth2_client__Response"}}}},"404":{"description":"OAuth2 client not found, or an allowed_setup_id does not exist."},"422":{"description":"No fields supplied, or a field failed validation."}}},"delete":{"tags":["OAuth2"],"summary":"Delete Oauth2 Client","description":"Revoke an OAuth2 client (tombstone for audit); it can no longer obtain tokens.\n\nRequires the `clients:admin` OAuth2 scope (resource-less; exact-name grant only — not matched by a wildcard scope).","operationId":"delete-oauth2-client","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"OAuth2 client not found (already revoked, or never existed)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/oauth/client/{client_id}/rotate-secret":{"post":{"tags":["OAuth2"],"summary":"Rotate Oauth2 Client Secret","description":"Issue a new secret for an OAuth2 client (hard swap, no grace window; the old secret stops immediately).\n\nRequires the `clients:admin` OAuth2 scope (resource-less; exact-name grant only — not matched by a wildcard scope).","operationId":"rotate-oauth2-client-secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__auth__rotate_oauth2_client_secret__Response"}}}},"404":{"description":"OAuth2 client not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["Health","skip_maintenance"],"summary":"Health","operationId":"health-check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}}},"webhooks":{"inbound-turn":{"post":{"summary":"Inbound Turn","description":"Posted to a messaging use case's configured webhook_url on every inbound SMS,\nemail, or iMessage turn.\n\nThe body is the exact bytes signed by X-AMIGO-CHANNEL-MANAGER-WEBHOOK-SIGNATURE\n(HMAC-SHA256, hex). For 30 minutes after a secret rotation, two signature headers\nare sent (current and previous secret); verify either. Return 2xx, or the turn is\nrolled back and the provider retries.","operationId":"inbound_turninbound_turn_post","parameters":[{"required":true,"schema":{"type":"string","title":"X-Amigo-Channel-Manager-Webhook-Signature"},"name":"X-AMIGO-CHANNEL-MANAGER-WEBHOOK-SIGNATURE","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanonicalInboundEnvelopePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"A2PBrandRegistrationError":{"properties":{"registrationerrorcode":{"type":"integer","title":"Registrationerrorcode"},"registrationerrordescription":{"type":"string","title":"Registrationerrordescription"}},"type":"object","required":["registrationerrorcode","registrationerrordescription"],"title":"A2PBrandRegistrationError","description":"Entry in `brandregistrationerrors`. Field names mirror Twilio's wire shape\n(not re-keyed on write), so the JSONB column reads 1:1 with the Event Streams\nschema."},"A2PBrandRegistrationPrimaryVettingStatus":{"type":"string","enum":["pending","verified","unverified"],"title":"A2PBrandRegistrationPrimaryVettingStatus","description":"Identity-vetting axis. Driven only by primary events, never\nauto-transitioned from a secondary event."},"A2PBrandRegistrationResponse":{"properties":{"setup_id":{"type":"string","title":"Setup Id"},"brand_type":{"$ref":"#/components/schemas/A2PBrandRegistrationType"},"primary_vetting_status":{"$ref":"#/components/schemas/A2PBrandRegistrationPrimaryVettingStatus","description":"Identity vetting outcome."},"secondary_vetting_status":{"$ref":"#/components/schemas/A2PBrandRegistrationSecondaryVettingStatus","description":"SEC / sanctions vetting outcome; always `skipped` for low-volume-standard brands."},"primary_vetting_errors":{"items":{"$ref":"#/components/schemas/A2PBrandRegistrationError"},"type":"array","title":"Primary Vetting Errors","description":"Identity-vetting errors; cleared on a successful resubmit."},"secondary_vetting_errors":{"items":{"$ref":"#/components/schemas/A2PBrandRegistrationError"},"type":"array","title":"Secondary Vetting Errors","description":"SEC-vetting errors; cleared on a successful resubmit."},"resubmit_count":{"type":"integer","title":"Resubmit Count","description":"update_async count. Twilio caps free resubmits at 3; a 4th returns 400 (error 21724)."},"allowed_campaign_usecases":{"anyOf":[{"items":{"$ref":"#/components/schemas/CampaignUseCase"},"type":"array"},{"type":"null"}],"title":"Allowed Campaign Usecases","description":"Live TCR campaign use-case discovery; populated only on GET for a verified\nbrand with a live SMS use case, else None."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["setup_id","brand_type","primary_vetting_status","secondary_vetting_status","primary_vetting_errors","secondary_vetting_errors","resubmit_count","created_at","updated_at"],"title":"A2PBrandRegistrationResponse","description":"A2P 10DLC brand registration row state."},"A2PBrandRegistrationSecondaryVettingStatus":{"type":"string","enum":["pending","verified","failed","skipped"],"title":"A2PBrandRegistrationSecondaryVettingStatus","description":"Secondary (SEC) vetting axis, driven only by secondary events. LVS rows\ncarry `skipped` permanently from insert."},"A2PBrandRegistrationType":{"type":"string","enum":["standard","low-volume-standard"],"title":"A2PBrandRegistrationType","description":"DB enum for a US 10DLC brand, collapsing Twilio's two-flag wire shape\n(brandType + skip_automatic_sec_vet), translated in submit_brand_registration.\nSOLE_PROPRIETOR is out of scope."},"A2PCampaignResponse":{"properties":{"sms_use_case_id":{"type":"string","format":"uuid","title":"Sms Use Case Id","description":"SMS use-case binding this campaign belongs to (1:1)."},"setup_id":{"type":"string","format":"uuid","title":"Setup Id","description":"Twilio setup snapshot — denormalized from the SMS binding at create\ntime."},"us_app_to_person_usecase":{"type":"string","title":"Us App To Person Usecase","description":"TCR campaign use-case code (e.g. \"MARKETING\", \"2FA\")."},"description":{"type":"string","title":"Description"},"message_samples":{"items":{"type":"string"},"type":"array","title":"Message Samples"},"message_flow":{"type":"string","title":"Message Flow"},"has_embedded_links":{"type":"boolean","title":"Has Embedded Links"},"has_embedded_phone":{"type":"boolean","title":"Has Embedded Phone"},"age_gated":{"type":"boolean","title":"Age Gated"},"direct_lending":{"type":"boolean","title":"Direct Lending"},"opt_in_message":{"type":"string","title":"Opt In Message"},"opt_in_keywords":{"items":{"type":"string"},"type":"array","title":"Opt In Keywords"},"opt_out_message":{"type":"string","title":"Opt Out Message"},"opt_out_keywords":{"items":{"type":"string"},"type":"array","title":"Opt Out Keywords"},"help_message":{"type":"string","title":"Help Message"},"help_keywords":{"items":{"type":"string"},"type":"array","title":"Help Keywords"},"privacy_policy_url":{"type":"string","title":"Privacy Policy Url"},"terms_and_conditions_url":{"type":"string","title":"Terms And Conditions Url"},"status":{"$ref":"#/components/schemas/TwilioA2PCampaignStatus","description":"Driven by Twilio Event Streams. SUSPENDED is enum-allowed but has no\nautomated path to set."},"errors":{"items":{"$ref":"#/components/schemas/TwilioA2PCampaignError"},"type":"array","title":"Errors","description":"{code, description} entries from the campaign-failure event. Cleared on a\nsuccessful resubmit (PUT on a FAILED row)."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["sms_use_case_id","setup_id","us_app_to_person_usecase","description","message_samples","message_flow","has_embedded_links","has_embedded_phone","age_gated","direct_lending","opt_in_message","opt_in_keywords","opt_out_message","opt_out_keywords","help_message","help_keywords","privacy_policy_url","terms_and_conditions_url","status","errors","created_at","updated_at"],"title":"A2PCampaignResponse","description":"A2P 10DLC campaign row state."},"AcceptedDocument":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","description":"Pass back as `supporting_documents[i].type`. Real-document types (LOA,\nK-bis, utility bill, passport) require file upload via numbers-upload.twilio.com."},"detailed_fields":{"items":{"$ref":"#/components/schemas/DetailedField"},"type":"array","title":"Detailed Fields"}},"type":"object","required":["name","type","detailed_fields"],"title":"AcceptedDocument","description":"One acceptable document type for a SupportingDocument slot; caller picks one."},"AudioMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"audio","title":"Message Type"},"media_attachment":{"type":"string","contentMediaType":"application/octet-stream","title":"Media Attachment"},"is_voice":{"type":"boolean","title":"Is Voice"},"target_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","media_attachment","is_voice"],"title":"AudioMessageRequest"},"AuthorizedRepresentative":{"properties":{"first_name":{"type":"string","maxLength":128,"minLength":1,"title":"First Name","description":"Representative's first name."},"last_name":{"type":"string","maxLength":128,"minLength":1,"title":"Last Name","description":"Representative's last name."},"email":{"type":"string","format":"email","title":"Email","description":"Contact email for Twilio verification."},"phone_number":{"type":"string","format":"phone","title":"Phone Number","description":"E.164 phone number for Twilio verification."},"business_title":{"type":"string","maxLength":128,"minLength":1,"title":"Business Title","description":"Free-text title (e.g. Chief Technology Officer)."},"job_position":{"$ref":"#/components/schemas/JobPosition","description":"Enum role for Twilio (e.g. CEO, VP, Director)."}},"type":"object","required":["first_name","last_name","email","phone_number","business_title","job_position"],"title":"AuthorizedRepresentative","description":"Person Twilio can contact for verification. Maps to EndUserType authorized_representative_1."},"Body_send-email":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_address":{"type":"string","format":"email","title":"To Address"},"mode":{"type":"string","enum":["template","raw_html"],"title":"Mode"},"template_parameters":{"anyOf":[{"type":"string","contentMediaType":"application/json","contentSchema":{"additionalProperties":{"type":"string"},"type":"object"}},{"type":"null"}],"title":"Template Parameters"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id"},"subject":{"anyOf":[{"type":"string","maxLength":998,"minLength":1},{"type":"null"}],"title":"Subject"},"body_html":{"anyOf":[{"type":"string","maxLength":1000000,"minLength":1},{"type":"null"}],"title":"Body Html"},"attachments":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Attachments","default":[]},"reply_to_inbound_email_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Reply To Inbound Email Id"}},"type":"object","required":["use_case_id","to_address","mode"],"title":"Body_send-email"},"Body_send-imessage":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_number":{"type":"string","format":"phone","title":"To Number"},"content":{"type":"string","maxLength":18996,"title":"Content","default":""},"media":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Media"}},"type":"object","required":["use_case_id","to_number"],"title":"Body_send-imessage"},"Body_send-sms-message":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_phone_number":{"type":"string","format":"phone","title":"To Phone Number"},"message":{"anyOf":[{"type":"string","maxLength":1600,"minLength":1},{"type":"null"}],"title":"Message"},"media_attachments":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","maxItems":10,"title":"Media Attachments","default":[]}},"type":"object","required":["use_case_id","to_phone_number"],"title":"Body_send-sms-message"},"Body_submit-regulatory-bundle":{"properties":{"regulation_sid":{"type":"string","maxLength":64,"minLength":2,"title":"Regulation Sid"},"end_users":{"type":"string","title":"End Users"},"supporting_documents":{"type":"string","title":"Supporting Documents"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","required":["regulation_sid","end_users","supporting_documents"],"title":"Body_submit-regulatory-bundle"},"Body_submit-tollfree-verification":{"properties":{"business_name":{"type":"string","maxLength":256,"minLength":1,"title":"Business Name"},"business_website":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Business Website"},"use_case_categories":{"items":{"$ref":"#/components/schemas/TollfreeUseCaseCategory"},"type":"array","maxItems":10,"minItems":1,"title":"Use Case Categories"},"use_case_summary":{"type":"string","maxLength":4096,"minLength":1,"title":"Use Case Summary"},"production_message_sample":{"type":"string","maxLength":2048,"minLength":1,"title":"Production Message Sample"},"opt_in_type":{"$ref":"#/components/schemas/TollfreeOptInType"},"opt_in_confirmation_message":{"type":"string","maxLength":160,"minLength":1,"title":"Opt In Confirmation Message"},"message_volume":{"$ref":"#/components/schemas/TollfreeMessageVolume"},"business_type":{"$ref":"#/components/schemas/TollfreeBusinessType"},"terms_and_conditions_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Terms And Conditions Url"},"privacy_policy_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Privacy Policy Url"},"age_gated_content":{"type":"boolean","title":"Age Gated Content"},"opt_in_proof_files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Opt In Proof Files","default":[]},"additional_information":{"anyOf":[{"type":"string","maxLength":4096,"minLength":1},{"type":"null"}],"title":"Additional Information"},"business_registration_number":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Business Registration Number"},"business_registration_authority":{"anyOf":[{"$ref":"#/components/schemas/TollfreeBusinessRegistrationAuthority"},{"type":"null"}]},"business_registration_country":{"anyOf":[{"type":"string","pattern":"^\\w{2}$"},{"type":"null"}],"title":"Business Registration Country"}},"type":"object","required":["business_name","business_website","use_case_categories","use_case_summary","production_message_sample","opt_in_type","opt_in_confirmation_message","message_volume","business_type","terms_and_conditions_url","privacy_policy_url","age_gated_content"],"title":"Body_submit-tollfree-verification"},"BundleKind":{"type":"string","enum":["shaken_stir","cnam","a2p_messaging_profile","regulatory"],"title":"BundleKind","description":"Client-facing classification of a Twilio setup bundle, surfaced in place of\nthe raw Twilio policy SID (a vendor identifier). Mirrors the read-scope split in\nlist_twilio_setup_bundles: shaken_stir + cnam are voice, a2p_messaging_profile is\nsms, everything else is a Regulatory Compliance regulation."},"BusinessAddress":{"properties":{"street":{"type":"string","maxLength":256,"minLength":1,"title":"Street","description":"Street address line."},"city":{"type":"string","maxLength":128,"minLength":1,"title":"City","description":"City name."},"region":{"type":"string","maxLength":64,"minLength":1,"title":"Region","description":"State or province."},"postal_code":{"type":"string","maxLength":16,"minLength":1,"title":"Postal Code","description":"ZIP or postal code."},"iso_country":{"type":"string","pattern":"^\\w{2}$","title":"Iso Country","description":"ISO 3166-1 alpha-2 country code."}},"type":"object","required":["street","city","region","postal_code","iso_country"],"title":"BusinessAddress","description":"Business address for Twilio Address API. All fields required."},"BusinessIdentity":{"type":"string","enum":["direct_customer","isv_reseller_or_partner","unknown"]},"BusinessIndustry":{"type":"string","enum":["AGRICULTURE","AUTOMOTIVE","BANKING","CONSUMER","EDUCATION","ELECTRONICS","ENERGY","ENGINEERING","FAST_MOVING_CONSUMER_GOODS","FINANCIAL","FINTECH","FOOD_AND_BEVERAGE","GOVERNMENT","HEALTHCARE","HOSPITALITY","INSURANCE","JEWELRY","LEGAL","MANUFACTURING","MEDIA","NOT_FOR_PROFIT","OIL_AND_GAS","ONLINE","RAW_MATERIALS","REAL_ESTATE","RELIGION","RETAIL","TECHNOLOGY","TELECOMMUNICATIONS","TRANSPORTATION","TRAVEL"]},"BusinessRegion":{"type":"string","enum":["AFRICA","ASIA","EUROPE","LATIN_AMERICA","USA_AND_CANADA","AUSTRALIA"]},"BusinessRegistrationIdentifier":{"type":"string","enum":["EIN","DUNS","CBN","CN","ACN","CIN","VAT","VATRN","RN","Other"]},"BusinessType":{"type":"string","enum":["Sole Proprietorship","Partnership","Limited Liability Corporation","Co-operative","Non-profit Corporation","Corporation"]},"CampaignUseCase":{"properties":{"code":{"type":"string","title":"Code","description":"TCR campaign use-case code (e.g. \"MARKETING\", \"2FA\")."},"name":{"type":"string","title":"Name","description":"Human-readable name."},"description":{"type":"string","title":"Description","description":"Human-readable description from Twilio."},"post_approval_required":{"type":"boolean","title":"Post Approval Required","description":"Whether Twilio requires manual post-approval for campaigns at this code."}},"type":"object","required":["code","name","description","post_approval_required"],"title":"CampaignUseCase","description":"One entry from Twilio's us_app_to_person_usecases discovery."},"CanonicalInboundEnvelopePayload":{"properties":{"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"inbound_message_ref":{"type":"string","maxLength":256,"minLength":1,"title":"Inbound Message Ref"},"caller_ref":{"type":"string","maxLength":320,"title":"Caller Ref","default":""},"content_parts":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","maxItems":100,"minItems":1,"title":"Content Parts"},"parent_outbound_ref":{"type":"string","maxLength":256,"title":"Parent Outbound Ref","default":""},"subject":{"anyOf":[{"type":"string","maxLength":998},{"type":"null"}],"title":"Subject"},"authenticated":{"type":"boolean","title":"Authenticated","default":false},"idempotency_key":{"type":"string","maxLength":256,"title":"Idempotency Key","default":""},"occurred_at":{"type":"number","title":"Occurred At","default":0.0}},"type":"object","required":["channel_kind","use_case_id","inbound_message_ref","content_parts"],"title":"CanonicalInboundEnvelopePayload","description":"HTTP wire shape for :class:`CanonicalInboundEnvelope` (channel service → platform-api).\n\nFrozen — it is parsed once and immediately converted to the frozen in-core\ndataclass, so between-parse mutation is a bug."},"Channel":{"type":"string","enum":["outbound_voice","inbound_voice","sms","email","imessage","whatsapp"],"title":"Channel","description":"Channel a use case operates on. Each maps to its own binding table (see\nschema.py); the value also drives the voice assignment UNIQUE(phone, channel)\nand the outbound-voice route gating."},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"CompanyType":{"type":"string","enum":["private","public","non-profit","government"]},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"CustomerProfileStatusDetail":{"properties":{"status":{"$ref":"#/components/schemas/SetupStepStatus","description":"Current verification status."},"last_failure":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Last Failure","description":"Human-readable failure strings from the latest noncompliant eval or\nwebhook rejection. NULL when healthy."}},"type":"object","required":["status"],"title":"CustomerProfileStatusDetail","description":"Status of the Trust Hub customer profile."},"DetailedField":{"properties":{"machine_name":{"type":"string","title":"Machine Name","description":"Attribute key. Twilio's `address_sids` is renamed `address` (see value_type)."},"friendly_name":{"type":"string","title":"Friendly Name"},"description":{"type":"string","title":"Description","description":"Per-field guidance; \"\" when Twilio returns null (route projects null → \"\")."},"value_type":{"type":"string","enum":["String","Boolean","Date","Address"],"title":"Value Type","description":"Wire type. `String`/`Boolean`/`Date` are scalars (Date is ISO-8601);\n`Address` is a structured object synthesized from Twilio's `address_sids`\nList — the bundle-create handler swaps it back before submitting."}},"type":"object","required":["machine_name","friendly_name","description","value_type"],"title":"DetailedField","description":"One attribute on an EndUser or SupportingDocument's `attributes` blob."},"DialParticipant":{"properties":{"kind":{"type":"string","const":"dial","title":"Kind","default":"dial"},"role":{"type":"string","enum":["operator","transfer_target","callee"],"title":"Role"},"to_phone_number":{"type":"string","format":"phone","title":"To Phone Number"},"detect_answering_machine":{"type":"boolean","title":"Detect Answering Machine","description":"Run Twilio AMD on this leg; the verdict lands on the participant as `answered_by`."}},"type":"object","required":["role","to_phone_number","detect_answering_machine"],"title":"DialParticipant"},"DialRedirect":{"properties":{"kind":{"type":"string","const":"dial","title":"Kind","default":"dial"},"to":{"type":"string","format":"phone","title":"To"}},"type":"object","required":["to"],"title":"DialRedirect"},"DnsRecord":{"properties":{"address":{"type":"string","title":"Address"},"record":{"type":"string","title":"Record"},"type":{"type":"string","enum":["CNAME","MX","TXT"],"title":"Type"},"verified":{"type":"boolean","title":"Verified"}},"type":"object","required":["address","record","type","verified"],"title":"DnsRecord","description":"A single DNS entry the customer must publish. `address` is the FQDN the entry\nlives under; `record` is its target value (for MX, includes the priority prefix)."},"DocumentMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"document","title":"Message Type"},"media_attachment":{"type":"string","contentMediaType":"application/octet-stream","title":"Media Attachment"},"message":{"anyOf":[{"type":"string","maxLength":1024,"minLength":1},{"type":"null"}],"title":"Message"},"target_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","media_attachment"],"title":"DocumentMessageRequest"},"DomainNameValidationResult":{"properties":{"ascii_domain":{"type":"string","title":"Ascii Domain"},"domain":{"type":"string","title":"Domain"}},"type":"object","required":["ascii_domain","domain"],"title":"DomainNameValidationResult"},"EmailBodyKind":{"type":"string","enum":["html","text"],"title":"EmailBodyKind","description":"Which body was extracted from inbound MIME via\n`EmailMessage.get_body(preferencelist=(\"html\",\"plain\"))` — sets the read\nContent-Type and the S3 key suffix (`body.html` vs `body.txt`)."},"EmailInboundMode":{"type":"string","enum":["send_only","replies_only","all_inbound"],"title":"EmailInboundMode","description":"What inbound a use case accepts. Only SEND_ONLY needs no inbound MX;\nALL_INBOUND adds cold inbound (not replying to our outbound) over REPLIES_ONLY."},"EmailTemplateItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","ses_use_case_id","created_at","updated_at"],"title":"EmailTemplateItem"},"EmailTier":{"type":"string","enum":["onboarding","standard","premium","suspended"],"title":"EmailTier","description":"Reputation lane, mutable; set by the re-tiering cron on send/bounce/\ncomplaint metrics. SUSPENDED clears SendingPoolName → shared IPs (kept\nsendable, off the dedicated pools)."},"EmailType":{"type":"string","enum":["transactional","marketing"],"title":"EmailType","description":"Outbound email classification, immutable per use case. Selects the\nreputation-isolated IP pool family (transactional vs marketing never share\nIPs); maps to `outbound-{tier}-{email_type}`."},"EmailUseCaseRequest":{"properties":{"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\"). Pairs with\n`name` to form the documentation-facing (entity_name, name) identifier —\nUNIQUE across the table."},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Required; immutable after create."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Required; immutable after create."},"channel":{"type":"string","const":"email","title":"Channel","description":"Always \"email\" for this variant."},"ses_setup_id":{"type":"string","format":"uuid","title":"Ses Setup Id","description":"SES setup the use case binds to."},"sender_email_address":{"type":"string","title":"Sender Email Address","description":"Explicit From address for outbound sends. Parsed + normalized at the\nboundary (display names and empty local parts rejected); the normalized\naddress is stored. Its normalized domain part must equal the setup's\n(already-normalized) domain_identity — so the match is case-insensitive\non the caller's input."},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"Destination this binding's inbound turns are POSTed to. On each inbound\nemail, channel-manager sends the CanonicalInboundEnvelope here; the receiver\nmust speak platform-api's `/v1/internal/channel/turn` contract. Per-binding,\nso each channel of a use case can route to a different consumer. Required\nat create."},"sender_email_alias":{"anyOf":[{"type":"string","maxLength":40,"minLength":4},{"type":"null"}],"title":"Sender Email Alias","description":"Optional display name rendered before the address in the From header —\n`{sender_email_alias} <{sender_email_address}>`. Required-nullable: the\ncaller commits to a value or an explicit null. The 40-char cap keeps the\nFrom header under RFC 5322's line limit even after RFC 2047 encoding of a\nnon-ASCII name. Immutable after creation."},"email_type":{"$ref":"#/components/schemas/EmailType","description":"Outbound classification. Selects the pool family (transactional vs\nmarketing). Immutable after creation."},"unsubscribable":{"type":"boolean","title":"Unsubscribable","description":"Whether the use case exposes RFC 8058 unsubscribe (List-Unsubscribe\nheader + footer links) and gates sends on the per-use-case unsubscribe\ntable. Marketing email_type MUST be unsubscribable (CAN-SPAM, Gmail/Yahoo\nbulk-sender rules); transactional may opt out for must-send flows. The\nsetup-level ban list is enforced regardless. Required: caller commits to\none stance per use case."},"inbound_mode":{"$ref":"#/components/schemas/EmailInboundMode","description":"What inbound this use case accepts. Anything but `send_only` requires the\nsetup's inbound MX verified at create. Mutable via PUT /v1/use-case/{id}."}},"type":"object","required":["entity_name","name","environment","region","channel","ses_setup_id","sender_email_address","webhook_url","sender_email_alias","email_type","unsubscribable","inbound_mode"],"title":"EmailUseCaseRequest","description":"Request body for the email channel."},"EmailUseCaseUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description. Supply `null` to clear it, omit to leave it\nunchanged."},"channel":{"type":"string","const":"email","title":"Channel"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"New inbound-turn destination for this email binding (see the create\nrequest's `webhook_url`). Omit to leave it unchanged."},"sender_email_alias":{"anyOf":[{"type":"string","maxLength":40,"minLength":4},{"type":"null"}],"title":"Sender Email Alias","description":"Display name rendered before the sender address in the outbound From\nheader. Supply `null` to clear it (bare address), omit to leave unchanged."},"inbound_mode":{"$ref":"#/components/schemas/EmailInboundMode","title":"Inbound Mode","description":"What inbound this use case accepts (see the create request). Moving off\n`send_only` requires the setup's inbound MX verified now (409 otherwise)."}},"type":"object","required":["channel"],"title":"EmailUseCaseUpdateRequest"},"EndUserEntity":{"properties":{"entity_kind":{"type":"string","const":"end_user","title":"Entity Kind","default":"end_user"},"entity_type":{"type":"string","title":"Entity Type","description":"Twilio EndUser machine_name (e.g. customer_profile_business_information)."},"attributes":{"additionalProperties":true,"type":"object","title":"Attributes","description":"The attribute values we submitted to Twilio for this entity."}},"type":"object","required":["entity_type","attributes"],"title":"EndUserEntity"},"EndUserRequirement":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","description":"Pass back as `end_users[i].type` on POST /bundle/regulatory."},"requirement_name":{"type":"string","title":"Requirement Name"},"detailed_fields":{"items":{"$ref":"#/components/schemas/DetailedField"},"type":"array","title":"Detailed Fields"}},"type":"object","required":["name","type","requirement_name","detailed_fields"],"title":"EndUserRequirement","description":"One EndUser the regulation requires."},"Environment":{"type":"string","enum":["staging","production"],"title":"Environment","description":"Deployment stage a use case targets. Immutable; CHECK-constrained (extend\nthe CHECK to add a value)."},"EventType":{"type":"string","enum":["Reject","Delivery","Bounce","Complaint","DeliveryDelay","Open","Click"]},"FarewellRedirect":{"properties":{"kind":{"type":"string","const":"farewell","title":"Kind","default":"farewell"},"message":{"type":"string","maxLength":1000,"minLength":1,"title":"Message"}},"type":"object","required":["message"],"title":"FarewellRedirect"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"HealthResponse"},"ImageMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"image","title":"Message Type"},"media_attachment":{"type":"string","contentMediaType":"application/octet-stream","title":"Media Attachment"},"message":{"anyOf":[{"type":"string","maxLength":1024,"minLength":1},{"type":"null"}],"title":"Message"},"target_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","media_attachment"],"title":"ImageMessageRequest"},"InboundEmailItem":{"properties":{"direction":{"type":"string","const":"inbound","title":"Direction","description":"Discriminator — always `inbound` on this variant."},"id":{"type":"string","format":"uuid","title":"Id"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"from_address":{"type":"string","title":"From Address","description":"Envelope sender (mail.source). What SPF authenticated against."},"to_address":{"type":"string","title":"To Address","description":"The RCPT TO that landed on us."},"subject":{"type":"string","title":"Subject"},"in_reply_to_email_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"In Reply To Email Id","description":"The outbound `emails.id` this is a reply to (threaded path), or\nNULL when this row is a cold inbound."},"received_at":{"type":"string","format":"date-time","title":"Received At"},"has_attachment":{"type":"boolean","title":"Has Attachment"}},"type":"object","required":["direction","id","ses_use_case_id","setup_id","from_address","to_address","subject","in_reply_to_email_id","received_at","has_attachment"],"title":"InboundEmailItem","description":"Slim row; body kind / raw / attachments are on GET /v1/email/{email_id}."},"InboundEmailResponse":{"properties":{"direction":{"type":"string","const":"inbound","title":"Direction"},"id":{"type":"string","format":"uuid","title":"Id"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"from_address":{"type":"string","title":"From Address","description":"Authenticated RFC822 `From:` sender; on a threaded reply this equals the outbound `to_address` we replied to."},"to_address":{"type":"string","title":"To Address","description":"The RCPT TO that landed on us."},"subject":{"type":"string","title":"Subject"},"received_at":{"type":"string","format":"date-time","title":"Received At","description":"SES `mail.timestamp` — when the message was received upstream."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When channel-manager inserted this inbound row."},"in_reply_to_email_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"In Reply To Email Id","description":"The outbound `emails.id` this replies to, or NULL when cold inbound."},"attachment_filenames":{"items":{"type":"string"},"type":"array","title":"Attachment Filenames","description":"MIME-iteration order, matches each S3 key's trailing path."},"body_kind":{"$ref":"#/components/schemas/EmailBodyKind","description":"`html` or `text`. Tells the client what `Content-Type` `/body` will return."}},"type":"object","required":["direction","id","ses_use_case_id","setup_id","from_address","to_address","subject","received_at","created_at","in_reply_to_email_id","attachment_filenames","body_kind"],"title":"InboundEmailResponse"},"JobPosition":{"type":"string","enum":["Director","GM","VP","CEO","CFO","General Counsel","Other"]},"Keyword":{"type":"string","maxLength":255,"minLength":1,"pattern":"^[A-Za-z0-9]+$"},"MediaHeader":{"properties":{"format":{"type":"string","enum":["image","video","document"],"title":"Format"}},"type":"object","required":["format"],"title":"MediaHeader"},"MediaParticipant":{"properties":{"kind":{"type":"string","const":"media","title":"Kind","default":"media"},"stream_url":{"type":"string","minLength":1,"format":"uri","title":"Stream Url","description":"The wss:// endpoint Twilio streams this leg's media to."},"stream_context":{"additionalProperties":{"type":"string","maxLength":256},"propertyNames":{"maxLength":128,"minLength":1},"type":"object","maxProperties":32,"title":"Stream Context","description":"Key→value context echoed to the stream's `start` event."}},"type":"object","required":["stream_url","stream_context"],"title":"MediaParticipant"},"MessageResponse":{"oneOf":[{"$ref":"#/components/schemas/src__routes__imessage__messages__InboundMessage"},{"$ref":"#/components/schemas/src__routes__imessage__messages__OutboundMessage"}],"discriminator":{"propertyName":"direction","mapping":{"inbound":"#/components/schemas/src__routes__imessage__messages__InboundMessage","outbound":"#/components/schemas/src__routes__imessage__messages__OutboundMessage"}}},"OutboundEmailItem":{"properties":{"direction":{"type":"string","const":"outbound","title":"Direction","description":"Discriminator — always `outbound` on this variant."},"id":{"type":"string","format":"uuid","title":"Id","description":"The ID of the email."},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id","description":"The SES use case the email was sent through."},"setup_id":{"type":"string","format":"uuid","title":"Setup Id","description":"The SES setup the email was sent from."},"from_address":{"type":"string","title":"From Address","description":"The sender address."},"to_address":{"type":"string","title":"To Address","description":"The recipient address."},"subject":{"type":"string","title":"Subject","description":"The email subject."},"state":{"$ref":"#/components/schemas/State","description":"Derived state; precedence complained > bounced > rejected > delivered > sent."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the email was created."},"has_attachment":{"type":"boolean","title":"Has Attachment","description":"True if the email had one or more attachments."},"replied_to_inbound_email_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Replied To Inbound Email Id","description":"The inbound row's id when this send replied to one of our inbound emails; NULL for fresh sends."},"open_count":{"type":"integer","title":"Open Count","description":"Total number of Open events SES has emitted for this send."},"click_count":{"type":"integer","title":"Click Count","description":"Total number of Click events SES has emitted for this send."}},"type":"object","required":["direction","id","ses_use_case_id","setup_id","from_address","to_address","subject","state","created_at","has_attachment","replied_to_inbound_email_id","open_count","click_count"],"title":"OutboundEmailItem","description":"Slim row; full per-event detail is on GET /v1/email/{email_id}."},"OutboundEmailResponse":{"properties":{"direction":{"type":"string","const":"outbound","title":"Direction"},"id":{"type":"string","format":"uuid","title":"Id"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"from_address":{"type":"string","title":"From Address"},"to_address":{"type":"string","title":"To Address"},"subject":{"type":"string","title":"Subject"},"email_type":{"$ref":"#/components/schemas/EmailType"},"tier":{"$ref":"#/components/schemas/EmailTier","description":"Reputation lane snapshot at send time; a later tier change does not rewrite this column."},"attachment_filenames":{"items":{"type":"string"},"type":"array","title":"Attachment Filenames","description":"Send-time order, matching each S3 key's trailing path."},"replied_to_inbound_email_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Replied To Inbound Email Id","description":"The inbound row's id when this send replied to one of our inbound emails; NULL otherwise."},"state":{"type":"string","enum":["sent","delivered","bounced","complained","rejected"],"title":"State","description":"Derived state; precedence complained > bounced > rejected > delivered > sent."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"bounced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bounced At"},"bounce_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bounce Type"},"bounce_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bounce Subtype"},"complained_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Complained At"},"rejected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rejected At"},"delivery_delay_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivery Delay At"},"first_open_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Open At"},"last_open_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Open At"},"open_count":{"type":"integer","title":"Open Count","description":"Raw SES Open count (one per pixel load); use first/last_open_at for unique-by-mail signal."},"first_click_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Click At"},"last_click_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Click At"},"click_count":{"type":"integer","title":"Click Count","description":"Raw SES Click event count — one per link click."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["direction","id","ses_use_case_id","setup_id","from_address","to_address","subject","email_type","tier","attachment_filenames","replied_to_inbound_email_id","state","created_at","delivered_at","bounced_at","bounce_type","bounce_subtype","complained_at","rejected_at","delivery_delay_at","first_open_at","last_open_at","open_count","first_click_at","last_click_at","click_count","updated_at"],"title":"OutboundEmailResponse"},"Participant":{"properties":{"participant_ref":{"type":"string","format":"uuid","title":"Participant Ref"},"kind":{"$ref":"#/components/schemas/VoiceParticipantKind"},"role":{"$ref":"#/components/schemas/VoiceParticipantRole"},"to_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Phone Number"},"dial_status":{"anyOf":[{"$ref":"#/components/schemas/VoiceDialStatus"},{"type":"null"}]},"answered_by":{"anyOf":[{"$ref":"#/components/schemas/VoiceAmdResult"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"},"joined_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Joined At"},"left_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Left At"}},"type":"object","required":["participant_ref","kind","role","to_phone_number","dial_status","answered_by","created_at","answered_at","joined_at","left_at"],"title":"Participant"},"ReactionMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"reaction","title":"Message Type"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"target_message_id":{"type":"string","format":"uuid","title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","target_message_id"],"title":"ReactionMessageRequest"},"Region":{"type":"string","enum":["us-east-1","ap-southeast-2","eu-central-1","ca-central-1"],"title":"Region","description":"AWS region a use case targets. Immutable; CHECK-constrained (extend the\nCHECK to add a value)."},"Requirements":{"properties":{"end_user":{"items":{"$ref":"#/components/schemas/EndUserRequirement"},"type":"array","title":"End User"},"supporting_document":{"items":{"$ref":"#/components/schemas/SupportingDocumentRequirement"},"type":"array","title":"Supporting Document","description":"Each entry is independently required (AND); accepted_documents within an entry are alternatives (OR)."}},"type":"object","required":["end_user","supporting_document"],"title":"Requirements","description":"Top-level requirements block."},"SendBlueMessageService":{"type":"string","enum":["iMessage","SMS","RCS"]},"SendBluePhoneNumberResponse":{"properties":{"id":{"type":"string","title":"Id"},"phone_number":{"type":"string","title":"Phone Number","description":"E.164. Always set — the line is provisioned synchronously when the\nsubaccount is created."},"blocked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Blocked At","description":"Set by SendBlue's `line_blocked` webhook; never cleared (no unblock\nendpoint). The send path skips lines with non-null `blocked_at`."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","phone_number","blocked_at","created_at","updated_at"],"title":"SendBluePhoneNumberResponse","description":"A single SendBlue line under a setup."},"SendBlueSetupResponse":{"properties":{"id":{"type":"string","title":"Id"},"friendly_name":{"type":"string","title":"Friendly Name","description":"Operator-facing label."},"phone_numbers":{"items":{"$ref":"#/components/schemas/SendBluePhoneNumberResponse"},"type":"array","title":"Phone Numbers","description":"Unblocked lines, most-recent-first. Blocked rows via\n`GET /v1/sendblue-setup/{setup_id}/phone-number` with a `status` filter."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","friendly_name","phone_numbers","created_at","updated_at"],"title":"SendBlueSetupResponse","description":"A SendBlue subaccount setup."},"SendBlueUseCaseRequest":{"properties":{"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\"). Pairs with\n`name` to form the documentation-facing (entity_name, name) identifier —\nUNIQUE across the table."},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Required; immutable after create."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Required; immutable after create."},"channel":{"type":"string","const":"imessage","title":"Channel","description":"Always \"imessage\" for this variant."},"sendblue_setup_id":{"type":"string","format":"uuid","title":"Sendblue Setup Id","description":"SendBlue setup (subaccount) the use case binds to. SendBlue has no\ncompliance / brand-registration workflow, so there is no equivalent of\nthe Twilio `customer_profile_status == TWILIO_APPROVED` gate — any live\nsetup is bind-eligible."},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"Destination this binding's inbound turns are POSTed to. On each inbound\niMessage, channel-manager sends the CanonicalInboundEnvelope here; the\nreceiver must speak platform-api's `/v1/internal/channel/turn` contract.\nPer-binding, so each channel of a use case can route to a different\nconsumer. Required at create."}},"type":"object","required":["entity_name","name","environment","region","channel","sendblue_setup_id","webhook_url"],"title":"SendBlueUseCaseRequest","description":"Request body for the iMessage channel (SendBlue-served)."},"SendBlueUseCaseUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description. Supply `null` to clear it, omit to leave it\nunchanged."},"channel":{"type":"string","const":"imessage","title":"Channel"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"New inbound-turn destination for this iMessage binding (see the create\nrequest's `webhook_url`). Omit to leave it unchanged."}},"type":"object","required":["channel"],"title":"SendBlueUseCaseUpdateRequest"},"SesSetupDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"domain_identity":{"type":"string","title":"Domain Identity"},"dns_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dns Checked At","description":"Wall-clock time of the last refresh, or null if never checked."},"dns_records":{"items":{"$ref":"#/components/schemas/DnsRecord"},"type":"array","title":"Dns Records"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; non-null means the SES tenant + identity are torn down and verified flags are last-cached."}},"type":"object","required":["id","domain_identity","dns_checked_at","dns_records","created_at","updated_at"],"title":"SesSetupDetailResponse","description":"Response for POST /v1/ses-setup and GET /v1/ses-setup/{id}. On a tombstoned\nsetup `deleted_at` is set and `dns_records[].verified` reflects the last cached\nstate, not live SES."},"SetupStepStatus":{"type":"string","enum":["pending-review","in-review","twilio-approved","provisionally-approved","twilio-rejected"],"title":"SetupStepStatus","description":"Twilio-native status per Trust Hub verification step; mirrored as-is,\nincluding regressions from approved back to in-review on re-review."},"State":{"type":"string","enum":["sent","delivered","bounced","complained","rejected"]},"StickerMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"sticker","title":"Message Type"},"media_attachment":{"type":"string","contentMediaType":"application/octet-stream","title":"Media Attachment"},"target_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","media_attachment"],"title":"StickerMessageRequest"},"SupportingDocumentEntity":{"properties":{"entity_kind":{"type":"string","const":"supporting_document","title":"Entity Kind","default":"supporting_document"},"entity_type":{"type":"string","title":"Entity Type"},"attributes":{"additionalProperties":true,"type":"object","title":"Attributes"},"filename":{"type":"string","title":"Filename","description":"The document filename submitted to Twilio."}},"type":"object","required":["entity_type","attributes","filename"],"title":"SupportingDocumentEntity"},"SupportingDocumentRequirement":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","description":"Always \"document\" in observed regulations."},"requirement_name":{"type":"string","title":"Requirement Name"},"description":{"type":"string","title":"Description","description":"Operator-facing guidance; pass through to UI verbatim."},"accepted_documents":{"items":{"$ref":"#/components/schemas/AcceptedDocument"},"type":"array","title":"Accepted Documents","description":"Document types that satisfy this slot (OR — caller picks one)."}},"type":"object","required":["name","type","requirement_name","description","accepted_documents"],"title":"SupportingDocumentRequirement","description":"One SupportingDocument slot the regulation requires."},"TemplateLanguage":{"type":"string","enum":["None","af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","ar_SA","az","bn","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","en","en_GB","en_US","en_AU","en_CA","en_IN","et","fil","fi","fr","fr_CA","fr_BE","ka","de","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","sk","sl","es","es_AR","es_ES","es_MX","es_CL","es_CO","es_PE","es_VE","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu","UNKNOWN"],"title":"TemplateLanguage","description":"Template language and locale code.\n\n`'Template language and locale code' on\ndevelopers.facebook.com\n<https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages>`_"},"TextHeader":{"properties":{"format":{"type":"string","const":"text","title":"Format"},"text":{"type":"string","maxLength":60,"minLength":1,"title":"Text"},"text_parameter_name":{"anyOf":[{"type":"string","maxLength":60,"minLength":1,"pattern":"^[a-z_0-9]+$"},{"type":"null"}],"title":"Text Parameter Name"}},"type":"object","required":["format","text"],"title":"TextHeader"},"TextMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"text","title":"Message Type"},"message":{"type":"string","maxLength":4096,"minLength":1,"title":"Message"},"target_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","message"],"title":"TextMessageRequest"},"TollfreeBusinessRegistrationAuthority":{"type":"string","enum":["EIN","CBN","CRN","PROVINCIAL_NUMBER","VAT","ACN","ABN","BRN","SIREN","SIRET","NZBN","USt-IdNr","CIF","NIF","CNPJ","UID","NEQ","OTHER"]},"TollfreeBusinessType":{"type":"string","enum":["PRIVATE_PROFIT","PUBLIC_PROFIT","SOLE_PROPRIETOR","NON_PROFIT","GOVERNMENT"]},"TollfreeMessageVolume":{"type":"string","enum":["10","100","1,000","10,000","100,000","250,000","500,000","750,000","1,000,000","5,000,000","10,000,000+"]},"TollfreeOptInType":{"type":"string","enum":["VERBAL","WEB_FORM","PAPER_FORM","VIA_TEXT","MOBILE_QR_CODE","IMPORT"]},"TollfreeRejectionReasonDict":{"properties":{"code":{"type":"integer","title":"Code"},"description":{"type":"string","title":"Description"}},"type":"object","required":["code","description"],"title":"TollfreeRejectionReasonDict","description":"Entry in TwilioTollfreeVerification.rejection_reasons. `code` from the\nrejection event's `errorcodes`; `description` resolved from Twilio's static\nerror catalog. A code with no catalog match is drift → 500 → DLQ."},"TollfreeUseCaseCategory":{"type":"string","enum":["TWO_FACTOR_AUTHENTICATION","ACCOUNT_NOTIFICATIONS","CUSTOMER_CARE","CHARITY_NONPROFIT","DELIVERY_NOTIFICATIONS","FRAUD_ALERT_MESSAGING","EVENTS","HIGHER_EDUCATION","K12","MARKETING","POLLING_AND_VOTING_NON_POLITICAL","POLITICAL_ELECTION_CAMPAIGNS","PUBLIC_SERVICE_ANNOUNCEMENT","SECURITY_ALERT"]},"TollfreeVerificationResponse":{"properties":{"phone_number_id":{"type":"string","title":"Phone Number Id"},"status":{"$ref":"#/components/schemas/TollfreeVerificationStatus","description":"Current verification status; approved is terminal."},"business_name":{"type":"string","title":"Business Name"},"business_website":{"type":"string","title":"Business Website"},"business_type":{"$ref":"#/components/schemas/TollfreeBusinessType","description":"Legal structure of the business."},"business_registration_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Registration Number","description":"Business registration number; NULL only for SOLE_PROPRIETOR."},"business_registration_authority":{"anyOf":[{"$ref":"#/components/schemas/TollfreeBusinessRegistrationAuthority"},{"type":"null"}],"description":"Issuing authority; NULL for SOLE_PROPRIETOR."},"business_registration_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Registration Country","description":"ISO 3166-1 alpha-2 country of registration; NULL for SOLE_PROPRIETOR."},"use_case_categories":{"items":{"$ref":"#/components/schemas/TollfreeUseCaseCategory"},"type":"array","title":"Use Case Categories"},"use_case_summary":{"type":"string","title":"Use Case Summary"},"production_message_sample":{"type":"string","title":"Production Message Sample"},"opt_in_proof_filenames":{"items":{"type":"string"},"type":"array","title":"Opt In Proof Filenames","description":"Uploaded opt-in proof image filenames; public URLs are derived\nserver-side and not exposed here."},"opt_in_type":{"$ref":"#/components/schemas/TollfreeOptInType"},"opt_in_confirmation_message":{"type":"string","title":"Opt In Confirmation Message","description":"SMS sent to confirm a recipient's opt-in."},"message_volume":{"$ref":"#/components/schemas/TollfreeMessageVolume"},"additional_information":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Additional Information"},"privacy_policy_url":{"type":"string","title":"Privacy Policy Url","description":"Business's privacy policy URL."},"terms_and_conditions_url":{"type":"string","title":"Terms And Conditions Url","description":"Business's terms and conditions URL."},"age_gated_content":{"type":"boolean","title":"Age Gated Content","description":"Whether the campaign carries age-gated content."},"rejection_reasons":{"anyOf":[{"items":{"$ref":"#/components/schemas/TollfreeRejectionReasonDict"},"type":"array"},{"type":"null"}],"title":"Rejection Reasons","description":"Populated when TWILIO_REJECTED: {code, description} entries resolved from\nthe rejection event's error codes."},"edit_allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Edit Allowed","description":"When TWILIO_REJECTED: true → resubmit issues a Twilio update (auto-flips\nto pending-review); false → resubmit deletes + recreates the underlying\nverification. NULL otherwise."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["phone_number_id","status","business_name","business_website","business_type","business_registration_number","business_registration_authority","business_registration_country","use_case_categories","use_case_summary","production_message_sample","opt_in_proof_filenames","opt_in_type","opt_in_confirmation_message","message_volume","additional_information","privacy_policy_url","terms_and_conditions_url","age_gated_content","rejection_reasons","edit_allowed","created_at","updated_at"],"title":"TollfreeVerificationResponse","description":"Toll-Free Verification attached to a phone number."},"TollfreeVerificationStatus":{"type":"string","enum":["pending-review","in-review","twilio-approved","twilio-rejected"],"title":"TollfreeVerificationStatus","description":"TFV status, distinct from SetupStepStatus (its own Twilio product,\nEvent-Streams-delivered). Transitions are inferred from the CloudEvent type,\nnever from a `verificationstatus` payload field."},"TwilioA2PCampaignError":{"properties":{"code":{"type":"integer","title":"Code"},"description":{"type":"string","title":"Description"}},"type":"object","required":["code","description"],"title":"TwilioA2PCampaignError","description":"Entry in the campaign-failure event's `campaignregistrationerrors`,\nprojected to `{code, description}`. Field names are our projection, NOT the\nwire shape — a deliberate divergence from `A2PBrandRegistrationError` (this\ncolumn is read often, e.g. the NON_REMEDIABLE_CAMPAIGN_ERROR_CODES gate)."},"TwilioA2PCampaignStatus":{"type":"string","enum":["IN_PROGRESS","VERIFIED","FAILED","SUSPENDED"],"title":"TwilioA2PCampaignStatus","description":"A2P 10DLC campaign-registration lifecycle, driven by Event Streams.\nSUSPENDED has no automated setter (reserved for future send-time-error\nreconciliation)."},"TwilioInboundVoiceUseCaseRequest":{"properties":{"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\"). Pairs with\n`name` to form the documentation-facing (entity_name, name) identifier —\nUNIQUE across the table."},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Required; immutable after create."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Required; immutable after create."},"channel":{"type":"string","const":"inbound_voice","title":"Channel","description":"Always \"inbound_voice\" for this variant."},"twilio_setup_id":{"type":"string","format":"uuid","title":"Twilio Setup Id","description":"Twilio setup the use case binds to. The setup's customer profile must\nbe TWILIO_APPROVED."},"inbound_voice_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Inbound Voice Url"},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url","description":"Where channel-manager posts this call's lifecycle events. Omitted/NULL leaves\nthe use case un-orchestrated — its voice_url still points at an external framework."},"allowed_forwarding_numbers":{"items":{"type":"string","format":"phone"},"type":"array","maxItems":100,"title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; an empty list denies all\nforwarding. Required — the caller commits the forwarding policy at create."}},"type":"object","required":["entity_name","name","environment","region","channel","twilio_setup_id","inbound_voice_url","allowed_forwarding_numbers"],"title":"TwilioInboundVoiceUseCaseRequest","description":"Request body for the Twilio inbound voice channel."},"TwilioInboundVoiceUseCaseUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description. Supply `null` to clear it, omit to leave it\nunchanged."},"channel":{"type":"string","const":"inbound_voice","title":"Channel"},"inbound_voice_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Inbound Voice Url"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"Lifecycle-event destination; the opt-in to CM orchestration. Not clearable."},"allowed_forwarding_numbers":{"items":{"type":"string","format":"phone"},"type":"array","maxItems":100,"title":"Allowed Forwarding Numbers","description":"Replace the forwarding allowlist wholesale (see create); omit to leave unchanged."}},"type":"object","required":["channel"],"title":"TwilioInboundVoiceUseCaseUpdateRequest"},"TwilioNumberType":{"type":"string","enum":["local","mobile","toll-free","national"]},"TwilioOutboundVoiceUseCaseRequest":{"properties":{"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\"). Pairs with\n`name` to form the documentation-facing (entity_name, name) identifier —\nUNIQUE across the table."},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Required; immutable after create."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Required; immutable after create."},"channel":{"type":"string","const":"outbound_voice","title":"Channel","description":"Always \"outbound_voice\" for this variant."},"twilio_setup_id":{"type":"string","format":"uuid","title":"Twilio Setup Id","description":"Twilio setup the use case binds to. The setup's customer profile must\nbe TWILIO_APPROVED."},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url","description":"Where channel-manager posts this call's lifecycle events. Omitted/NULL leaves\nthe use case un-orchestrated — the framework drives Twilio itself."},"allowed_forwarding_numbers":{"items":{"type":"string","format":"phone"},"type":"array","maxItems":100,"title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; an empty list denies all\nforwarding. Required — the caller commits the forwarding policy at create."}},"type":"object","required":["entity_name","name","environment","region","channel","twilio_setup_id","allowed_forwarding_numbers"],"title":"TwilioOutboundVoiceUseCaseRequest","description":"Request body for the Twilio outbound voice channel."},"TwilioOutboundVoiceUseCaseUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description. Supply `null` to clear it, omit to leave it\nunchanged."},"channel":{"type":"string","const":"outbound_voice","title":"Channel"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"Lifecycle-event destination; the opt-in to CM orchestration. Not clearable."},"allowed_forwarding_numbers":{"items":{"type":"string","format":"phone"},"type":"array","maxItems":100,"title":"Allowed Forwarding Numbers","description":"Replace the forwarding allowlist wholesale (see create); omit to leave unchanged."}},"type":"object","required":["channel"],"title":"TwilioOutboundVoiceUseCaseUpdateRequest"},"TwilioPhoneNumberCapability":{"type":"string","enum":["voice","sms","mms"]},"TwilioPhoneNumberResponse":{"properties":{"id":{"type":"string","title":"Id"},"setup_id":{"type":"string","title":"Setup Id"},"use_case_ids":{"items":{"type":"string"},"type":"array","title":"Use Case Ids","description":"Top-level use_cases.id values assigned to this phone, merged from both\nthe voice and SMS assignment tables (empty if unassigned)."},"phone_number":{"type":"string","title":"Phone Number","description":"E.164 phone number."},"country":{"type":"string","title":"Country","description":"ISO 3166-1 alpha-2 country code."},"number_type":{"$ref":"#/components/schemas/TwilioNumberType","description":"Phone number type — local, mobile, toll-free, or national."},"capabilities":{"items":{"$ref":"#/components/schemas/TwilioPhoneNumberCapability"},"type":"array","title":"Capabilities","description":"Capabilities reported by Twilio for this phone number."},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","setup_id","use_case_ids","phone_number","country","number_type","capabilities","created_at"],"title":"TwilioPhoneNumberResponse"},"TwilioSetupBundleResponse":{"properties":{"id":{"type":"string","title":"Id"},"setup_id":{"type":"string","title":"Setup Id"},"bundle_kind":{"$ref":"#/components/schemas/BundleKind","description":"Which kind of bundle this is (shaken_stir, cnam, a2p_messaging_profile, or\nregulatory), derived from the underlying Twilio policy."},"status":{"$ref":"#/components/schemas/SetupStepStatus","description":"Current verification status."},"entities":{"items":{"oneOf":[{"$ref":"#/components/schemas/EndUserEntity"},{"$ref":"#/components/schemas/SupportingDocumentEntity"}],"discriminator":{"propertyName":"entity_kind","mapping":{"end_user":"#/components/schemas/EndUserEntity","supporting_document":"#/components/schemas/SupportingDocumentEntity"}}},"type":"array","title":"Entities","description":"The EndUser / SupportingDocument attributes we submitted for this bundle."},"last_failure":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Last Failure","description":"Human-readable failure strings from the latest noncompliant eval or\nwebhook rejection. NULL when healthy."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","setup_id","bundle_kind","status","entities","created_at","updated_at"],"title":"TwilioSetupBundleResponse","description":"Single Trust Hub trust product / regulatory bundle attached to a setup."},"TwilioSetupResponse":{"properties":{"id":{"type":"string","title":"Id"},"friendly_name":{"type":"string","title":"Friendly Name","description":"Human-readable label for this Twilio setup."},"customer_profile":{"$ref":"#/components/schemas/CustomerProfileStatusDetail","description":"Trust Hub customer profile state. Bundle state lives at GET /bundle."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","friendly_name","customer_profile","created_at","updated_at"],"title":"TwilioSetupResponse","description":"Response for a single Twilio setup. Returned by create, get, update, and list."},"TwilioSmsStatus":{"type":"string","enum":["pending","sent","delivered","failed","undelivered"],"title":"TwilioSmsStatus"},"TwilioSmsUseCaseRequest":{"properties":{"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\"). Pairs with\n`name` to form the documentation-facing (entity_name, name) identifier —\nUNIQUE across the table."},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Required; immutable after create."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Required; immutable after create."},"channel":{"type":"string","const":"sms","title":"Channel","description":"Always \"sms\" for this variant."},"twilio_setup_id":{"type":"string","format":"uuid","title":"Twilio Setup Id","description":"Twilio setup the use case binds to. The setup's customer profile must\nbe TWILIO_APPROVED. A Twilio Messaging Service is minted on the setup's\nsubaccount at create time; phone-number attachment happens at\nassign-phone-number time."},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"Destination this binding's inbound turns are POSTed to. On each inbound\nSMS, channel-manager sends the CanonicalInboundEnvelope here; the receiver\nmust speak platform-api's `/v1/internal/channel/turn` contract. Per-binding,\nso each channel of a use case can route to a different consumer. Required\nat create."}},"type":"object","required":["entity_name","name","environment","region","channel","twilio_setup_id","webhook_url"],"title":"TwilioSmsUseCaseRequest","description":"Request body for the Twilio SMS channel."},"TwilioSmsUseCaseUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description. Supply `null` to clear it, omit to leave it\nunchanged."},"channel":{"type":"string","const":"sms","title":"Channel"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"New inbound-turn destination for this SMS binding (see the create\nrequest's `webhook_url`). Omit to leave it unchanged."}},"type":"object","required":["channel"],"title":"TwilioSmsUseCaseUpdateRequest"},"UseCaseResponse":{"oneOf":[{"$ref":"#/components/schemas/src__routes__use_case__response__TwilioInboundVoiceUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__response__TwilioOutboundVoiceUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__response__TwilioSmsUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__response__EmailUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__response__SendBlueUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__response__WhatsAppUseCaseResponse"}],"discriminator":{"propertyName":"channel","mapping":{"email":"#/components/schemas/src__routes__use_case__response__EmailUseCaseResponse","imessage":"#/components/schemas/src__routes__use_case__response__SendBlueUseCaseResponse","inbound_voice":"#/components/schemas/src__routes__use_case__response__TwilioInboundVoiceUseCaseResponse","outbound_voice":"#/components/schemas/src__routes__use_case__response__TwilioOutboundVoiceUseCaseResponse","sms":"#/components/schemas/src__routes__use_case__response__TwilioSmsUseCaseResponse","whatsapp":"#/components/schemas/src__routes__use_case__response__WhatsAppUseCaseResponse"}}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoMessageRequest":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_bsuid":{"type":"string","maxLength":130,"minLength":3,"title":"To Bsuid"},"message_type":{"type":"string","const":"video","title":"Message Type"},"media_attachment":{"type":"string","contentMediaType":"application/octet-stream","title":"Media Attachment"},"message":{"anyOf":[{"type":"string","maxLength":1024,"minLength":1},{"type":"null"}],"title":"Message"},"target_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Message Id"}},"type":"object","required":["use_case_id","to_bsuid","message_type","media_attachment"],"title":"VideoMessageRequest"},"VoiceAmdResult":{"type":"string","enum":["human","fax","unknown","machine_start","machine_end_beep","machine_end_silence","machine_end_other"],"title":"VoiceAmdResult","description":"Twilio AMD AnsweredBy verdict; the machine_end_* variants need DetectMessageEnd."},"VoiceCallDirection":{"type":"string","enum":["inbound","outbound"],"title":"VoiceCallDirection"},"VoiceDialStatus":{"type":"string","enum":["answered","no_answer","busy","failed"],"title":"VoiceDialStatus","description":"Terminal outcome of a dial leg (our vocabulary, not Twilio's CallStatus).\nThe human/machine verdict is answered_by — an AMD machine leg still `answered`."},"VoiceParticipantKind":{"type":"string","enum":["inbound","dial","media"],"title":"VoiceParticipantKind","description":"How a leg came to be in the conference — NOT who it is (that is role)."},"VoiceParticipantRole":{"type":"string","enum":["caller","agent","operator","transfer_target","callee"],"title":"VoiceParticipantRole"},"WhatsAppTemplateCategory":{"type":"string","enum":["marketing","utility"]},"WhatsAppUseCaseRequest":{"properties":{"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\"). Pairs with\n`name` to form the documentation-facing (entity_name, name) identifier —\nUNIQUE across the table."},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Required; immutable after create."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Required; immutable after create."},"channel":{"type":"string","const":"whatsapp","title":"Channel"},"whatsapp_setup_id":{"type":"string","format":"uuid","title":"Whatsapp Setup Id"},"phone_number_id":{"type":"string","maxLength":16,"minLength":16,"pattern":"^\\d+$","title":"Phone Number Id"},"phone_number_pin":{"type":"string","maxLength":6,"minLength":6,"pattern":"^\\d+$","title":"Phone Number Pin"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url"}},"type":"object","required":["entity_name","name","environment","region","channel","whatsapp_setup_id","phone_number_id","phone_number_pin","webhook_url"],"title":"WhatsAppUseCaseRequest"},"WhatsAppUseCaseUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Free-text description. Supply `null` to clear it, omit to leave it\nunchanged."},"channel":{"type":"string","const":"whatsapp","title":"Channel"},"webhook_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Webhook Url","description":"New inbound-turn destination for this WhatsApp binding (see the create\nrequest's `webhook_url`). Omit to leave it unchanged."}},"type":"object","required":["channel"],"title":"WhatsAppUseCaseUpdateRequest"},"src__routes__auth__create_oauth2_client__Request":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9 _-]+$","title":"Name"},"description":{"type":"string","maxLength":256,"minLength":1,"title":"Description"},"granted_scopes":{"items":{"type":"string"},"type":"array","minItems":1,"uniqueItems":true,"title":"Granted Scopes"},"allowed_setup_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","uniqueItems":true},{"prefixItems":[{"type":"string","const":"*"}],"type":"array","maxItems":1,"minItems":1}],"minLength":1,"title":"Allowed Setup Ids"}},"type":"object","required":["name","description","granted_scopes","allowed_setup_ids"],"title":"Request"},"src__routes__auth__create_oauth2_client__Response":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret","description":"The raw secret — returned ONCE here and never again. Store it now."},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"granted_scopes":{"items":{"type":"string"},"type":"array","title":"Granted Scopes"},"allowed_setup_ids":{"items":{"type":"string"},"type":"array","title":"Allowed Setup Ids"}},"type":"object","required":["client_id","client_secret","name","description","granted_scopes","allowed_setup_ids"],"title":"Response"},"src__routes__auth__get_token__Request":{"properties":{"grant_type":{"type":"string","const":"client_credentials","title":"Grant Type"},"scope":{"type":"string","title":"Scope","description":"Space-delimited requested scopes (RFC 6749 §3.3); down-scoped to the grant."},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["grant_type","scope"],"title":"Request"},"src__routes__auth__get_token__Response":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","const":"bearer","title":"Token Type"},"expires_in":{"type":"integer","title":"Expires In"},"scope":{"type":"string","title":"Scope"}},"type":"object","required":["access_token","token_type","expires_in","scope"],"title":"Response"},"src__routes__auth__rotate_oauth2_client_secret__Response":{"properties":{"client_secret":{"type":"string","title":"Client Secret","description":"The new raw secret — returned ONCE here and never again. Store it now."}},"type":"object","required":["client_secret"],"title":"Response"},"src__routes__auth__update_oauth2_client__Request":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9 _-]+$","title":"Name"},"description":{"type":"string","maxLength":256,"minLength":1,"title":"Description"},"granted_scopes":{"items":{"type":"string"},"type":"array","minItems":1,"uniqueItems":true,"title":"Granted Scopes"},"allowed_setup_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","uniqueItems":true},{"prefixItems":[{"type":"string","const":"*"}],"type":"array","maxItems":1,"minItems":1}],"minLength":1,"title":"Allowed Setup Ids"}},"type":"object","title":"Request"},"src__routes__auth__update_oauth2_client__Response":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"granted_scopes":{"items":{"type":"string"},"type":"array","title":"Granted Scopes"},"allowed_setup_ids":{"items":{"type":"string"},"type":"array","title":"Allowed Setup Ids"}},"type":"object","required":["client_id","name","description","granted_scopes","allowed_setup_ids"],"title":"Response"},"src__routes__email__create_email_template__Request":{"properties":{"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9 _-]+$","title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":4096,"minLength":1},{"type":"null"}],"title":"Description"},"subject_template":{"type":"string","maxLength":256,"minLength":1,"title":"Subject Template"},"body_template":{"type":"string","maxLength":1000000,"minLength":1,"title":"Body Template"}},"type":"object","required":["ses_use_case_id","name","description","subject_template","body_template"],"title":"Request"},"src__routes__email__create_email_template__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"subject_template":{"type":"string","title":"Subject Template"},"body_template":{"type":"string","title":"Body Template"},"required_subject_variables":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Required Subject Variables"},"required_body_variables":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Required Body Variables"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","ses_use_case_id","subject_template","body_template","required_subject_variables","required_body_variables","created_at","updated_at"],"title":"Response"},"src__routes__email__get_email__Response":{"oneOf":[{"$ref":"#/components/schemas/InboundEmailResponse"},{"$ref":"#/components/schemas/OutboundEmailResponse"}],"discriminator":{"propertyName":"direction","mapping":{"inbound":"#/components/schemas/InboundEmailResponse","outbound":"#/components/schemas/OutboundEmailResponse"}}},"src__routes__email__get_email_template__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"subject_template":{"type":"string","title":"Subject Template"},"body_template":{"type":"string","title":"Body Template"},"required_subject_variables":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Required Subject Variables"},"required_body_variables":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Required Body Variables"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","ses_use_case_id","subject_template","body_template","required_subject_variables","required_body_variables","created_at","updated_at"],"title":"Response"},"src__routes__email__list_email_events__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__email__list_email_events__Response__Item"},"type":"array","title":"Items","description":"The events matching the request filters."},"has_more":{"type":"boolean","title":"Has More","description":"Whether there are more events to retrieve."},"continuation_token":{"title":"Continuation Token","description":"Opaque token to pass back on the next page request; null when no more results."}},"type":"object","required":["items","has_more"],"title":"Response"},"src__routes__email__list_email_events__Response__Item":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"The ID of the event row."},"email_id":{"type":"string","format":"uuid","title":"Email Id","description":"The email this event was projected onto."},"event_type":{"$ref":"#/components/schemas/EventType","description":"The SES event type."},"event_at":{"type":"string","format":"date-time","title":"Event At","description":"Vendor-supplied timestamp from the SES event body."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When channel-manager projected the event."}},"type":"object","required":["id","email_id","event_type","event_at","created_at"],"title":"Item"},"src__routes__email__list_email_events___SortField":{"type":"string","const":"event_at"},"src__routes__email__list_email_templates__Response":{"properties":{"email_templates":{"items":{"$ref":"#/components/schemas/EmailTemplateItem"},"type":"array","title":"Email Templates"}},"type":"object","required":["email_templates"],"title":"Response"},"src__routes__email__list_emails__Response":{"properties":{"items":{"items":{"oneOf":[{"$ref":"#/components/schemas/OutboundEmailItem"},{"$ref":"#/components/schemas/InboundEmailItem"}],"discriminator":{"propertyName":"direction","mapping":{"inbound":"#/components/schemas/InboundEmailItem","outbound":"#/components/schemas/OutboundEmailItem"}}},"type":"array","title":"Items","description":"The emails matching the request filters, inbound + outbound interleaved\nunless `direction` was supplied."},"has_more":{"type":"boolean","title":"Has More","description":"Whether there are more emails to retrieve."},"continuation_token":{"title":"Continuation Token","description":"Opaque token to pass back on the next page request. Null when\nthere are no more results."}},"type":"object","required":["items","has_more","continuation_token"],"title":"Response"},"src__routes__email__list_emails___SortField":{"type":"string","const":"created_at"},"src__routes__email__send_email__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Our row id (also passed to SES as EmailTag.amigo_email_id)."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When SendEmail returned and the row landed."},"attachment_filenames":{"items":{"type":"string"},"type":"array","title":"Attachment Filenames","description":"Filenames in send-time order, matching each attachment's S3 key suffix."},"replied_to_inbound_email_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Replied To Inbound Email Id","description":"The inbound row's id when this send replied to one of our inbound emails; NULL otherwise."}},"type":"object","required":["id","created_at","attachment_filenames","replied_to_inbound_email_id"],"title":"Response"},"src__routes__email__update_email_template__Request":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9 _-]+$","title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":4096,"minLength":1},{"type":"null"}],"title":"Description"},"subject_template":{"type":"string","maxLength":256,"minLength":1,"title":"Subject Template"},"body_template":{"type":"string","maxLength":1000000,"minLength":1,"title":"Body Template"}},"type":"object","title":"Request"},"src__routes__email__update_email_template__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ses_use_case_id":{"type":"string","format":"uuid","title":"Ses Use Case Id"},"subject_template":{"type":"string","title":"Subject Template"},"body_template":{"type":"string","title":"Body Template"},"required_subject_variables":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Required Subject Variables"},"required_body_variables":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Required Body Variables"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","ses_use_case_id","subject_template","body_template","required_subject_variables","required_body_variables","created_at","updated_at"],"title":"Response"},"src__routes__imessage__list_messages__Response":{"properties":{"items":{"items":{"oneOf":[{"$ref":"#/components/schemas/src__routes__imessage__messages__InboundMessage"},{"$ref":"#/components/schemas/src__routes__imessage__messages__OutboundMessage"}],"discriminator":{"propertyName":"direction","mapping":{"inbound":"#/components/schemas/src__routes__imessage__messages__InboundMessage","outbound":"#/components/schemas/src__routes__imessage__messages__OutboundMessage"}}},"type":"array","title":"Items","description":"Rows ordered (occurred_at DESC, id DESC); interleaved unless `direction` was supplied."},"has_more":{"type":"boolean","title":"Has More","description":"Whether there are more rows to retrieve."},"continuation_token":{"title":"Continuation Token","description":"Opaque token to pass back on the next page request. Null when there are no more results."}},"type":"object","required":["items","has_more"],"title":"Response"},"src__routes__imessage__list_messages___SortField":{"type":"string","const":"occurred_at"},"src__routes__imessage__messages__InboundMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Row id; also the S3 key prefix `imessage/{id}/{filename}` for media."},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id","description":"Top-level `channel.use_cases.id`, not the SendBlue-side id."},"from_number":{"type":"string","title":"From Number","description":"E.164 sender (outbound: our line; inbound: the foreign sender)."},"to_number":{"type":"string","title":"To Number","description":"E.164 recipient (outbound: the foreign recipient; inbound: our line)."},"content":{"type":"string","title":"Content","description":"Text content. Empty string for media-only messages."},"has_media":{"type":"boolean","title":"Has Media","description":"True when media is stored; fetch via `GET /v1/imessage/{id}/media`."},"service":{"anyOf":[{"$ref":"#/components/schemas/SendBlueMessageService"},{"type":"null"}],"description":"SendBlue's service classification; NULL on outbound until the terminal-delivery webhook lands."},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At","description":"Send time (outbound) or receive time (inbound); list orders by this DESC. Not a carrier delivery time."},"direction":{"type":"string","const":"inbound","title":"Direction","default":"inbound"}},"type":"object","required":["id","use_case_id","from_number","to_number","content","has_media","service","occurred_at"],"title":"InboundMessage","description":"An inbound row projection."},"src__routes__imessage__messages__OutboundMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Row id; also the S3 key prefix `imessage/{id}/{filename}` for media."},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id","description":"Top-level `channel.use_cases.id`, not the SendBlue-side id."},"from_number":{"type":"string","title":"From Number","description":"E.164 sender (outbound: our line; inbound: the foreign sender)."},"to_number":{"type":"string","title":"To Number","description":"E.164 recipient (outbound: the foreign recipient; inbound: our line)."},"content":{"type":"string","title":"Content","description":"Text content. Empty string for media-only messages."},"has_media":{"type":"boolean","title":"Has Media","description":"True when media is stored; fetch via `GET /v1/imessage/{id}/media`."},"service":{"anyOf":[{"$ref":"#/components/schemas/SendBlueMessageService"},{"type":"null"}],"description":"SendBlue's service classification; NULL on outbound until the terminal-delivery webhook lands."},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At","description":"Send time (outbound) or receive time (inbound); list orders by this DESC. Not a carrier delivery time."},"direction":{"type":"string","const":"outbound","title":"Direction","default":"outbound"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At","description":"Set on the first terminal `DELIVERED` / `SENT` webhook. NULL until then."},"errored_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Errored At","description":"Set on the first terminal `ERROR` / `DECLINED` webhook; mutually exclusive with `delivered_at`."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Free-text SendBlue failure description. NULL when not errored."},"was_downgraded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Was Downgraded","description":"True when SendBlue downgraded iMessage → SMS; NULL until the terminal-delivery webhook lands."},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At","description":"When SendBlue accepted and sent the message."}},"type":"object","required":["id","use_case_id","from_number","to_number","content","has_media","service","occurred_at","delivered_at","errored_at","error_message","was_downgraded","sent_at"],"title":"OutboundMessage","description":"An outbound row projection, plus terminal-delivery columns."},"src__routes__outbound_voice__select_outbound_voice_phone_number__Request":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id","description":"Top-level use case to pick a sender for; must be outbound_voice."}},"type":"object","required":["use_case_id"],"title":"Request"},"src__routes__sendblue__create_sendblue_setup__Request":{"properties":{"friendly_name":{"type":"string","maxLength":256,"minLength":1,"title":"Friendly Name","description":"Operator-facing label for this subaccount."},"company_name":{"type":"string","maxLength":256,"minLength":1,"title":"Company Name","description":"Name passed to SendBlue when creating the child account. SendBlue\nauto-prefixes the parent-account email at creation time, so the value\nwe read back on `subaccount_company_name` is `<parent-email>-<name>`."}},"type":"object","required":["friendly_name","company_name"],"title":"Request","description":"Request body for POST /v1/sendblue-setup."},"src__routes__sendblue__list_phone_numbers__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SendBluePhoneNumberResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"Response","description":"Every line under the setup matching the requested status filter."},"src__routes__ses_setup__create_ses_setup__Request":{"properties":{"tenant_name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Tenant Name","description":"SES tenant name (reputation + suppression boundary). Unique per AWS\naccount and in our DB."},"domain_identity":{"type":"string","title":"Domain Identity","description":"Domain verified for both sending and receiving (one SES identity serves\nboth). Normalized (lowercased, IDNA) at the boundary."}},"type":"object","required":["tenant_name","domain_identity"],"title":"Request"},"src__routes__sms__get_sms_message__InboundMessage":{"properties":{"direction":{"type":"string","const":"inbound","title":"Direction","default":"inbound"},"id":{"type":"string","format":"uuid","title":"Id"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"from_number":{"type":"string","title":"From Number"},"to_number":{"type":"string","title":"To Number"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"num_segments":{"type":"integer","title":"Num Segments"},"attachment_names":{"items":{"type":"string"},"type":"array","title":"Attachment Names"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","use_case_id","from_number","to_number","body","num_segments","attachment_names","created_at"],"title":"InboundMessage"},"src__routes__sms__get_sms_message__OutboundMessage":{"properties":{"direction":{"type":"string","const":"outbound","title":"Direction","default":"outbound"},"id":{"type":"string","format":"uuid","title":"Id"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number","description":"NULL at INSERT — when sending via messaging_service_sid Twilio doesn't\npick a sender until queueing; the `queued` callback backfills it."},"to_number":{"type":"string","title":"To Number"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"num_segments":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Num Segments","description":"NULL until `sent` callback — Twilio computes segments at carrier handoff."},"status":{"$ref":"#/components/schemas/TwilioSmsStatus"},"attachment_names":{"items":{"type":"string"},"type":"array","title":"Attachment Names"},"handed_off_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Handed Off At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"errored_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Errored At"},"error_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Error Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","use_case_id","from_number","to_number","body","num_segments","status","attachment_names","handed_off_at","delivered_at","errored_at","error_code","created_at","updated_at"],"title":"OutboundMessage"},"src__routes__sms__get_sms_message__Response":{"oneOf":[{"$ref":"#/components/schemas/src__routes__sms__get_sms_message__OutboundMessage"},{"$ref":"#/components/schemas/src__routes__sms__get_sms_message__InboundMessage"}],"discriminator":{"propertyName":"direction","mapping":{"inbound":"#/components/schemas/src__routes__sms__get_sms_message__InboundMessage","outbound":"#/components/schemas/src__routes__sms__get_sms_message__OutboundMessage"}}},"src__routes__sms__list_sms_messages__Response":{"properties":{"items":{"items":{"oneOf":[{"$ref":"#/components/schemas/src__routes__sms__list_sms_messages__Response__OutboundMessage"},{"$ref":"#/components/schemas/src__routes__sms__list_sms_messages__Response__InboundMessage"}],"discriminator":{"propertyName":"direction","mapping":{"inbound":"#/components/schemas/src__routes__sms__list_sms_messages__Response__InboundMessage","outbound":"#/components/schemas/src__routes__sms__list_sms_messages__Response__OutboundMessage"}}},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more","continuation_token"],"title":"Response"},"src__routes__sms__list_sms_messages__Response__InboundMessage":{"properties":{"direction":{"type":"string","const":"inbound","title":"Direction","default":"inbound"},"id":{"type":"string","format":"uuid","title":"Id"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"from_number":{"type":"string","title":"From Number"},"to_number":{"type":"string","title":"To Number"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"num_segments":{"type":"integer","title":"Num Segments"},"num_attachments":{"type":"integer","title":"Num Attachments"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","use_case_id","from_number","to_number","body","num_segments","num_attachments","created_at"],"title":"InboundMessage"},"src__routes__sms__list_sms_messages__Response__OutboundMessage":{"properties":{"direction":{"type":"string","const":"outbound","title":"Direction","default":"outbound"},"id":{"type":"string","format":"uuid","title":"Id"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number","description":"NULL at INSERT — when sending via messaging_service_sid Twilio doesn't\npick a sender until queueing; the `queued` callback backfills it."},"to_number":{"type":"string","title":"To Number"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"num_segments":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Num Segments","description":"NULL until `sent` callback — Twilio computes segments at carrier handoff."},"status":{"$ref":"#/components/schemas/TwilioSmsStatus"},"num_attachments":{"type":"integer","title":"Num Attachments"},"handed_off_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Handed Off At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"errored_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Errored At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","use_case_id","from_number","to_number","body","num_segments","status","num_attachments","handed_off_at","delivered_at","errored_at","created_at","updated_at"],"title":"OutboundMessage"},"src__routes__sms__list_sms_setup_opt_outs__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__sms__list_sms_setup_opt_outs__Response__Item"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more","continuation_token"],"title":"Response"},"src__routes__sms__list_sms_setup_opt_outs__Response__Item":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"phone_number":{"type":"string","title":"Phone Number"},"opted_out_use_case_id":{"type":"string","format":"uuid","title":"Opted Out Use Case Id","description":"The SMS use case whose inbound STOP recorded this opt-out."},"opted_out_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Opted Out Message Id","description":"The inbound message that triggered it; NULL once that message is erased."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Non-NULL only on a cleared opt-out (via remove-setup-opt-out)."},"delete_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delete Reason","description":"Operator justification recorded when the opt-out was cleared."}},"type":"object","required":["id","setup_id","phone_number","opted_out_use_case_id","opted_out_message_id","created_at","deleted_at","delete_reason"],"title":"Item"},"src__routes__sms__remove_sms_setup_opt_out__Request":{"properties":{"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"user_phone_number":{"type":"string","format":"phone","title":"User Phone Number"},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason","description":"Required, non-empty: this is the audit record of why the STOP was reversed."}},"type":"object","required":["setup_id","user_phone_number","reason"],"title":"Request"},"src__routes__sms__send_sms_message__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number","description":"NULL at INSERT — when sending via messaging_service_sid Twilio doesn't\npick a sender until queueing; the `queued` callback backfills it."},"to_number":{"type":"string","title":"To Number"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"num_segments":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Num Segments","description":"NULL until `sent` callback — Twilio computes segments at carrier handoff."},"status":{"$ref":"#/components/schemas/TwilioSmsStatus"},"attachment_names":{"items":{"type":"string"},"type":"array","title":"Attachment Names"},"handed_off_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Handed Off At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"errored_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Errored At"},"error_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Error Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","use_case_id","from_number","to_number","body","num_segments","status","attachment_names","handed_off_at","delivered_at","errored_at","error_code","created_at","updated_at"],"title":"Response"},"src__routes__sms__send_sms_opt_in_message__Request":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"to_phone_number":{"type":"string","format":"phone","title":"To Phone Number"}},"type":"object","required":["use_case_id","to_phone_number"],"title":"Request"},"src__routes__twilio__create_twilio_setup__Request":{"properties":{"friendly_name":{"type":"string","maxLength":256,"minLength":1,"title":"Friendly Name","description":"Human label for this setup."},"business_name":{"type":"string","maxLength":256,"minLength":1,"title":"Business Name","description":"Legal business name as registered."},"business_type":{"$ref":"#/components/schemas/BusinessType","description":"Legal structure of the business."},"business_industry":{"$ref":"#/components/schemas/BusinessIndustry","description":"Industry vertical for Twilio Trust Hub classification."},"business_identity":{"$ref":"#/components/schemas/BusinessIdentity","description":"Relationship to Twilio (direct customer or ISV/reseller).","default":"direct_customer"},"business_registration_identifier":{"$ref":"#/components/schemas/BusinessRegistrationIdentifier","description":"Type of registration ID (e.g. EIN, DUNS, VAT)."},"business_registration_number":{"type":"string","maxLength":32,"minLength":1,"title":"Business Registration Number","description":"Registration number matching the identifier type."},"business_regions_of_operation":{"$ref":"#/components/schemas/BusinessRegion","description":"Geographic region where the business operates."},"website_url":{"type":"string","maxLength":2048,"minLength":1,"title":"Website Url","description":"Business website URL."},"business_address":{"$ref":"#/components/schemas/BusinessAddress","description":"Registered business address."},"authorized_representative":{"$ref":"#/components/schemas/AuthorizedRepresentative","description":"Person Twilio can contact for verification."}},"type":"object","required":["friendly_name","business_name","business_type","business_industry","business_registration_identifier","business_registration_number","business_regions_of_operation","website_url","business_address","authorized_representative"],"title":"Request","description":"Request body for POST /v1/twilio-setup."},"src__routes__twilio__get_regulation__Response":{"properties":{"sid":{"type":"string","title":"Sid","description":"Twilio regulation SID (RN...). Pass back as `regulation_sid` on POST /bundle/regulatory."},"friendly_name":{"type":"string","title":"Friendly Name"},"iso_country":{"type":"string","title":"Iso Country"},"number_type":{"$ref":"#/components/schemas/TwilioNumberType"},"end_user_type":{"type":"string","title":"End User Type","description":"Always \"business\"."},"requirements":{"$ref":"#/components/schemas/Requirements"}},"type":"object","required":["sid","friendly_name","iso_country","number_type","end_user_type","requirements"],"title":"Response","description":"Twilio regulation + full requirements; walk `requirements` to assemble the\nPOST /bundle/regulatory payload."},"src__routes__twilio__list_available_phone_numbers__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__twilio__list_available_phone_numbers__Response__Item"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"Response"},"src__routes__twilio__list_available_phone_numbers__Response__Item":{"properties":{"phone_number":{"type":"string","title":"Phone Number","description":"E.164 phone number."},"friendly_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Friendly Name","description":"Formatted display name."},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality","description":"City name."},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region","description":"State or province code."},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code","description":"ZIP or postal code."},"iso_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iso Country","description":"ISO 3166-1 alpha-2 country code."}},"type":"object","required":["phone_number"],"title":"Item"},"src__routes__twilio__list_phone_numbers__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TwilioPhoneNumberResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"Response"},"src__routes__twilio__list_twilio_setup_bundles__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TwilioSetupBundleResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"Response","description":"Bundles matching the filter, with status + last_failure; empty when none created yet."},"src__routes__twilio__provision_phone_number__Request":{"properties":{"phone_number":{"type":"string","format":"phone","title":"Phone Number","description":"E.164 phone number to purchase."},"country":{"type":"string","pattern":"^\\w{2}$","title":"Country","description":"ISO 3166-1 alpha-2. Drives Trust Hub gating and the Regulatory Compliance lookup."},"number_type":{"$ref":"#/components/schemas/TwilioNumberType","description":"Phone number type. `national` reuses the `.local` subresource with a\nprefix filter (see NATIONAL_PREFIXES)."}},"type":"object","required":["phone_number","country","number_type"],"title":"Request"},"src__routes__twilio__submit_a2p_brand_registration__Request":{"properties":{"brand_type":{"$ref":"#/components/schemas/A2PBrandRegistrationType","description":"Standard or Low-Volume Standard. Non-profit / government brands MUST be\nStandard (LVS → 422 here despite Twilio's silent acceptance)."}},"type":"object","required":["brand_type"],"title":"Request","description":"Request body for POST /v1/twilio-setup/{id}/bundle/a2p-brand-registration."},"src__routes__twilio__submit_a2p_messaging_profile__Request":{"properties":{"company_type":{"$ref":"#/components/schemas/CompanyType","description":"Legal structure of the brand."},"stock_exchange":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Stock Exchange","description":"Required when company_type == 'public', omitted otherwise. Bad values\nsurface as a noncompliant evaluation, not a validation error."},"stock_ticker":{"anyOf":[{"type":"string","maxLength":16,"minLength":1},{"type":"null"}],"title":"Stock Ticker","description":"Required when company_type == 'public'; must be omitted otherwise."},"brand_contact_email":{"type":"string","format":"email","title":"Brand Contact Email","description":"Email TCR uses for brand correspondence."}},"type":"object","required":["company_type","brand_contact_email"],"title":"Request","description":"Request body for POST /v1/twilio-setup/{id}/bundle/a2p-messaging-profile."},"src__routes__twilio__submit_cnam__Request":{"properties":{"display_name":{"type":"string","maxLength":15,"minLength":1,"title":"Display Name","description":"Caller ID name shown on the recipient's device (max 15 chars)."}},"type":"object","required":["display_name"],"title":"Request","description":"Request body for POST /v1/twilio-setup/{id}/bundle/cnam."},"src__routes__twilio__update_twilio_setup__Request":{"properties":{"business_name":{"type":"string","maxLength":256,"minLength":1,"title":"Business Name","description":"Legal business name as registered."},"business_type":{"$ref":"#/components/schemas/BusinessType","description":"Legal structure of the business."},"business_industry":{"$ref":"#/components/schemas/BusinessIndustry","description":"Industry vertical for Twilio Trust Hub classification."},"business_identity":{"$ref":"#/components/schemas/BusinessIdentity","description":"Relationship to Twilio (direct customer or ISV/reseller).","default":"direct_customer"},"business_registration_identifier":{"$ref":"#/components/schemas/BusinessRegistrationIdentifier","description":"Type of registration ID (e.g. EIN, DUNS, VAT)."},"business_registration_number":{"type":"string","maxLength":32,"minLength":1,"title":"Business Registration Number","description":"Registration number matching the identifier type."},"business_regions_of_operation":{"$ref":"#/components/schemas/BusinessRegion","description":"Geographic region where the business operates."},"website_url":{"type":"string","maxLength":2048,"minLength":1,"title":"Website Url","description":"Business website URL."},"business_address":{"$ref":"#/components/schemas/BusinessAddress","description":"Updated business address."},"authorized_representative":{"$ref":"#/components/schemas/AuthorizedRepresentative","description":"Updated authorized representative details."}},"type":"object","required":["business_name","business_type","business_industry","business_registration_identifier","business_registration_number","business_regions_of_operation","website_url","business_address","authorized_representative"],"title":"Request","description":"Request body for PUT /v1/twilio-setup/{id}."},"src__routes__twilio__validate_twilio_webhook__Request":{"properties":{"callback_url":{"type":"string","title":"Callback Url","description":"The exact URL Twilio signed, byte-for-byte — a mismatch fails validation."},"params":{"additionalProperties":{"type":"string"},"type":"object","title":"Params","description":"The webhook's POST parameters, exactly as Twilio sent them."},"signature":{"type":"string","title":"Signature","description":"The inbound request's ``X-Twilio-Signature`` header value."}},"type":"object","required":["callback_url","params","signature"],"title":"Request"},"src__routes__twilio__validate_twilio_webhook__Response":{"properties":{"valid":{"type":"boolean","title":"Valid","description":"Whether ``signature`` is valid for this setup's subaccount auth token."}},"type":"object","required":["valid"],"title":"Response"},"src__routes__use_case__create_use_case__EmailUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","const":"email","title":"Channel"},"ses_setup_id":{"type":"string","title":"Ses Setup Id"},"sender_email_address":{"type":"string","title":"Sender Email Address","description":"Explicit From address for outbound sends."},"sender_email_alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email Alias"},"email_type":{"$ref":"#/components/schemas/EmailType"},"tier":{"$ref":"#/components/schemas/EmailTier","description":"Current reputation tier. Mutated by the re-tiering cron based on\nsend / bounce / complaint metrics."},"unsubscribable":{"type":"boolean","title":"Unsubscribable","description":"When true, sends from this use case carry RFC 8058 List-Unsubscribe\nheaders + a footer with use-case + setup unsubscribe links, and the\nper-use-case unsubscribe table is consulted at send time. Marketing\nuse cases are always true; transactional may opt out for must-send\nflows like password reset."},"inbound_mode":{"$ref":"#/components/schemas/EmailInboundMode","description":"What inbound this use case accepts (see the create request)."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"type":"string","title":"Webhook Secret"}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","channel","ses_setup_id","sender_email_address","sender_email_alias","email_type","tier","unsubscribable","inbound_mode","webhook_url","webhook_secret"],"title":"EmailUseCaseResponse"},"src__routes__use_case__create_use_case__Request":{"oneOf":[{"$ref":"#/components/schemas/TwilioInboundVoiceUseCaseRequest"},{"$ref":"#/components/schemas/TwilioOutboundVoiceUseCaseRequest"},{"$ref":"#/components/schemas/TwilioSmsUseCaseRequest"},{"$ref":"#/components/schemas/EmailUseCaseRequest"},{"$ref":"#/components/schemas/SendBlueUseCaseRequest"},{"$ref":"#/components/schemas/WhatsAppUseCaseRequest"}],"discriminator":{"propertyName":"channel","mapping":{"email":"#/components/schemas/EmailUseCaseRequest","imessage":"#/components/schemas/SendBlueUseCaseRequest","inbound_voice":"#/components/schemas/TwilioInboundVoiceUseCaseRequest","outbound_voice":"#/components/schemas/TwilioOutboundVoiceUseCaseRequest","sms":"#/components/schemas/TwilioSmsUseCaseRequest","whatsapp":"#/components/schemas/WhatsAppUseCaseRequest"}}},"src__routes__use_case__create_use_case__Response":{"oneOf":[{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__TwilioInboundVoiceUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__TwilioOutboundVoiceUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__TwilioSmsUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__EmailUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__SendBlueUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__create_use_case__WhatsAppUseCaseResponse"}],"discriminator":{"propertyName":"channel","mapping":{"email":"#/components/schemas/src__routes__use_case__create_use_case__EmailUseCaseResponse","imessage":"#/components/schemas/src__routes__use_case__create_use_case__SendBlueUseCaseResponse","inbound_voice":"#/components/schemas/src__routes__use_case__create_use_case__TwilioInboundVoiceUseCaseResponse","outbound_voice":"#/components/schemas/src__routes__use_case__create_use_case__TwilioOutboundVoiceUseCaseResponse","sms":"#/components/schemas/src__routes__use_case__create_use_case__TwilioSmsUseCaseResponse","whatsapp":"#/components/schemas/src__routes__use_case__create_use_case__WhatsAppUseCaseResponse"}}},"src__routes__use_case__create_use_case__SendBlueUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","const":"imessage","title":"Channel"},"sendblue_setup_id":{"type":"string","title":"Sendblue Setup Id","description":"SendBlue subaccount fulfilling this use case."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"type":"string","title":"Webhook Secret"}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","channel","sendblue_setup_id","webhook_url","webhook_secret"],"title":"SendBlueUseCaseResponse"},"src__routes__use_case__create_use_case__TwilioInboundVoiceUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","const":"inbound_voice","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"inbound_voice_url":{"type":"string","title":"Inbound Voice Url","description":"Caller-supplied VoiceUrl written onto the IncomingPhoneNumber at\nassign-phone-number time."},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"Where lifecycle events are posted. NULL = not CM-orchestrated."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Signing secret for those events, returned ONCE at create and never again.\nNULL when no webhook_url was supplied."},"allowed_forwarding_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; empty denies all."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","channel","twilio_setup_id","inbound_voice_url","webhook_url","webhook_secret","allowed_forwarding_numbers"],"title":"TwilioInboundVoiceUseCaseResponse"},"src__routes__use_case__create_use_case__TwilioOutboundVoiceUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","const":"outbound_voice","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"Where lifecycle events are posted. NULL = not CM-orchestrated."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Signing secret for those events, returned ONCE at create and never again.\nNULL when no webhook_url was supplied."},"allowed_forwarding_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; empty denies all."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","channel","twilio_setup_id","webhook_url","webhook_secret","allowed_forwarding_numbers"],"title":"TwilioOutboundVoiceUseCaseResponse"},"src__routes__use_case__create_use_case__TwilioSmsUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","const":"sms","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"type":"string","title":"Webhook Secret"}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","channel","twilio_setup_id","webhook_url","webhook_secret"],"title":"TwilioSmsUseCaseResponse"},"src__routes__use_case__create_use_case__WhatsAppUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","const":"whatsapp","title":"Channel"},"whatsapp_setup_id":{"type":"string","title":"Whatsapp Setup Id","description":"WhatsApp setup fulfilling this use case."},"phone_number":{"type":"string","title":"Phone Number","description":"The bound line in E.164, canonicalized from Meta's `display_phone_number`\n(which is a human format — \"+52 1 800 461 1248\" — with separators that vary\nby country, so it is not comparable as returned)."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"type":"string","title":"Webhook Secret","description":"The inbound-turn signing secret, returned exactly once here at create and\nnever on a read. Rotate via POST /v1/use-case/{id}/webhook-secret."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","channel","whatsapp_setup_id","phone_number","webhook_url","webhook_secret"],"title":"WhatsAppUseCaseResponse"},"src__routes__use_case__list_use_cases__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UseCaseResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"Response"},"src__routes__use_case__response__EmailUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; populated only when include_deleted=true, else None."},"channel":{"type":"string","const":"email","title":"Channel"},"ses_setup_id":{"type":"string","title":"Ses Setup Id"},"sender_email_address":{"type":"string","title":"Sender Email Address","description":"Explicit From address for outbound sends."},"sender_email_alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email Alias"},"email_type":{"$ref":"#/components/schemas/EmailType"},"tier":{"$ref":"#/components/schemas/EmailTier","description":"Current reputation tier. Mutated by the re-tiering cron based on\nsend / bounce / complaint metrics."},"unsubscribable":{"type":"boolean","title":"Unsubscribable","description":"When true, sends from this use case carry RFC 8058 List-Unsubscribe\nheaders + a footer with use-case + setup unsubscribe links, and the\nper-use-case unsubscribe table is consulted at send time. Marketing\nuse cases are always true; transactional may opt out for must-send\nflows like password reset."},"inbound_mode":{"$ref":"#/components/schemas/EmailInboundMode","description":"What inbound this use case accepts (see the create request)."},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers","description":"Always empty for email use cases (surfaced uniformly across the union)."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","ses_setup_id","sender_email_address","sender_email_alias","email_type","tier","unsubscribable","inbound_mode","webhook_url"],"title":"EmailUseCaseResponse"},"src__routes__use_case__response__SendBlueUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; populated only when include_deleted=true, else None."},"channel":{"type":"string","const":"imessage","title":"Channel"},"sendblue_setup_id":{"type":"string","title":"Sendblue Setup Id","description":"SendBlue subaccount fulfilling this use case."},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers","description":"E.164 numbers assigned to this use case; blocked lines (blocked_at set) are\nfiltered out. Populated only by `GET /v1/use-case/{id}`; `list_use_cases` /\n`create_use_case` leave it empty."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","sendblue_setup_id","webhook_url"],"title":"SendBlueUseCaseResponse"},"src__routes__use_case__response__TwilioInboundVoiceUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; populated only when include_deleted=true, else None."},"channel":{"type":"string","const":"inbound_voice","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"inbound_voice_url":{"type":"string","title":"Inbound Voice Url","description":"Caller-supplied VoiceUrl written onto the IncomingPhoneNumber at\nassign-phone-number time."},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"Where channel-manager posts this use case's call lifecycle events. NULL\nmeans the use case is not CM-orchestrated."},"allowed_forwarding_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; empty denies all."},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers","description":"E.164 numbers assigned to this use case. Populated only by\n`GET /v1/use-case/{id}`; `list_use_cases` / `create_use_case` leave it empty."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","twilio_setup_id","inbound_voice_url","webhook_url","allowed_forwarding_numbers"],"title":"TwilioInboundVoiceUseCaseResponse"},"src__routes__use_case__response__TwilioOutboundVoiceUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; populated only when include_deleted=true, else None."},"channel":{"type":"string","const":"outbound_voice","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"Where channel-manager posts this use case's call lifecycle events. NULL\nmeans the use case is not CM-orchestrated."},"allowed_forwarding_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; empty denies all."},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers","description":"E.164 numbers assigned to this use case. Populated only by\n`GET /v1/use-case/{id}`; `list_use_cases` / `create_use_case` leave it empty."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","twilio_setup_id","webhook_url","allowed_forwarding_numbers"],"title":"TwilioOutboundVoiceUseCaseResponse"},"src__routes__use_case__response__TwilioSmsUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; populated only when include_deleted=true, else None."},"channel":{"type":"string","const":"sms","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers","description":"E.164 numbers assigned to this SMS use case (the Messaging Service pool).\nPopulated only by `GET /v1/use-case/{id}`; `list_use_cases` / `create_use_case`\nleave it empty."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","twilio_setup_id","webhook_url"],"title":"TwilioSmsUseCaseResponse"},"src__routes__use_case__response__WhatsAppUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"Soft-delete tombstone; populated only when include_deleted=true, else None."},"channel":{"type":"string","const":"whatsapp","title":"Channel"},"whatsapp_setup_id":{"type":"string","title":"Whatsapp Setup Id","description":"WhatsApp setup fulfilling this use case."},"phone_number":{"type":"string","title":"Phone Number"},"webhook_url":{"type":"string","title":"Webhook Url"}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","whatsapp_setup_id","phone_number","webhook_url"],"title":"WhatsAppUseCaseResponse"},"src__routes__use_case__rotate_webhook_secret__Response":{"properties":{"webhook_secret":{"type":"string","title":"Webhook Secret","description":"The freshly-minted signing secret. Returned ONCE — never re-readable via\nthe API; the caller stores it on its receiver to verify future signatures."},"old_secret_lasts_until":{"type":"string","format":"date-time","title":"Old Secret Lasts Until","description":"When the previous secret stops being accepted; until then the webhooks\ndual-sign both, so a receiver reconfigured before this still verifies."}},"type":"object","required":["webhook_secret","old_secret_lasts_until"],"title":"Response"},"src__routes__use_case__submit_a2p_campaign__Request":{"properties":{"us_app_to_person_usecase":{"type":"string","maxLength":128,"minLength":1,"title":"Us App To Person Usecase","description":"TCR campaign use-case code. Allowed set is brand-dependent — the\nhandler validates against the live us_app_to_person_usecases discovery\nfor this campaign's brand."},"description":{"type":"string","maxLength":4096,"minLength":40,"title":"Description","description":"Short description of what this SMS campaign does."},"message_samples":{"items":{"type":"string","maxLength":1024,"minLength":20},"type":"array","maxItems":5,"minItems":2,"title":"Message Samples","description":"2-5 sample messages, each 20-1024 chars."},"message_flow":{"type":"string","maxLength":2048,"minLength":40,"title":"Message Flow","description":"How consumers opt in to receive messages (40-2048 chars)."},"has_embedded_links":{"type":"boolean","title":"Has Embedded Links","description":"Whether campaign messages contain URLs."},"has_embedded_phone":{"type":"boolean","title":"Has Embedded Phone","description":"Whether campaign messages contain phone numbers."},"age_gated":{"type":"boolean","title":"Age Gated","description":"Whether the campaign requires age gating (e.g. federally legal but\nage-restricted content)."},"direct_lending":{"type":"boolean","title":"Direct Lending","description":"Whether the campaign supports direct lending offers."},"opt_in_message":{"type":"string","maxLength":320,"minLength":20,"title":"Opt In Message","description":"Opt-in confirmation copy. Required unconditionally (Twilio treats it as\noptional): we send it as the FIRST message on the use case, before any other."},"opt_in_keywords":{"items":{"$ref":"#/components/schemas/Keyword"},"type":"array","title":"Opt In Keywords","description":"Keywords that trigger text-to-join opt-in (e.g. \"START\"). Empty when the\ncampaign offers no keyword opt-in (e.g. consent collected via web/paper\nform)."},"opt_out_message":{"type":"string","maxLength":320,"minLength":20,"title":"Opt Out Message","description":"Auto-reply confirmation sent when an end user opts out."},"opt_out_keywords":{"items":{"$ref":"#/components/schemas/Keyword"},"type":"array","title":"Opt Out Keywords","description":"Keywords that trigger opt-out. MUST include the full CTIA set —\n\"STOP\", \"STOPALL\", \"UNSUBSCRIBE\", \"CANCEL\", \"END\", \"QUIT\"."},"help_message":{"type":"string","maxLength":320,"minLength":20,"title":"Help Message","description":"Auto-reply sent when an end user asks for help."},"help_keywords":{"items":{"$ref":"#/components/schemas/Keyword"},"type":"array","title":"Help Keywords","description":"Keywords that trigger help. MUST include \"HELP\" (CTIA requirement)."},"privacy_policy_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Privacy Policy Url","description":"Public URL of the campaign's privacy policy."},"terms_and_conditions_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Terms And Conditions Url","description":"Public URL of the campaign's terms & conditions."}},"type":"object","required":["us_app_to_person_usecase","description","message_samples","message_flow","has_embedded_links","has_embedded_phone","age_gated","direct_lending","opt_in_message","opt_out_message","opt_out_keywords","help_message","help_keywords","privacy_policy_url","terms_and_conditions_url"],"title":"Request","description":"Field constraints mirror `messaging.v1.services({MG}).us_app_to_person.create_async`."},"src__routes__use_case__update_a2p_campaign__Request":{"properties":{"description":{"type":"string","maxLength":4096,"minLength":40,"title":"Description"},"message_flow":{"type":"string","maxLength":2048,"minLength":40,"title":"Message Flow"},"message_samples":{"items":{"type":"string","maxLength":1024,"minLength":20},"type":"array","maxItems":5,"minItems":2,"title":"Message Samples"},"has_embedded_links":{"type":"boolean","title":"Has Embedded Links"},"has_embedded_phone":{"type":"boolean","title":"Has Embedded Phone"},"age_gated":{"type":"boolean","title":"Age Gated"},"direct_lending":{"type":"boolean","title":"Direct Lending"}},"type":"object","required":["description","message_flow","message_samples","has_embedded_links","has_embedded_phone","age_gated","direct_lending"],"title":"Request","description":"Updatable subset of campaign fields. Twilio's update_async signature\nis fixed at these 7 fields — no other field is mutable post-create."},"src__routes__use_case__update_use_case__EmailUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"channel":{"type":"string","const":"email","title":"Channel"},"ses_setup_id":{"type":"string","title":"Ses Setup Id"},"sender_email_address":{"type":"string","title":"Sender Email Address","description":"Explicit From address for outbound sends."},"sender_email_alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email Alias"},"email_type":{"$ref":"#/components/schemas/EmailType"},"tier":{"$ref":"#/components/schemas/EmailTier","description":"Current reputation tier. Mutated by the re-tiering cron based on\nsend / bounce / complaint metrics."},"unsubscribable":{"type":"boolean","title":"Unsubscribable","description":"When true, sends from this use case carry RFC 8058 List-Unsubscribe\nheaders + a footer with use-case + setup unsubscribe links, and the\nper-use-case unsubscribe table is consulted at send time. Marketing\nuse cases are always true; transactional may opt out for must-send\nflows like password reset."},"inbound_mode":{"$ref":"#/components/schemas/EmailInboundMode","description":"What inbound this use case accepts (see the create request)."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Only populated when the webhook secret is updated due to a webhook_url change."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","ses_setup_id","sender_email_address","sender_email_alias","email_type","tier","unsubscribable","inbound_mode","webhook_url","webhook_secret"],"title":"EmailUseCaseResponse"},"src__routes__use_case__update_use_case__Request":{"oneOf":[{"$ref":"#/components/schemas/TwilioInboundVoiceUseCaseUpdateRequest"},{"$ref":"#/components/schemas/TwilioOutboundVoiceUseCaseUpdateRequest"},{"$ref":"#/components/schemas/TwilioSmsUseCaseUpdateRequest"},{"$ref":"#/components/schemas/EmailUseCaseUpdateRequest"},{"$ref":"#/components/schemas/SendBlueUseCaseUpdateRequest"},{"$ref":"#/components/schemas/WhatsAppUseCaseUpdateRequest"}],"discriminator":{"propertyName":"channel","mapping":{"email":"#/components/schemas/EmailUseCaseUpdateRequest","imessage":"#/components/schemas/SendBlueUseCaseUpdateRequest","inbound_voice":"#/components/schemas/TwilioInboundVoiceUseCaseUpdateRequest","outbound_voice":"#/components/schemas/TwilioOutboundVoiceUseCaseUpdateRequest","sms":"#/components/schemas/TwilioSmsUseCaseUpdateRequest","whatsapp":"#/components/schemas/WhatsAppUseCaseUpdateRequest"}}},"src__routes__use_case__update_use_case__Response":{"oneOf":[{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__TwilioInboundVoiceUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__TwilioOutboundVoiceUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__TwilioSmsUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__EmailUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__SendBlueUseCaseResponse"},{"$ref":"#/components/schemas/src__routes__use_case__update_use_case__WhatsAppUseCaseResponse"}],"discriminator":{"propertyName":"channel","mapping":{"email":"#/components/schemas/src__routes__use_case__update_use_case__EmailUseCaseResponse","imessage":"#/components/schemas/src__routes__use_case__update_use_case__SendBlueUseCaseResponse","inbound_voice":"#/components/schemas/src__routes__use_case__update_use_case__TwilioInboundVoiceUseCaseResponse","outbound_voice":"#/components/schemas/src__routes__use_case__update_use_case__TwilioOutboundVoiceUseCaseResponse","sms":"#/components/schemas/src__routes__use_case__update_use_case__TwilioSmsUseCaseResponse","whatsapp":"#/components/schemas/src__routes__use_case__update_use_case__WhatsAppUseCaseResponse"}}},"src__routes__use_case__update_use_case__SendBlueUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"channel":{"type":"string","const":"imessage","title":"Channel"},"sendblue_setup_id":{"type":"string","title":"Sendblue Setup Id","description":"SendBlue subaccount fulfilling this use case."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Only populated when the webhook secret is updated due to a webhook_url change."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","sendblue_setup_id","webhook_url","webhook_secret"],"title":"SendBlueUseCaseResponse"},"src__routes__use_case__update_use_case__TwilioInboundVoiceUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"channel":{"type":"string","const":"inbound_voice","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"inbound_voice_url":{"type":"string","title":"Inbound Voice Url","description":"Caller-supplied VoiceUrl written onto the IncomingPhoneNumber at\nassign-phone-number time."},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"NULL when the binding is not CM-orchestrated."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Set only when a webhook_url change minted it. Shown once."},"allowed_forwarding_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; empty denies all."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","twilio_setup_id","inbound_voice_url","webhook_url","webhook_secret","allowed_forwarding_numbers"],"title":"TwilioInboundVoiceUseCaseResponse"},"src__routes__use_case__update_use_case__TwilioOutboundVoiceUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"channel":{"type":"string","const":"outbound_voice","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"NULL when the binding is not CM-orchestrated."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Set only when a webhook_url change minted it. Shown once."},"allowed_forwarding_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Forwarding Numbers","description":"E.164 numbers a live call may be forwarded / transferred to; empty denies all."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","twilio_setup_id","webhook_url","webhook_secret","allowed_forwarding_numbers"],"title":"TwilioOutboundVoiceUseCaseResponse"},"src__routes__use_case__update_use_case__TwilioSmsUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"channel":{"type":"string","const":"sms","title":"Channel"},"twilio_setup_id":{"type":"string","title":"Twilio Setup Id","description":"Twilio setup fulfilling this use case."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Only populated when the webhook secret is updated due to a webhook_url change."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","twilio_setup_id","webhook_url","webhook_secret"],"title":"TwilioSmsUseCaseResponse"},"src__routes__use_case__update_use_case__WhatsAppUseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_name":{"type":"string","title":"Entity Name","description":"Business entity running this use case (e.g. \"Amigo AI\")."},"name":{"type":"string","title":"Name","description":"Purpose within the entity (e.g. \"sales outbound\")."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Free-text description, if any."},"environment":{"$ref":"#/components/schemas/Environment","description":"Deployment stage this use case targets. Combined with `region`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"region":{"$ref":"#/components/schemas/Region","description":"AWS region this use case targets. Combined with `environment`, picks\nwhich agent-engine deployment serves voice flows for this use case."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"channel":{"type":"string","const":"whatsapp","title":"Channel"},"whatsapp_setup_id":{"type":"string","title":"Whatsapp Setup Id","description":"WhatsApp setup fulfilling this use case."},"phone_number":{"type":"string","title":"Phone Number","description":"The E.164 phone number assigned to this use case."},"webhook_url":{"type":"string","title":"Webhook Url","description":"Configured inbound-turn destination for this binding (see the create\nrequest's `webhook_url`). Echoed on every read so callers can confirm where\nthis channel's inbound turns are POSTed."},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Only populated when the webhook secret is updated due to a webhook_url change."}},"type":"object","required":["id","entity_name","name","description","environment","region","created_at","updated_at","channel","whatsapp_setup_id","phone_number","webhook_url","webhook_secret"],"title":"WhatsAppUseCaseResponse"},"src__routes__voice__add_voice_call_participant__Response":{"properties":{"participant_ref":{"type":"string","format":"uuid","title":"Participant Ref"},"role":{"$ref":"#/components/schemas/VoiceParticipantRole"},"provider_call_sid":{"type":"string","title":"Provider Call Sid"}},"type":"object","required":["participant_ref","role","provider_call_sid"],"title":"Response"},"src__routes__voice__create_voice_call__Request":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id","description":"Outbound-voice use case whose sender pool the call is placed from."},"idempotency_key":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Idempotency Key","description":"Retry-dedup key; a repeat returns the existing call rather than a second one."}},"type":"object","required":["use_case_id"],"title":"Request"},"src__routes__voice__create_voice_call__Response":{"properties":{"call_ref":{"type":"string","format":"uuid","title":"Call Ref"},"phone_number":{"type":"string","title":"Phone Number","description":"The From number selected from the use case's pool."}},"type":"object","required":["call_ref","phone_number"],"title":"Response"},"src__routes__voice__get_voice_call__Response":{"properties":{"call_ref":{"type":"string","format":"uuid","title":"Call Ref"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"direction":{"$ref":"#/components/schemas/VoiceCallDirection"},"phone_number":{"type":"string","title":"Phone Number"},"peer_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Peer Number"},"recording_available":{"type":"boolean","title":"Recording Available"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"participants":{"items":{"$ref":"#/components/schemas/Participant"},"type":"array","title":"Participants"}},"type":"object","required":["call_ref","use_case_id","setup_id","direction","phone_number","peer_number","recording_available","created_at","started_at","ended_at","participants"],"title":"Response"},"src__routes__voice__list_voice_calls__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__voice__list_voice_calls__Response__Item"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more","continuation_token"],"title":"Response"},"src__routes__voice__list_voice_calls__Response__Item":{"properties":{"call_ref":{"type":"string","format":"uuid","title":"Call Ref"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"direction":{"$ref":"#/components/schemas/VoiceCallDirection"},"phone_number":{"type":"string","title":"Phone Number"},"peer_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Peer Number"},"recording_available":{"type":"boolean","title":"Recording Available"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"}},"type":"object","required":["call_ref","use_case_id","direction","phone_number","peer_number","recording_available","created_at","started_at","ended_at"],"title":"Item"},"src__routes__voice__start_participant_media_stream__Request":{"properties":{"stream_url":{"type":"string","minLength":1,"format":"uri","title":"Stream Url","description":"The wss:// endpoint Twilio forks this participant's inbound audio to."},"stream_context":{"additionalProperties":{"type":"string","maxLength":256},"propertyNames":{"maxLength":128,"minLength":1},"type":"object","maxProperties":32,"title":"Stream Context","description":"Key→value context echoed to the fork's `start` event as `customParameters`."}},"type":"object","required":["stream_url","stream_context"],"title":"Request"},"src__routes__voice__update_voice_call_participant__Request":{"properties":{"hold":{"type":"boolean","title":"Hold"},"muted":{"type":"boolean","title":"Muted"},"ends_call_on_exit":{"type":"boolean","title":"Ends Call On Exit"}},"type":"object","title":"Request"},"src__routes__whatsapp_message__create_whatsapp_message_template__Request":{"properties":{"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"name":{"type":"string","maxLength":512,"minLength":4,"pattern":"^[a-z_0-9]+$","title":"Name"},"language":{"$ref":"#/components/schemas/TemplateLanguage"},"category":{"$ref":"#/components/schemas/WhatsAppTemplateCategory"},"header":{"anyOf":[{"type":"string","contentMediaType":"application/json","contentSchema":{"oneOf":[{"$ref":"#/components/schemas/TextHeader"},{"$ref":"#/components/schemas/MediaHeader"}],"discriminator":{"propertyName":"format","mapping":{"document":"#/components/schemas/MediaHeader","image":"#/components/schemas/MediaHeader","text":"#/components/schemas/TextHeader","video":"#/components/schemas/MediaHeader"}}}},{"type":"null"}],"title":"Header"},"header_sample_media":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Header Sample Media"},"body_text":{"type":"string","maxLength":1024,"minLength":1,"title":"Body Text"},"body_text_parameter_names":{"items":{"type":"string","maxLength":60,"minLength":1,"pattern":"^[a-z_0-9]+$"},"type":"array","title":"Body Text Parameter Names","default":[]},"footer_text":{"anyOf":[{"type":"string","maxLength":60,"minLength":1},{"type":"null"}],"title":"Footer Text"}},"type":"object","required":["setup_id","name","language","category","body_text"],"title":"Request"},"src__routes__whatsapp_message__create_whatsapp_message_template__Response":{"properties":{"template_id":{"type":"string","format":"uuid","title":"Template Id"}},"type":"object","required":["template_id"],"title":"Response"},"src__routes__whatsapp_message__send_whatsapp_message__Response":{"properties":{"message_id":{"type":"string","format":"uuid","title":"Message Id"}},"type":"object","required":["message_id"],"title":"Response"},"src__routes__whatsapp_setup__create_whatsapp_setup__Request":{"properties":{"friendly_name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Friendly Name","description":"Operator-facing label for this business identity. Never sent to Meta."},"meta_business_portfolio_id":{"type":"string","maxLength":20,"minLength":15,"pattern":"^[0-9]+$","title":"Meta Business Portfolio Id","description":"Customer's own Meta portfolio id (created by them out of band). Meta echoes it\nas `owner_business_id` on PARTNER_ADDED — the join key that finds this row, so one\nlive setup per portfolio (409 otherwise)."}},"type":"object","required":["friendly_name","meta_business_portfolio_id"],"title":"Request"},"src__routes__whatsapp_setup__create_whatsapp_setup__Response":{"properties":{"whatsapp_embedded_signup_url":{"type":"string","title":"Whatsapp Embedded Signup Url","description":"Meta-hosted Embedded Signup URL to hand the customer. Static per environment —\ncarries no per-setup token."},"whatsapp_setup_id":{"type":"string","format":"uuid","title":"Whatsapp Setup Id"}},"type":"object","required":["whatsapp_embedded_signup_url","whatsapp_setup_id"],"title":"Response"},"src__routes__whatsapp_setup__get_whatsapp_setup__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"friendly_name":{"type":"string","title":"Friendly Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["id","friendly_name","created_at","updated_at","deleted_at"],"title":"Response"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"HTTPBasic":{"type":"http","scheme":"basic"}}}}