{"openapi":"3.1.0","info":{"title":"GatewayAPI Messaging API","description":"The Mobile Messaging API is the simple and future-proof interface for sending SMS and RCS messages to phone numbers.\n\nRead more in the [Messaging API overview](https://gatewayapi.com/docs/message/overview/).","version":"2026.11.16-1895"},"servers":[{"url":"https://messaging.gatewayapi.com"},{"url":"https://messaging.gatewayapi.eu"}],"paths":{"/mobile/single":{"post":{"tags":["Mobile Messaging"],"summary":"Submit Single Mobile Message","description":"Submit a new mobile phone message.\n\nWill during processing be resolved to a specific message type depending on\nseveral parameters, such as account configuration, recipient network, and\nsender information.","operationId":"submit_single_mobile_message_mobile_single_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileMessageRequest"},"examples":{"minimal":{"summary":"A minimal example","value":{"sender":"ExampleSMS","message":"Hello world!","recipient":4512345678}},"with reference":{"summary":"A message with reference","value":{"sender":"ExampleSMS","message":"Hello world!","recipient":4512345678,"reference":"<client provided reference>"}},"with expiration":{"summary":"A message with expire","value":{"sender":"ExampleSMS","message":"Hello world!","recipient":4512345678,"expiration":"P3DT4H33M17S"}},"with label":{"summary":"A message with label","value":{"sender":"ExampleSMS","message":"Hello world!","recipient":4512345678,"label":"Promotion"}}}}},"required":true},"responses":{"202":{"description":"Submit with reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileMessageResponse"},"example":{"msg_id":"01JNN696A9E0WS89FPYGT15NBX","recipient":4512345678,"reference":"<client provided reference>"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Token":[]}]}},"/mobile/multi":{"post":{"tags":["Mobile Messaging"],"summary":"Submit Multiple Mobile Messages","description":"Submit a bunch of mobile phone messages at once.\n\nThe messages are unpacked and afterwards processed individually as if they\nwere submitted by using the single submit route.\n\nWill during processing be resolved to a specific message type depending on\nseveral parameters, such as account configuration, recipient network, and\nsender information.","operationId":"submit_multiple_mobile_messages_mobile_multi_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiMobileMessageRequest"},"examples":{"minimal":{"summary":"A minimal example","value":{"messages":[{"sender":"ExampleSMS","message":"Hello world!","recipient":4512345678}]}}}}},"required":true},"responses":{"202":{"description":"Submit with reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiMobileMessageResponse"},"example":{"msg_id":"01JNN696A9E0WS89FPYGT15NBX","recipient":4512345678,"reference":"<client provided reference>"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"Token":[]}]}}},"webhooks":{"Messaging Webhook":{"post":{"summary":"Process Messaging Webhook Event","description":"Receive a webhook event generated by the system.\n\nThe responding server _must_ respond with a status code in the successful\nrange between `200` and `299`, in order to mark the event as delivered.\n\nAny other responses will we treated as a failure to deliver and will cause\nthe event to be retried again later.","operationId":"process_messaging_webhook_eventMessaging_Webhook_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventRequest"},"examples":{"minimal":{"summary":"A minimal example","value":{"event_id":"09c829a2-a77b-422d-8562-2f88e784dfb5","timestamp":"2025-04-01T11:50:12.003029+00:00","event_type":"message.status.sms","event":{"msg_id":"01JQRJWK259Y1YEECJZB50908V","recipient":4512345678,"reference":null,"status":"DELIVERED","status_at":"2025-04-01T11:49:12.005021+00:00","error":null}}},"full example":{"summary":"A message with reference and error","value":{"event_id":"09c829a2-a77b-422d-8562-2f88e784dfb5","timestamp":"2025-04-01T11:50:12.003029+00:00","event_type":"message.status.sms","event":{"msg_id":"01JQRJWK259Y1YEECJZB50908V","recipient":4512345678,"reference":"<client provided reference>","status":"REJECTED","status_at":"2025-04-01T11:49:12.005021+00:00","error":{"hex_code":"0x1905","details":"Unsupported sender"}}}},"rcs":{"summary":"A RCS example","value":{"event_id":"a3243dcd-c2ec-4adf-a137-8a5948950a63","timestamp":"2025-04-01T11:50:12.003029+00:00","event_type":"message.status.sms","event":{"msg_id":"01JQRJWK259Y1YEECJZB50908V","recipient":4512345678,"reference":"<client provided reference>","status":"READ","status_at":"2025-04-01T11:49:12.005021+00:00"}}}}}},"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":{"BinarySmsContent":{"properties":{"encoding":{"type":"string","const":"BINARY","title":"Encoding"},"message":{"type":"string","title":"Message"},"header":{"type":"string","title":"Header"}},"type":"object","required":["encoding","message","header"],"title":"BinarySmsContent","description":"Binary SMS content."},"EventTypeKey":{"type":"string","enum":["message.status.sms","message.status.rcs","user-message.text.sms","user-message.text.rcs","user-message.location.rcs","user-message.response.rcs","user-message.file.rcs"]},"FileInfo":{"properties":{"mime_type":{"type":"string","title":"Mime Type"},"size_bytes":{"type":"integer","title":"Size Bytes"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"uri":{"type":"string","title":"Uri"}},"type":"object","required":["mime_type","size_bytes","name","uri"],"title":"FileInfo","description":"RCS file information."},"FileUploadContent":{"properties":{"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"thumbnail":{"anyOf":[{"$ref":"#/components/schemas/FileInfo"},{"type":"null"}]},"payload":{"$ref":"#/components/schemas/FileInfo"}},"type":"object","required":["category","thumbnail","payload"],"title":"FileUploadContent","description":"RCS file content."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LocationContent":{"properties":{"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"}},"type":"object","required":["latitude","longitude"],"title":"LocationContent","description":"RCS location content."},"MobileMessageRequest":{"properties":{"sender":{"type":"string","maxLength":18,"minLength":3,"title":"Sender","description":"Has to be at most either 11 characters alphanumeric or 15 numeric characters.\n\nIf using letters and numbers other than `[A-Za-z0-9]` there is a greater risk of replacement or rejection during processing by systems closer to the destination."},"recipient":{"type":"integer","title":"Recipient","description":"MSISDN to recieve the message","gt":1000,"le":999999999999999},"message":{"type":"string","maxLength":39015,"title":"Message","description":"Text message itself"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference","description":"Optional reference, often used for client generated ID"},"expiration":{"anyOf":[{"type":"string","format":"duration"},{"type":"string","format":"date-time"}],"title":"Expiration","description":"Duration or point in time until the message expires.\nSeveral possible formats:\n- ISO-8601 duration.\n- `YYYY-MM-DD[T]HH:MM:SS[.ffffff][Z or [+ or -]HH[:]MM]`.\n- Unix timestamp in seconds.\n- Seconds offset, if the value is at most 432000.\n\nThe greatest possible expiration is 5 days.","default":"P5D"},"priority":{"type":"string","enum":["normal","urgent"],"title":"Priority","description":"Priority of the message. Urgent messages may be priced higher depending on account configuration","default":"normal"},"label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Label","description":"An optional label for the message"}},"type":"object","required":["sender","recipient","message"],"title":"MobileMessageRequest","description":"A transport agnostic mobile phone message.\n\nDepending on the recipient device, the network it belongs, the account\nconfiguration and other factors, these messages can be sent as various\nforms of messages for phones."},"MobileMessageResponse":{"properties":{"msg_id":{"type":"string","title":"Msg Id","description":"System generated message ID"},"recipient":{"type":"integer","title":"Recipient","description":"Client provided message recipient"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference","description":"Client provided message reference"}},"type":"object","required":["msg_id","recipient","reference"],"title":"MobileMessageResponse","description":"Mobile phone message submit response.\n\nContains some of the submitted fields along with the system generated ID\nfor matching in the integrating system."},"MultiMobileMessageRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/MobileMessageRequest"},"type":"array","maxItems":1000,"minItems":1,"title":"Messages"}},"type":"object","required":["messages"],"title":"MultiMobileMessageRequest","description":"Envelope for accepting multiple mobile phone messages at once."},"MultiMobileMessageResponse":{"properties":{"responses":{"items":{"$ref":"#/components/schemas/MobileMessageResponse"},"type":"array","title":"Responses"}},"type":"object","required":["responses"],"title":"MultiMobileMessageResponse","description":"Envelope response when submitting multiple mobile phone messages."},"RcsContent":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/LocationContent"},{"$ref":"#/components/schemas/FileUploadContent"},{"$ref":"#/components/schemas/SuggestionResponse"}]},"RcsMessageStatusEvent":{"properties":{"msg_id":{"type":"string","title":"Msg Id"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"status_at":{"type":"string","format":"date-time","title":"Status At"},"recipient":{"type":"integer","title":"Recipient"},"agent_id":{"type":"string","title":"Agent Id"},"status":{"type":"string","enum":["DELIVERED","READ","EXPIRED","ENROUTE"],"title":"Status"}},"type":"object","required":["msg_id","reference","status_at","recipient","agent_id","status"],"title":"RcsMessageStatusEvent","description":"A RCS message status event."},"RcsUserMessage":{"properties":{"msg_id":{"type":"string","title":"Msg Id"},"sent_at":{"type":"string","format":"date-time","title":"Sent At"},"content":{"$ref":"#/components/schemas/RcsContent"},"sender":{"type":"integer","title":"Sender"},"agent_id":{"type":"string","title":"Agent Id"}},"type":"object","required":["msg_id","sent_at","content","sender","agent_id"],"title":"RcsUserMessage","description":"A RCS user message."},"SmsContent":{"anyOf":[{"$ref":"#/components/schemas/TextualSmsContent"},{"$ref":"#/components/schemas/BinarySmsContent"}]},"SmsErrorDetails":{"properties":{"hex_code":{"type":"string","title":"Hex Code"},"details":{"type":"string","title":"Details"}},"type":"object","required":["hex_code","details"],"title":"SmsErrorDetails","description":"Specific information about why a message failed to be delivered."},"SmsMessageStatusEvent":{"properties":{"msg_id":{"type":"string","title":"Msg Id"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"status_at":{"type":"string","format":"date-time","title":"Status At"},"recipient":{"type":"integer","title":"Recipient"},"status":{"type":"string","enum":["ENROUTE","DELIVERED","EXPIRED","DELETED","UNDELIVERABLE","ACCEPTED","UNKNOWN","REJECTED"],"title":"Status"},"error":{"anyOf":[{"$ref":"#/components/schemas/SmsErrorDetails"},{"type":"null"}]}},"type":"object","required":["msg_id","reference","status_at","recipient","status","error"],"title":"SmsMessageStatusEvent","description":"A SMS message status event."},"SmsUserMessage":{"properties":{"msg_id":{"type":"string","title":"Msg Id"},"sent_at":{"type":"string","format":"date-time","title":"Sent At"},"content":{"$ref":"#/components/schemas/SmsContent"},"sender":{"type":"string","title":"Sender"},"recipient":{"type":"integer","title":"Recipient"}},"type":"object","required":["msg_id","sent_at","content","sender","recipient"],"title":"SmsUserMessage","description":"A SMS user message.\n\nOften also referred to as Mobile Origin or \"MO\" message."},"SuggestionResponse":{"properties":{"postback_data":{"type":"string","title":"Postback Data"},"text":{"type":"string","title":"Text"},"type":{"type":"string","title":"Type"}},"type":"object","required":["postback_data","text","type"],"title":"SuggestionResponse","description":"RCS suggestion response."},"TextualSmsContent":{"properties":{"encoding":{"type":"string","enum":["GSM7","UCS2","LATIN1"],"title":"Encoding"},"message":{"type":"string","title":"Message"},"header":{"type":"string","title":"Header"}},"type":"object","required":["encoding","message","header"],"title":"TextualSmsContent","description":"Textual SMS content."},"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"},"WebhookEventPayload":{"anyOf":[{"$ref":"#/components/schemas/RcsMessageStatusEvent"},{"$ref":"#/components/schemas/SmsMessageStatusEvent"},{"$ref":"#/components/schemas/RcsUserMessage"},{"$ref":"#/components/schemas/SmsUserMessage"}]},"WebhookEventRequest":{"properties":{"event_id":{"type":"string","title":"Event Id"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"event_type":{"$ref":"#/components/schemas/EventTypeKey"},"event":{"$ref":"#/components/schemas/WebhookEventPayload"}},"type":"object","required":["event_id","timestamp","event_type","event"],"title":"WebhookEventRequest","description":"A webhook event request."}},"securitySchemes":{"Token":{"type":"apiKey","description":"Set the `Authorization` header with a value of the following format: `Token {value}` where the `value` is the token from the GatewayAPI dashboard. The `Token` value defines the authorization scheme, which is required by the header format.\n\nAn example could be: `Token JxJOf8ddQSdtEjYwL_-FFUweRAdg_A3P7CxUluIMIAY`","in":"header","name":"Authorization"}}},"tags":[{"name":"Mobile Messaging","description":"Send transport agnostic messages to phones."}]}