Authentication
This endpoint requires API key authentication. Include your API key in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Request Body
The destination phone number in E.164 format (e.g., +15551234567)
The text content of the message to send
The sender phone number. If not provided, the default messaging service number will be used
Response
The unique identifier for the sent message from the provider
The current status of the message (e.g., “queued”, “sent”, “delivered”)
{
"sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "queued"
}
Error Responses
The error code indicating what went wrong
Additional details about the error
Error Codes
missing_params (400) - Required parameters are missing from the request
provider_not_configured (400) - The workspace doesn’t have a messaging provider configured
send_failed (500) - Message sending failed due to an internal error
curl -X POST https://api.example.com/api/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+15551234567",
"body": "Hello from the messaging API!",
"from": "+15559876543"
}'