Sending SMS
Send outbound SMS messages through the gateway. Messages are queued for asynchronous delivery via RingCentral with automatic retries on failure.
When to use this
- Send transactional or notification SMS to end users.
- Send messages from any SMS-enabled RingCentral phone number assigned to your tenant.
Prerequisites
- A valid API key (Authentication).
- An active RingCentral connection for the tenant (Connecting RingCentral).
- The "from" phone number must be SMS-enabled in RingCentral and assigned to your account.
How it works
- Queue — A
POST /v1/sms/sendrequest validates the payload and places the message in a background queue. The API responds immediately with202 Acceptedand amessageId. - Send — A background worker picks up the job, resolves the RingCentral extension for the "from" number, and calls the RingCentral SMS API.
- Status update — On success the message status changes to
sent. On failure it changes tofailedwith an error description. - Notification — A
sms_statusevent is published to WebSocket subscribers after each status change.
Message lifecycle
| Status | Meaning |
|---|---|
queued | Message accepted and waiting in the send queue. |
sending | Worker has picked up the job and is sending via RingCentral. |
sent | RingCentral accepted the message for delivery. |
failed | Delivery failed after all retry attempts. The error field contains the reason. |
Phone number format
Both to and from must be in E.164 format: a + followed by the country code and subscriber number (9–15 digits total).
Valid E.164 examples
+15551234567 (US)+442071234567 (UK)+61412345678 (AU)
Example
Send a message
curl -X POST https://smsgateway-api.onrender.com/v1/sms/send \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"to": "+15559876543","from": "+15551234567","body": "Your verification code is 123456"}'
202 Accepted
json
{"messageId": "msg_a1b2c3d4e5f6","status": "queued"}
Check delivery status
Poll for status
curl https://smsgateway-api.onrender.com/v1/sms/status/msg_a1b2c3d4e5f6 \-H "Authorization: Bearer YOUR_API_KEY"
200 OK
json
{"messageId": "msg_a1b2c3d4e5f6","status": "sent","rcMessageId": "mock_abc123def456","error": null,"to": "+15559876543","from": "+15551234567","body": "Your verification code is 123456","createdAt": "2026-03-01T10:00:00.000Z","updatedAt": "2026-03-01T10:00:01.000Z"}
Retries and rate limits
- Automatic retries — Failed send attempts are retried up to 3 times with exponential backoff.
- Per-phone rate limit — Each "from" number is limited to 40 messages per minute. If exceeded, the job is delayed by 5 seconds and retried automatically.
- API rate limit — API keys are subject to per-key rate limits (Rate Limits).
Message body limits
The body field must be between 1 and 1,600 characters. Messages exceeding this limit are rejected with a 400 error.
Optional fields
The userId field is an optional string you can include to associate the message with a user in your system. It is stored with the message and returned in queries, but has no effect on delivery.
Common errors
| Status | Error | Cause |
|---|---|---|
| 400 | to, from, and body are required | One or more required fields missing. |
| 400 | to and from must be valid E.164 phone numbers | Invalid phone number format. |
| 400 | body must be 1-1600 characters | Message body empty or too long. |
| 403 | Tenant suspended or inactive | The tenant associated with this API key is not active. |
If a message reaches
failed status, the error field on the message object describes the specific failure reason, such as an unregistered phone number or a RingCentral connection issue.Related docs
- SMS API Reference — Full endpoint details
- Receiving SMS — Handle inbound messages
- WebSocket Events — Real-time status updates
- Rate Limits — Per-phone and per-key limits