Legacy API Notice: This documentation covers the Legacy Sent API (v2). While this API remains fully supported, we recommend new integrations use the latest Sent API v3 for enhanced features, improved performance, and long-term support.

Send message to phone number

Sends a message to a phone number using a template. The phone number doesn't need to be a pre-existing contact. The message can be sent via SMS or WhatsApp. Optionally specify a webhook URL to receive delivery status updates. The customer ID is extracted from the authentication token.

POST
/v2/messages/phone

Request Body

application/json
  1. body

Request to send a message to a phone number using a template

phoneNumber*string

The phone number to send the message to, in international format (e.g., +1234567890)

Length1 <= length
templateId*string

The unique identifier of the template to use for the message

Formatuuid
Length1 <= length
templateVariables?|

Optional key-value pairs of template variables to replace in the template body. For example, if your template contains "Hello {{name}}", you would provide { "name": "John Doe" }

Response Body

No Content

Example Request
curl -X POST 'https://api.sent.dm/v2/messages/phone' \  -H 'Content-Type: application/json' \  -d '{  "phoneNumber": "+1234567890",  "templateId": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",  "templateVariables": {    "name": "John Doe",    "order_id": "12345"  }}'
Example Response
Empty