{ "openapi": "3.0.1", "info": { "title": "Twilio - Messaging", "description": "This is the public Twilio REST API.", "termsOfService": "https://www.twilio.com/legal/tos", "contact": { "name": "Twilio Support", "url": "https://support.twilio.com", "email": "support@twilio.com" }, "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.0", "x-twilio": { "apiStandards": "v0.1" } }, "security": [ { "accountSid_authToken": [] } ], "servers": [ { "url": "https://messaging.twilio.com" } ], "tags": [ { "name": "MessagingV3TypingIndicator", "description": "Send typing indicators to OTT channel recipients (WhatsApp, Apple Messages for Business).\n" } ], "paths": { "/v3/OptOuts/DefaultKeywordsMessages": {}, "/v3/OptOuts": {}, "/v3/OptOuts/{OptOutSid}": {}, "/v3/OptOuts/Configurations/Languages": {}, "/v3/OptOuts/Configurations/MessageTypes": {}, "/v3/OptOuts/{OptOutSid}/MessageTypes": {}, "/v3/OptOuts/{OptOutSid}/Messages": {}, "/v3/OptOuts/{OptOutSid}/Keywords": {}, "/v3/Indicators/Typing.json": { "servers": [ { "url": "https://messaging.twilio.com" } ], "description": "Send a typing indicator event for OTT channels (e.g., WhatsApp, Apple Messages for Business).", "x-twilio": { "defaultOutputProperties": [ "success" ], "mountName": "typing_indicator", "pathType": "list" }, "post": { "summary": "Send a typing indicator", "description": "Send a typing indicator to notify the recipient that you are composing a message. Supported channels: WhatsApp, Apple Messages for Business. The request body varies by channel \u2014 use the `channel` field as the discriminator.\n", "tags": [ "MessagingV3TypingIndicator" ], "operationId": "CreateV3TypingIndicator", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TypingIndicatorRequest" }, "examples": { "whatsapp_typing_indicator": { "summary": "WhatsApp Typing Indicator", "description": "Send a typing indicator for an active WhatsApp conversation", "value": { "channel": "WHATSAPP", "messageId": "SM1234567890abcdef1234567890abcdef" } }, "apple_typing_indicator": { "summary": "Apple Typing Indicator", "description": "Send a typing indicator for an Apple Messages for Business conversation", "value": { "channel": "APPLE", "from": "apple:a89a691c-15c0-4fd1-a589-1ded34b59c39", "to": "apple:urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG", "event": "START" } } } } } }, "responses": { "200": { "description": "Typing indicator was successfully sent to the recipient.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the typing indicator was sent successfully.", "example": true } } }, "examples": { "success": { "value": { "success": true } } } } }, "headers": { "Access-Control-Allow-Origin": { "description": "Specify the origin(s) allowed to access the resource", "schema": { "type": "string" }, "example": "*" }, "Access-Control-Allow-Methods": { "description": "Specify the HTTP methods allowed when accessing the resource", "schema": { "type": "string" }, "example": "POST, OPTIONS" }, "Access-Control-Allow-Headers": { "description": "Specify the headers allowed when accessing the resource", "schema": { "type": "string" }, "example": "Content-Type, Authorization" }, "Access-Control-Allow-Credentials": { "description": "Indicates whether the browser should include credentials", "schema": { "type": "boolean" } }, "Access-Control-Expose-Headers": { "description": "Headers exposed to the client", "schema": { "type": "string", "example": "X-Custom-Header1, X-Custom-Header2" } } } }, "400": { "description": "Invalid request. The request body is missing required fields or contains invalid values.", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "description": "Twilio-specific error code", "type": "integer", "format": "int32" }, "message": { "description": "Error message", "type": "string" }, "more_info": { "description": "Link to Error Code References", "type": "string" }, "status": { "description": "HTTP response status code", "type": "integer", "format": "int32" } } } } } }, "401": { "description": "Authentication credentials are missing or invalid.", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "description": "Twilio-specific error code", "type": "integer", "format": "int32" }, "message": { "description": "Error message", "type": "string" }, "more_info": { "description": "Link to Error Code References", "type": "string" }, "status": { "description": "HTTP response status code", "type": "integer", "format": "int32" } } } } } }, "403": { "description": "The account is not authorized to send typing indicators for this channel.", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "description": "Twilio-specific error code", "type": "integer", "format": "int32" }, "message": { "description": "Error message", "type": "string" }, "more_info": { "description": "Link to Error Code References", "type": "string" }, "status": { "description": "HTTP response status code", "type": "integer", "format": "int32" } } } } } } }, "security": [ { "accountSid_authToken": [] } ] } } }, "components": { "securitySchemes": { "accountSid_authToken": { "scheme": "basic", "type": "http" } }, "schemas": { "KeywordConfigurationResponse": { "type": "object", "description": "Response containing keyword configurations organized by keyword type", "additionalProperties": { "$ref": "#/components/schemas/KeywordTypeConfig" }, "example": { "STOP": { "keywords": [ { "keyword": "OPTOUT", "reserved": false }, { "keyword": "STOP", "reserved": true } ], "message": "You have successfully been unsubscribed. You will not receive any more messages from this number. Reply START to resubscribe." }, "START": { "keywords": [ { "keyword": "START", "reserved": true }, { "keyword": "YES", "reserved": false } ], "message": "You have successfully been re-subscribed to messages from this number. Reply HELP for help. Reply STOP to unsubscribe. Msg&Data Rates May Apply." } } }, "KeywordTypeConfig": { "type": "object", "description": "Configuration for a specific keyword type (STOP, START, HELP, etc.)", "required": [ "keywords", "message" ], "properties": { "keywords": { "type": "array", "description": "List of keywords associated with this keyword type", "items": { "$ref": "#/components/schemas/KeywordItem" }, "minItems": 1 }, "message": { "type": "string", "description": "The response message sent when any keyword of this type is received", "minLength": 1, "maxLength": 1600, "example": "You have successfully been unsubscribed. You will not receive any more messages from this number. Reply START to resubscribe." } } }, "KeywordItem": { "type": "object", "description": "Individual keyword configuration", "required": [ "keyword", "reserved" ], "properties": { "keyword": { "type": "string", "description": "The actual keyword text", "minLength": 1, "maxLength": 34, "pattern": "^[A-Z0-9]+$", "example": "STOP" }, "reserved": { "type": "boolean", "description": "Indicates whether this keyword is reserved by the system and cannot be modified", "example": true } } }, "OptOutDefaultKeywordMessageResponse": { "type": "object", "properties": { "defaultKeywords": { "type": "array", "items": { "type": "object", "properties": { "keyword": { "type": "string", "description": "The opt-out keyword", "example": "STOP" }, "messageType": { "type": "string", "description": "The type of message (SMS, etc.)", "example": "SMS" }, "language": { "type": "string", "description": "Language code for the message", "example": "en" }, "message": { "type": "string", "description": "The default response message sent when this keyword is used", "example": "You have successfully opted out from receiving messages." } } } } } }, "OptOutConfig": { "type": "object", "required": [ "opt_out_sid", "account_sid" ], "properties": { "opt_out_sid": { "type": "string", "description": "The unique SID identifier for the opt-out configuration", "pattern": "^OO[0-9a-fA-F]{32}$", "example": "OO1234567890abcdef1234567890abcdef" }, "account_sid": { "type": "string", "description": "The SID of the account that owns this opt-out configuration", "pattern": "^AC[0-9a-fA-F]{32}$", "example": "AC1234567890abcdef1234567890abcdef" }, "friendly_name": { "type": "string", "description": "A human-readable name for the opt-out configuration", "nullable": true, "example": "Customer Service Opt-Out" }, "date_created": { "type": "string", "format": "date-time", "description": "The date and time when the opt-out configuration was created", "nullable": true, "example": "2023-10-01T12:00:00Z" }, "date_updated": { "type": "string", "format": "date-time", "description": "The date and time when the opt-out configuration was last updated", "nullable": true, "example": "2023-10-15T14:30:00Z" } } }, "LocaleResponse": { "type": "object", "required": [ "languages" ], "properties": { "languages": { "type": "array", "description": "List of supported languages for opt-out configurations", "items": { "$ref": "#/components/schemas/LanguageProperties" }, "example": [ { "key": "ENGLISH", "friendly_name": "English" }, { "key": "SPANISH", "friendly_name": "Spanish" }, { "key": "FRENCH", "friendly_name": "French" } ] } } }, "LanguageProperties": { "type": "object", "required": [ "key", "friendly_name" ], "properties": { "key": { "type": "string", "description": "The language key/identifier (typically uppercase)", "enum": [ "ALL", "AFRIKAANS", "ARABIC", "BENGALI", "CHINESE", "CROATIAN", "CZECH", "DANISH", "DUTCH", "ENGLISH", "ESTONIAN", "FINNISH", "FRENCH", "GERMAN", "GREEK", "HEBREW", "HINDI", "HUNGARIAN", "ITALIAN", "JAPANESE", "KOREAN", "LATVIAN", "LITHUANIAN", "MALAY", "MALAYSIAN", "NORWEGIAN", "POLISH", "PORTUGUESE", "RUSSIAN", "SLOVAK", "SLOVENE", "SPANISH", "SOUTHERN_NDEBELE", "SOUTHERN_SOTHO", "SWATI", "SWEDISH", "TAMIL", "TSWANA", "TSONGA", "VENDA", "XHOSA", "ZULU" ], "example": "ENGLISH" }, "friendly_name": { "type": "string", "description": "Human-readable display name for the language", "example": "English" } } }, "KeywordLocaleType": { "type": "string", "pattern": "^(STOP|START|HELP)\\.(ALL|AFRIKAANS|ARABIC|BENGALI|CHINESE|CROATIAN|CZECH|DANISH|DUTCH|ENGLISH|ESTONIAN|FINNISH|FRENCH|GERMAN|GREEK|HEBREW|HINDI|HUNGARIAN|ITALIAN|JAPANESE|KOREAN|LATVIAN|LITHUANIAN|MALAY|MALAYSIAN|NORWEGIAN|POLISH|PORTUGUESE|RUSSIAN|SLOVAK|SLOVENE|SPANISH|SOUTHERN_NDEBELE|SOUTHERN_SOTHO|SWATI|SWEDISH|TAMIL|TSWANA|TSONGA|VENDA|XHOSA|ZULU)$", "description": "Combination of KeywordType and Locale in format: {KeywordType}.{Locale}\n\nValid KeywordTypes: STOP, START, HELP\nValid Locales: See LocaleEnum for full list\n\nExamples: STOP.ENGLISH, START.SPANISH, HELP.FRENCH\n" }, "SupportedMessageTypes": { "type": "object", "required": [ "message_types" ], "properties": { "message_types": { "type": "array", "description": "List of supported message types for opt-out configurations", "items": { "$ref": "#/components/schemas/MessageTypeConfig" }, "example": [ { "key": "ALL", "friendly_name": "Global Default Settings" }, { "key": "US", "friendly_name": "United States" }, { "key": "CA", "friendly_name": "Canada" } ] } } }, "MessageTypeConfig": { "type": "object", "required": [ "key", "friendly_name" ], "properties": { "key": { "type": "string", "description": "The message type key/identifier (typically country codes or special identifiers)", "example": "US" }, "friendly_name": { "type": "string", "description": "Human-readable display name for the message type", "example": "United States" } } }, "MessageTypesResponse": { "type": "object", "required": [ "account_sid", "opt_out_sid", "message_types" ], "properties": { "account_sid": { "type": "string", "description": "The SID of the account that owns this opt-out configuration", "pattern": "^AC[0-9a-fA-F]{32}$", "example": "AC1234567890abcdef1234567890abcdef" }, "opt_out_sid": { "type": "string", "description": "The SID of the opt-out configuration", "pattern": "^OO[0-9a-fA-F]{32}$", "example": "OO1234567890abcdef1234567890abcdef" }, "message_types": { "type": "array", "description": "List of message types associated with this opt-out configuration", "items": { "$ref": "#/components/schemas/MessageTypeConfig" }, "example": [ { "key": "ALL", "friendly_name": "Global Default Settings" }, { "key": "US", "friendly_name": "United States" }, { "key": "CA", "friendly_name": "Canada" } ] } } }, "MessagesResponse": { "type": "object", "required": [ "account_sid", "opt_out_sid", "config" ], "properties": { "account_sid": { "type": "string", "description": "The SID of the account that owns this opt-out configuration", "pattern": "^AC[0-9a-fA-F]{32}$", "example": "AC1234567890abcdef1234567890abcdef" }, "opt_out_sid": { "type": "string", "description": "The SID of the opt-out configuration", "pattern": "^OO[0-9a-fA-F]{32}$", "example": "OO1234567890abcdef1234567890abcdef" }, "config": { "type": "array", "description": "List of message configurations for different keyword types", "items": { "$ref": "#/components/schemas/MessageProperties" } } } }, "MessageProperties": { "type": "object", "required": [ "keyword_type", "message_type", "message" ], "properties": { "keyword_type": { "type": "string", "description": "The keyword type in format KeywordType.Locale (e.g., STOP.ENGLISH, HELP.FRENCH)", "example": "STOP.ENGLISH" }, "message_type": { "type": "string", "description": "The message type identifier (typically country codes or special identifiers)", "example": "US" }, "message": { "type": "string", "description": "The actual opt-out message text to be sent", "example": "Reply STOP to unsubscribe. Msg&data rates may apply." } } }, "OptOutMessagesEntity": { "type": "object", "required": [ "keywordType", "messageType", "message" ], "properties": { "keywordType": { "$ref": "#/components/schemas/KeywordLocaleType" }, "messageType": { "type": "string", "description": "Message type (typically country code or region identifier)", "example": "US" }, "message": { "type": "string", "maxLength": 320, "minLength": 1, "description": "The message text content (max 320 characters)", "example": "You have been successfully unsubscribed. Reply START to resubscribe." } } }, "KeywordsResponse": { "type": "object", "required": [ "account_sid", "opt_out_sid", "config" ], "properties": { "account_sid": { "type": "string", "description": "The SID of the account that owns this opt-out configuration", "pattern": "^AC[0-9a-fA-F]{32}$", "example": "AC1234567890abcdef1234567890abcdef" }, "opt_out_sid": { "type": "string", "description": "The SID of the opt-out configuration", "pattern": "^OO[0-9a-fA-F]{32}$", "example": "OO1234567890abcdef1234567890abcdef" }, "config": { "type": "array", "description": "List of keyword configurations for different keyword types", "items": { "$ref": "#/components/schemas/KeywordConfiguration" } } } }, "KeywordConfiguration": { "type": "object", "required": [ "keyword_type", "message_type", "keywords" ], "properties": { "keyword_type": { "type": "string", "description": "The keyword type in format KeywordType.Locale (e.g., STOP.ENGLISH, HELP.FRENCH)", "example": "STOP.ENGLISH" }, "message_type": { "type": "string", "description": "The message type identifier (typically country codes or special identifiers)", "example": "US" }, "keywords": { "type": "array", "description": "Array of keyword strings for this configuration", "items": { "type": "string" }, "example": [ "STOP", "QUIT", "END" ] } } }, "OptOutKeywordsEntity": { "type": "object", "required": [ "keywordType", "messageType", "keyword" ], "properties": { "keywordType": { "$ref": "#/components/schemas/KeywordLocaleType" }, "messageType": { "type": "string", "description": "The message type identifier (typically country codes or special identifiers)", "example": "US" }, "keyword": { "type": "string", "description": "The keyword to add", "minLength": 1, "maxLength": 34, "example": "STOP" } } }, "TypingIndicatorRequest": { "type": "object", "description": "Request body for sending a typing indicator. The schema varies by channel. Use the `channel` field to determine which properties are required.\n", "oneOf": [ { "$ref": "#/components/schemas/WhatsAppTypingIndicatorRequest" }, { "$ref": "#/components/schemas/AppleTypingIndicatorRequest" } ], "discriminator": { "propertyName": "channel", "mapping": { "WHATSAPP": "#/components/schemas/WhatsAppTypingIndicatorRequest", "APPLE": "#/components/schemas/AppleTypingIndicatorRequest" } } }, "WhatsAppTypingIndicatorRequest": { "type": "object", "description": "Typing indicator request for WhatsApp channel. Requires a messageId from a recent inbound message.", "additionalProperties": false, "required": [ "channel", "messageId" ], "properties": { "channel": { "type": "string", "enum": [ "WHATSAPP" ], "description": "The messaging channel. Must be \"WHATSAPP\".", "example": "WHATSAPP" }, "messageId": { "type": "string", "pattern": "^(SM|MM)[0-9a-fA-F]{32}$", "description": "The SID of a recent inbound message from the recipient. Must be an SM or MM SID format.\n", "example": "SM1234567890abcdef1234567890abcdef" } } }, "AppleTypingIndicatorRequest": { "type": "object", "description": "Typing indicator request for Apple Messages for Business channel.", "additionalProperties": false, "required": [ "channel", "from", "to" ], "properties": { "channel": { "type": "string", "enum": [ "APPLE" ], "description": "The messaging channel. Must be \"APPLE\".", "example": "APPLE" }, "from": { "type": "string", "description": "The Apple Messages for Business identifier of the sender (business).", "example": "apple:a89a691c-15c0-4fd1-a589-1ded34b59c39" }, "to": { "type": "string", "description": "The Apple Messages for Business identifier of the recipient (customer).", "example": "apple:urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG" }, "event": { "type": "string", "enum": [ "START", "END" ], "default": "START", "description": "The type of typing event. \"START\" indicates the agent began typing, \"END\" indicates the agent stopped typing. Defaults to \"START\".\n", "example": "START" } } } } } }