Developers
Send SMS and RCS over the HTTP API or SMPP, track the status of every message and receive updates in your own system.
GET /api/v1/routes.Every call uses HTTPS and the token in the Authorization header:
Authorization: Bearer TOKEN Content-Type: application/json
Never put the token in apps, web pages or public repositories. If you suspect a leak, generate new credentials in the dashboard: the old ones stop working immediately.
The API base address is shown in the dashboard, together with your credentials.
Sends a message.
| Field | Required | Description |
|---|---|---|
sid | yes | The SID (sender) of your account. |
to | yes | Destination number. For Brazil, with or without 55 (5511999990000 or 11999990000). |
text | yes | Message text. |
reference | no | Your own identifier (up to 128 characters). Resending the same reference does not create a duplicate. |
channel | no | sms (default) or rcs. |
curl -X POST https://[API]/api/v1/messages \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"sid":"SID","to":"5511999990000","text":"Your code is 482913","reference":"pedido-1001"}'
Response:
{ "id": "dx1234567", "status": "queued", "amount": 45000, "currency": "BRL" }
The amount field is the charge in millionths of the currency (45000 = BRL 0.045).
Long messages are supported: Diamond X splits the text and the handset shows it as a single message. Each part holds up to 153 characters without accents (or 67 with accents or emojis), up to 20 parts. Billing is per part; a message of up to 160 characters (or 70 with accents) is a single part.
Returns the status of a message.
{ "id": "dx1234567", "status": "delivered", "phone": "5511999990000", "channel": "sms",
"created_at": "…", "updated_at": "…", "delivered_at": "…" }
| Status | Meaning |
|---|---|
queued | Queued at Diamond X. |
sent | Accepted by the carrier, awaiting confirmation. |
delivered | Delivered to the handset. |
undelivered | The carrier could not deliver it. |
failed | Failed or rejected. |
unknown | No final confirmation from the carrier. |
Lists the active SIDs on your account, with channel (sms or rcs), country, price and currency.
Shows the available balance, the balance reserved for sends in progress and the account currency.
With an RCS SID enabled on your account, use the same send endpoint with "channel": "rcs":
{"sid":"SID_RCS","to":"5511999990000","text":"Your order is out for delivery!","channel":"rcs"}
The message arrives with your brand's name, logo and verification badge. Cards, carousels and buttons, and your brand agent registration, are covered in the RCS guide inside the dashboard.
Register an HTTPS URL of your system in the dashboard to receive message status updates without polling the API.
X-DiamondX-Signature header, using the secret shown in the dashboard. Validate the signature before processing.Errors return the HTTP status code and a message in the error field.
| Code | When it happens |
|---|---|
400 | Invalid or missing field, number not valid for the SID's country, or SID not active on the account. |
401 | Missing or invalid token. |
403 | Access not allowed: IP not registered, inactive account or SID not enabled. |
404 | Message not found. |
Questions about the integration? Talk to technical support: WhatsApp · site@diamondx.app