POST /v1/messages sends a message through a channel. This guide covers sending text. For templates, see Send a template.
Required scope:
messages:write.Request
Provide one of
text and template. With neither, the API returns 422 content_rejected.
Response
The API responds202 Accepted with the message in the accepted state:
id. It is the key to retrieve the message and to correlate delivery events. Every response also carries the Routa-Request-Id header; quote it when you contact support.
Avoid duplicates
If the network fails after you send the request, you do not know whether it arrived. Resending carelessly could create two messages. To avoid that, send a uniqueIdempotency-Key per logical message:
- Use a UUID v4 and generate it once, before the first attempt. Reuse the same key on every retry.
- A second request with the same key and the same body returns the original response, with the
Idempotent-Replay: trueheader. - Reusing the key with a different body returns
409 idempotency_key_reuse.
Common errors
See Errors for the full format.