Skip to content
MessageOS.ai

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
POST/v1/messages
Ready
{ "id": "msg_123", "status": "sent", "type": "card", "channel": "rcs", "contactId": 42, "reference": "order-8841", "auditId": 123 }
9:41
Your brand
RCS message

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.

A body for each type
  • Rich card

    richMessages

    A 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 agent

    The smallest message is a recipient and up to 2000 characters. to takes a contactId, a phoneNumber, or your own externalId.

    "text": "Your table is ready."
  • Suggested replies

    richMessages

    Up 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

    richMessages

    Buttons 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

    richMessages

    An 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

    richMessages

    2 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

    replyWindowSeconds

    Name 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": 981
  • A first message

    contacts:write

    To 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 MessageOS

    Text 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

    rcsExtras

    ttlSeconds 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.

Webhooks guide
  1. 1Ask

    Send a question with suggested replies, each with your own postbackData.

  2. 2Hear

    The tap reaches your server as reply.received, signed with your webhook's secret.

  3. 3Answer

    Name the person's message in inReplyTo. Quiet hours do not hold a reply.

9:41
Your brand
RCS message
Your server receives
reply.received
POST /webhooks/messageos
Content-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"
  }
}
Signature checked200 OKwithin 10 seconds
POST/v1/messages
your answer
{ "to": { "contactId": 42 }, "text": "See you soon.", "inReplyTo": 981 }
201 Createda reply: no consent record needed

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-15555550123
    POSTIdempotency-Key: welcome-15555550123
    Thanks for signing up.1 message

    Idempotency keys

    POST /v1/messages takes an Idempotency-Key of 8 to 128 characters. If a request times out, send it again with the same key and body: you get the stored answer, marked Idempotent-Replay: true, and the message is not sent a second time. The one exception is provider_error: the network did not confirm the message, so the same key sends again, and the person can get it twice.

    How a key works
  • 503 service_unavailable
    Retry-After: <seconds>
    same keysame bodyat most one message

    Safe to retry

    A 500 or a 503 is never stored for the key. Wait the seconds in Retry-After and send the same request again. However often you retry, at most one message is sent.

    Every error code
  • x-messageos-timestamp: 1793228410
    x-messageos-signature: sha256=64f0c92b53374ee…
    HMAC-SHA256300 second window

    Signed webhooks

    Every event carries x-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.

    Verify a signature
    1. now
    2. 30s
    3. 1m
    4. 2m
    5. 4m
    6. 8m
    7. 16m
    8. 32m
    2xx in 10 seconds: done410: endpoint disabled8 tries, then dead

    Webhook 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 id lets you skip a repeat.

    Delivery and retries
  • 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 opted_out, and a first message needs the consent you hold. Every error carries a requestId.

    Why a send is blocked
  • "quietHoursEnforced": true,
    "onQuiet": "defer"
    reject: 409defer: 202 deferredUntilreplies in the hour not held

    Quiet hours

    Where GET /v1/whoami shows quietHoursEnforced true, 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.

    Quiet hours
  • "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. GET /v1/whoami shows it for your key: each limit is null while none is set.

    Rate limits

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.

Open the API reference

Messages

  • POST/v1/messages

    Send 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 request

    Ask the network to take back a message that has not been read.

  • POST/v1/messages/draftsOn request

    Drafts to approve. With mode craft, MessageOS writes the text from your instructions.

Phones

  • GET/v1/capabilitiesOn request

    Whether a phone can receive RCS from your agent, and which features it has.

  • POST/v1/typingOn request

    Show the typing indicator while your system works on an answer.

Contacts and conversations

  • POST/v1/contacts

    Create or update a contact by phone number, with its attributes.

  • GET/v1/contacts

    List contacts by phone number, externalId, or updatedSince.

  • GET/v1/conversations/{id}/messages

    Read a conversation and its messages.

Webhooks

  • POST/v1/webhooks

    Register a public https receiver and the events it takes.

  • POST/v1/webhooks/{id}/test

    Send a signed webhook.test event, with no message to anyone.

  • GET/v1/webhooks/{id}/deliveries

    The 25 newest deliveries, with the status your server answered.

  • POST/v1/webhooks/{id}/rotate-secretOn request

    Replace the signing secret.

Your account

  • GET/v1/whoami

    Your agent, your key's scopes, and what is turned on for you.

  • GET/v1/usage/summaryOn request

    Sent, delivered, read, and failed counts, with opt-outs and opt-ins, for up to 92 days.

  • POST/v1/eventsOn request

    Tell 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.

The full quickstart
  1. 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 with GET /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. 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. 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.

    cURL
    curl -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"]}'

Questions

Before you build.

The rest is in the docs, or talk to us.

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.