The MessageOS RCS API
One request. A rich card on their phone.
Send text, buttons, rich cards, carousels, and files to the text message inbox with one call to POST /v1/messages. Hear every reply at a signed webhook, and answer it the same way.
- 8 languages, standard library only
- Signed webhooks with retries
- No caps on volume
{ "id": "msg_123", "status": "sent", "type": "card", "channel": "rcs", "contactId": 42, "reference": "order-8841", "auditId": 123 }The same card, on the phone. The picture stands in for media.url.
Message types
Every kind of RCS message. One endpoint.
A message is exactly one of text, card, carousel, file, or template, sent to POST /v1/messages. Any of them can carry suggestions, a class, and a reference of your own that comes back in every delivery event.
Rich card
richMessagesA title up to 200 characters, a description up to 500, an image, GIF, or video, and up to 4 buttons of its own. Vertical, or horizontal with the picture to one side.
"card": { "title": "Your order is on its way", "media": { "height": "MEDIUM" } }Text
every agentThe smallest message is a recipient and up to 2000 characters.
totakes a contactId, a phoneNumber, or your own externalId."text": "Your table is ready."Suggested replies
richMessagesUp to 11 buttons under a message. A tap comes back as reply.received with the label and your postbackData.
{ "type": "reply", "text": "On my way", "postbackData": "eta_now" }Suggested actions
richMessagesButtons that open a link in the conversation or the browser, start a call, show a place, ask for a location, or add a calendar event.
"type": "openUrl" | "dial" | "viewLocation" | "shareLocation" | "createCalendarEvent"File
richMessagesAn image, a video, an audio file, or a PDF at a public https address. The phone network fetches it from you, and a file it cannot fetch comes back as message.failed.
"file": { "url": "https://example.com/files/receipt-8841.pdf" }Carousel
richMessages2 to 10 cards the person swipes through, SMALL or MEDIUM wide. Give each card's button words that name its own card.
"carousel": { "cardWidth": "MEDIUM", "cards": [ { "title": "Morning" }, { "title": "Afternoon" } ] }A reply
replyWindowSecondsName the person's message in inReplyTo. A reply to a message from the last hour needs no consent record, and quiet hours do not hold it.
"inReplyTo": 981A first message
contacts:writeTo reach a number that is not a contact yet, send the consent you hold in the same request. The contact is created with it, and the message is sent.
"consent": { "source": "checkout_form", "capturedAt": "2026-10-28T23:00:00.000Z" }Template
set up by MessageOSText stored for your agent, with a value for each slot. MessageOS sets templates up, and plain text needs none.
"template": { "id": "reminder", "params": { "name": "Pat" } }Expiry and traffic type
rcsExtrasttlSeconds or expiresAt lets the network take a message back on its own. trafficType is passed on exactly as you wrote it.
"ttlSeconds": 600, "trafficType": "transaction"
Each tile names what has to be on. richMessages, rcsExtras, and replyWindowSeconds are fields of GET /v1/whoami: MessageOS turns each on for your agent, and while one is off a body that needs it returns 422 and plain text still sends. A scope is a permission your key is made with.
Two-way
Hear the reply. Answer it.
Register a public https address once. When the person taps a button, types, shares a place, or sends a file, your server gets reply.received with the fields you need to answer it.
- 1Ask
Send a question with suggested replies, each with your own postbackData.
- 2Hear
The tap reaches your server as reply.received, signed with your webhook's secret.
- 3Answer
Name the person's message in inReplyTo. Quiet hours do not hold a reply.
POST /webhooks/messageosContent-Type: application/json
User-Agent: MessageOS-Webhooks/1
x-messageos-event-id: evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b
x-messageos-timestamp: 1793228410
x-messageos-signature: sha256=64f0c92b53374ee282e9cddbab6ea7bd6a9d21294f4b5c79c2609782025a4e1b{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "reply.received",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"inboundMessageId": 981,
"contactId": 42,
"externalId": null,
"phoneNumber": "+15555550123",
"conversationId": 7,
"text": "On my way",
"kind": "chip",
"postbackData": "eta_now",
"attachments": [],
"location": null,
"receivedAt": "2026-10-28T23:00:05.000Z"
}
}{ "to": { "contactId": 42 }, "text": "See you soon.", "inReplyTo": 981 }The event above is the quickstart's, signed here with the quickstart's example secret. Delivered, read, failed, opted out, and opted in arrive the same way. Every event and field.
Built to be retried
The hard parts, handled for you.
Retry a request that timed out without sending twice. Trust every webhook by its signature. Consent and opt-out are enforced on every send, and quiet hours wherever your agent keeps them, so your code never has to remember them.
- POSTIdempotency-Key: welcome-15555550123POSTIdempotency-Key: welcome-15555550123Thanks for signing up.1 message
Idempotency keys
How a key worksPOST /v1/messagestakes anIdempotency-Keyof 8 to 128 characters. If a request times out, send it again with the same key and body: you get the stored answer, markedIdempotent-Replay: true, and the message is not sent a second time. The one exception isprovider_error: the network did not confirm the message, so the same key sends again, and the person can get it twice. 503 service_unavailable Retry-After: <seconds>same keysame bodyat most one messageSafe to retry
A 500 or a 503 is never stored for the key. Wait the seconds in
Every error codeRetry-Afterand send the same request again. However often you retry, at most one message is sent.x-messageos-timestamp: 1793228410 x-messageos-signature: sha256=64f0c92b53374ee…HMAC-SHA256300 second windowSigned webhooks
Every event carries
Verify a signaturex-messageos-signature:sha256=and the HMAC-SHA256 of the timestamp, a period, and the raw body, keyed with your endpoint's secret. Compare it in constant time and refuse a timestamp more than 300 seconds off.- now
- 30s
- 1m
- 2m
- 4m
- 8m
- 16m
- 32m
2xx in 10 seconds: done410: endpoint disabled8 tries, then deadWebhook retries with backoff
Answer with a 2xx within 10 seconds. Otherwise the event is tried again up to 8 times in all, after 30 seconds, then 1, 2, 4, 8, 16, and 32 minutes. Each attempt is signed again, so a retry still passes your check, and the event
Delivery and retriesidlets you skip a repeat.- STOP
{ "error": { "code": "blocked", "reason": "opted_out", "message": "This person opted out. Nothing was sent. Only a message from them opts them back in.", "requestId": "req_3f2a9c1d7e5b4a60", "details": [{ "path": "reason", "message": "opted_out" }] } }Consent and opt-out, enforced
STOP, START, and HELP are answered by MessageOS, whatever your system does. A send to someone who opted out returns 409 with the reason
Why a send is blockedopted_out, and a first message needs the consent you hold. Every error carries arequestId. "quietHoursEnforced": true, "onQuiet": "defer"reject: 409defer: 202 deferredUntilreplies in the hour not heldQuiet hours
Where
Quiet hoursGET /v1/whoamishowsquietHoursEnforcedtrue, a send you start in quiet hours is rejected, or deferred with the time they end. Where it is false, the time of day is yours to keep. A reply that names a message the person sent in the last hour is not held, where your agent takes replies."limits": { "requestsPerMinute": null, "sendsPerAgent": null, "sendsPerContact": null }No caps on volume
MessageOS does not cap how many messages you send or how many requests you make.
Rate limitsGET /v1/whoamishows it for your key: each limit is null while none is set.
The API
A small API, documented end to end.
Every endpoint page of the reference is generated from the same contract the API checks. Each shows its request in cURL, JavaScript, Python, PHP, Ruby, Go, Java, and C#, and has a Markdown copy for a coding assistant.
Messages
- POST
/v1/messagesSend any kind of message, or a reply that names the person's message in inReplyTo.
- GET
/v1/messages/{id}Where one message stands: sent, delivered, read, or failed.
- DELETE
/v1/messages/{id}On requestAsk the network to take back a message that has not been read.
- POST
/v1/messages/draftsOn requestDrafts to approve. With mode craft, MessageOS writes the text from your instructions.
Phones
- GET
/v1/capabilitiesOn requestWhether a phone can receive RCS from your agent, and which features it has.
- POST
/v1/typingOn requestShow the typing indicator while your system works on an answer.
Contacts and conversations
- POST
/v1/contactsCreate or update a contact by phone number, with its attributes.
- GET
/v1/contactsList contacts by phone number, externalId, or updatedSince.
- GET
/v1/conversations/{id}/messagesRead a conversation and its messages.
Webhooks
- POST
/v1/webhooksRegister a public https receiver and the events it takes.
- POST
/v1/webhooks/{id}/testSend a signed webhook.test event, with no message to anyone.
- GET
/v1/webhooks/{id}/deliveriesThe 25 newest deliveries, with the status your server answered.
- POST
/v1/webhooks/{id}/rotate-secretOn requestReplace the signing secret.
Your account
- GET
/v1/whoamiYour agent, your key's scopes, and what is turned on for you.
- GET
/v1/usage/summaryOn requestSent, delivered, read, and failed counts, with opt-outs and opt-ins, for up to 92 days.
- POST
/v1/eventsOn requestTell MessageOS something happened, such as a new lead, for an event playbook.
On request means the route answers 404 until MessageOS turns it on for your agent, so ask when you need one. For the typing indicator, the capability check, and taking a message back, rcsExtras in GET /v1/whoami says whether they are on.
Example app
The Kitchen Sink. Every message type, in one conversation.
A small working app with public code. Text it and it sends a menu. Tap a card and that kind of message arrives on your phone, with a line that names the field of the API that made it. It hears each message as reply.received at a signed webhook and answers with POST /v1/messages.
- demos
- 10demos
- actions
- 6actions
- file kinds
- 4file kinds
- dependencies
- 0dependencies
Plain JavaScript for Node.js 20 or newer, with nothing to install to run it.
cardA vertical rich card arrives, then a horizontal one, each a message of its own.
Recorded on a real Android phone. No sound.
Quickstart
Key, send, receive. Three steps.
There is one kind of key and no separate test mode: a message the API sends goes to a real phone. Every sample uses only what comes with its language and prints the status and the answer.
- 1
Get a key
An owner or admin of your brand makes a client key in the MessageOS dashboard, under Developers. It starts with
mosc_and is shown once. Check it withGET /v1/whoami, which names your agent, your scopes, and what is turned on.curl 'https://api.messageos.ai/v1/whoami' \ -H 'Authorization: Bearer mosc_...' - 2
Send a message
One call sends a first message to a new person, with the consent you hold. Until your agent is launched it reaches only its testers, so put a tester phone in place of the example number.
curl -X POST 'https://api.messageos.ai/v1/messages' \ -H 'Authorization: Bearer mosc_...' \ -H 'Idempotency-Key: welcome-15555550123' \ -H 'Content-Type: application/json' \ -d '{ "to": { "phoneNumber": "+15555550123" }, "text": "Thanks for signing up. Reply STOP to opt out.", "consent": { "source": "checkout_form", "capturedAt": "2026-10-28T23:00:00.000Z" } }' - 3
Hear the reply
Register a public https address with the events it takes. The answer carries the signing secret, once. Every tap and every word the person sends then arrives as
reply.received.cURLcurl -X POST https://api.messageos.ai/v1/webhooks \ -H 'Authorization: Bearer mosc_...' \ -H 'Content-Type: application/json' \ -d '{"url":"https://example.com/messageos/webhooks","eventTypes":["reply.received","message.delivered","message.read","message.failed","contact.opted_out","contact.opted_in"]}'
How do I get an API key?
An owner or admin of your brand makes a client key in the MessageOS dashboard, under Developers. A key starts with mosc_, is shown once when it is made, and does only what its permissions allow. To change a key's permissions, make a new key and revoke the old one.
Is there a test mode?
There is one kind of key and no separate test mode: a message the API sends goes to a real phone. Until your agent is launched, it reaches only its testers, the phones MessageOS has added for you. POST /v1/webhooks/{id}/test checks your receiver without messaging anyone.
Which languages can I use?
Any language that can make an HTTPS request. Every page of the API reference shows its request in cURL, JavaScript, Python, PHP, Ruby, Go, Java, and C#, and each sample uses only what comes with its language.
Does MessageOS limit how much I send?
No. MessageOS does not cap how many messages you send or how many requests you make. GET /v1/whoami shows each limit under limits, and each is null while none is set.
What happens if a request times out?
Send it again with the same Idempotency-Key and the same body. Once an answer is stored for the key you get that answer, and the message is not sent a second time. A 500 or a 503 is not stored, so wait the seconds in Retry-After and send the same request again.
How do I know a message arrived?
A 201 with status sent means the messaging network took the message. GET /v1/messages/{id} answers with its latest status, sent, delivered, read, or failed, and your webhook hears message.delivered, message.read, and message.failed as they happen, each with the reference you sent.
Who answers STOP and HELP?
MessageOS does, whatever your system does. Your webhook still receives each one as reply.received, so your system must not answer them too. A send to someone who opted out returns 409 with the reason opted_out and sends nothing.
Is every feature on for every account?
Text sends for every agent. Buttons, cards, carousels, and files need richMessages, replies need a reply window, and the typing indicator, the capability check, taking a message back, expiry, and traffic type need rcsExtras. GET /v1/whoami shows each for your key, and MessageOS turns them on for your agent on request.
Can my own system answer customers instead of the assistant?
Yes. Your system hears each message as reply.received and answers with POST /v1/messages. Pause the assistant on the Agent page of the dashboard, or ask MessageOS to set your agent to API only, so the person does not get two replies.
Is there example code?
The Kitchen Sink is a small working app with public code. It receives reply.received at a signed webhook and answers with every kind of message the API sends. It is plain JavaScript for Node.js 20 or newer, with no dependencies to install.
Build on RCS
Read the docs. Then send your first card.
The docs are public: the API reference, the guides, and the Kitchen Sink. Your key works with the agent MessageOS sets up for your business, with your name and logo on every message.



