outbound (sent from the channel’s number, through the API or, on channels in coexistence mode, from the WhatsApp Business app) or inbound (received from a customer). It does not depend on the provider: the same object serves any channel, present or future.
The message object
Use
metadata to link the message to your domain, such as the order ID. It is returned when you retrieve the message and in its events.
Content removed by retention
Routa keeps the content of a message for a period that depends on your plan. After that, the content is removed:content becomes null and content_redacted_at gives the time of the removal. The rest of the message stays, including metadata.
Treat
content as optional when you read old messages. The removal is permanent: extending retention later does not bring the content back. The message.* events already delivered do not change. See Data retention.Lifecycle
The status never goes back
Providers send status updates out of order and more than once. Routa only applies a transition that moves forward in the cycle, so a message never goes fromread back to sent because an old notice arrived late. You can write if (message.status === 'delivered') with no defensive ordering logic.
failed is accepted only while the message has not been delivered yet (accepted or sent).
Retries are not a status
If the provider fails temporarily, Routa tries again on its own, with growing delays. Meanwhile the message staysaccepted. There is no queued or retrying status in the public API. If the attempts run out, the message becomes failed. The reason shows up in the message timeline in the dashboard.
Failure reasons
failure_code explains why the message became failed. It is never a provider code.
The set can grow. Treat an unknown value as a generic failure and use
failure_code only to decide what to show or log.Inbound messages
An inbound message starts withdirection: "inbound" and status: "delivered", and produces the message.received event. To tell the sender you read it, use POST /v1/messages/{id}/read, which moves the message to read.
A content type Routa cannot model yet, such as interactive or contacts, arrives as { "type": "unsupported" }: the message exists and produces message.received.
Two inbound things are ignored on purpose: reactions and system notices, such as a contact changing their number. They create no message, produce no message.received and do not count as usage.
Messages sent from the WhatsApp Business app
On a channel connected in coexistence mode, the number stays in the WhatsApp Business app. What the business sends from the app, or from a linked device, also shows up in the API.- The message is
outbound, withorigin: "business_app". Routa did not send it: it only records it. - It starts as
sent, without going throughaccepted. The only event ismessage.sent, with nomessage.accepted.accepted_atandsent_atmark the moment the business sent it. - Later status changes (
message.delivered,message.readandmessage.failed) arrive as usual. - It uses none of your allowance and does not appear in
GET /v1/usage. tois the number in E.164 format. When the provider only reports an identifier of the person,tocarries that identifier instead of a number. The same customer, by number and by identifier, appears as two conversations.- If the business edits the text or the caption in the app,
contentis updated. If it deletes the message,contentbecomesnullandcontent_redacted_atrecords the moment. Neither produces an event.
Imported history
When the channel is connected, Routa silently imports the conversations the business already had in the app. These messages appear inGET /v1/messages and GET /v1/messages/{id}, but:
- They produce no event or webhook, use none of your allowance and do not count as usage.
accepted_atis the original time of the message, so the order follows real time. Those sent by the business haveorigin: "business_app", and the received ones,origin: null.- Content older than your plan’s retention already arrives with
content: nullandcontent_redacted_at. - Only text and location carry content. Images, audio, videos and documents arrive as
{ "type": "unsupported" }.
Content types
Thecontent field is an object discriminated by type.
Today
POST /v1/messages sends only text and template. The other types, except reaction, appear in inbound messages and in the history, and you can read them as usual. To download the media of a message, use its media_id in GET /v1/media/{id}.Template content
The content keeps the values as you sent them:
Both keys are absent when the template asks for nothing there, and on old messages. See Header and buttons.
Validation at accept time
Routa validates the message when it accepts it, not when it sends it. This turns predictable problems into an immediate422 error instead of a message.failed seconds later:
- The channel must be
active(channel_inactive). - The channel must support the content type (
capability_unsupported). - The recipient must be a valid number (
invalid_recipient). - A template must be approved and sendable (
template_not_approved,template_paused,template_not_sendable). - The body, header and button parameters must be exactly what the template asks for (
content_rejected). - The file of a media header must belong to this project, be available and have an accepted type (
media_not_found,media_not_ready,media_content_type_rejected). - Provide
textortemplate. With neither, the API respondscontent_rejected. With both, it sends the template and ignorestext.