SMS

Send SMS messages, check delivery status, and query message history.

POST/v1/sms/sendapp or admin

Queue an outbound SMS message for delivery.

Request body

NameTypeRequiredDescription
tostringRequiredRecipient phone number in E.164 format (+ followed by 10–15 digits).
fromstringRequiredSender phone number in E.164 format. Must be an SMS-enabled number on the tenant's RingCentral account.
bodystringRequiredMessage text, 1–1600 characters.
userIdstringOptionalOptional identifier to associate the message with a user in your system.
Request
curl -X POST https://smsgateway-api.onrender.com/v1/sms/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+15551234567",
"from": "+15559876543",
"body": "Hello from Gravity SMS!"
}'

Success response

202 Accepted
json
{
"messageId": "msg_a1b2c3d4e5f6",
"status": "queued"
}

Error responses

400 Missing fields
json
{
"error": "to, from, and body are required"
}
400 Invalid phone number
json
{
"error": "to and from must be valid E.164 phone numbers"
}
400 Body too long
json
{
"error": "body must be 1-1600 characters"
}
401 Unauthorized
json
{
"error": "Missing or invalid API key"
}
403 Tenant inactive
json
{
"error": "Tenant suspended or inactive"
}
429 Rate limited
json
{
"error": "Too many requests"
}
GET/v1/sms/status/:messageIdapp or admin

Get the current status and details of a message.

Path parameters

NameTypeRequiredDescription
messageIdstringRequiredMessage ID in the format msg_ followed by 12 hex characters.
Request
curl https://smsgateway-api.onrender.com/v1/sms/status/msg_a1b2c3d4e5f6 \
-H "Authorization: Bearer YOUR_API_KEY"

Success response

200 OK
json
{
"messageId": "msg_a1b2c3d4e5f6",
"status": "sent",
"rcMessageId": "12345678",
"error": null,
"to": "+15551234567",
"from": "+15559876543",
"body": "Hello from Gravity SMS!",
"createdAt": "2026-03-01T10:00:00.000Z",
"updatedAt": "2026-03-01T10:00:02.000Z"
}
Status values
queuedsending sent or failed. Inbound messages have status received.

Error responses

400 Invalid format
json
{
"error": "Invalid messageId format"
}
404 Not found
json
{
"error": "Message not found"
}
GET/v1/sms/messagesapp or admin

Query paginated message history with optional filters.

Query parameters

NameTypeRequiredDescription
appIdstringOptionalFilter by app ID. Admin only when filtering other apps.
tenantIdstringOptionalFilter by tenant ID. Admin only.
userIdstringOptionalFilter by the userId field set when sending.
directionstringOptionalFilter by direction: "outbound" or "inbound".
statusstringOptionalFilter by status: "queued", "sending", "sent", "failed", or "received".
fromstringOptionalFilter by sender phone number.
tostringOptionalFilter by recipient phone number.
startDatestringOptionalISO 8601 timestamp. Return messages created on or after this date.
endDatestringOptionalISO 8601 timestamp. Return messages created on or before this date.
pagenumberOptionalPage number, starting at 1. Default: 1.
limitnumberOptionalResults per page. Default: 20, max: 100.
Request
curl "https://smsgateway-api.onrender.com/v1/sms/messages?direction=outbound&limit=5" \
-H "Authorization: Bearer YOUR_API_KEY"

Success response

200 OK
json
{
"messages": [
{
"messageId": "msg_a1b2c3d4e5f6",
"jobId": "1",
"appId": "app_abc123def456abcd",
"tenantId": "tenant_abc123def456abcd",
"userId": null,
"direction": "outbound",
"to": "+15551234567",
"from": "+15559876543",
"body": "Hello from Gravity SMS!",
"status": "sent",
"rcMessageId": "12345678",
"error": null,
"createdAt": "2026-03-01T10:00:00.000Z",
"updatedAt": "2026-03-01T10:00:02.000Z"
}
],
"total": 1,
"page": 1,
"limit": 5
}

Related docs