Skip to main content
POST
/
v2
/
notifications
/
sms
Send SMS Notification
curl --request POST \
  --url https://api.example.com/v2/notifications/sms \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone_number": "<string>",
  "template_id": "<string>",
  "personalisation": {},
  "reference": "<string>",
  "sms_sender_id": "<string>",
  "scheduled_for": "<string>"
}
'
{
  "id": "<string>",
  "reference": "<string>",
  "content": {
    "content.body": "<string>",
    "content.from_number": "<string>"
  },
  "uri": "<string>",
  "template": {
    "template.id": "<string>",
    "template.version": 123,
    "template.uri": "<string>"
  },
  "scheduled_for": "<string>"
}
Send an SMS notification to a phone number.

Request Body

phone_number
string
required
The phone number to send the SMS to. Must be a valid phone number.
template_id
string
required
The UUID of the SMS template to use.
personalisation
object
Key-value pairs to fill in placeholders in the template. Values must be strings or dictionaries (for file uploads).
reference
string
A unique identifier for this notification that you can use to identify it later. Maximum 1,000 characters.
sms_sender_id
string
The UUID of a specific SMS sender to use. If not provided, the default sender for the template will be used.
scheduled_for
string
An ISO 8601 formatted datetime string to schedule the notification for sending. Must be within the next 24 hours. Set to null to send immediately.

Response

id
string
The unique identifier for this notification.
reference
string
The reference you provided, or null if you did not provide one.
content
object
The content of the SMS notification.
content.body
string
The SMS message body with placeholders filled in.
content.from_number
string
The phone number the SMS will be sent from.
uri
string
The URI to retrieve this notification.
template
object
Information about the template used.
template.id
string
The UUID of the template.
template.version
integer
The version number of the template.
template.uri
string
The URI to retrieve the template.
scheduled_for
string
The datetime the notification is scheduled for, or null if sending immediately.

Example Request

curl -X POST https://api.notifications.service.gov.uk/v2/notifications/sms \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+447700900123",
    "template_id": "f33517ff-2a88-4f6e-b855-c550268ce08a",
    "personalisation": {
      "name": "John Smith",
      "appointment_date": "12 March 2024"
    },
    "reference": "appointment-reminder-123"
  }'

Example Response

{
  "id": "740e5834-3a29-46b4-9a6f-16142fde533a",
  "reference": "appointment-reminder-123",
  "content": {
    "body": "Hello John Smith, your appointment is on 12 March 2024.",
    "from_number": "GOVUK"
  },
  "uri": "https://api.notifications.service.gov.uk/v2/notifications/740e5834-3a29-46b4-9a6f-16142fde533a",
  "template": {
    "id": "f33517ff-2a88-4f6e-b855-c550268ce08a",
    "version": 1,
    "uri": "https://api.notifications.service.gov.uk/services/8b3aa916-e138-4d4b-8c96-da8b6ddfe9a2/templates/f33517ff-2a88-4f6e-b855-c550268ce08a"
  },
  "scheduled_for": null
}

Error Responses

400 Bad Request

Invalid phone number
{
  "status_code": 400,
  "errors": [
    {
      "error": "InvalidPhoneError",
      "message": "Not a valid phone number"
    }
  ]
}
Missing required field
{
  "status_code": 400,
  "errors": [
    {
      "error": "ValidationError",
      "message": "phone_number is a required property"
    }
  ]
}
Message too long
{
  "status_code": 400,
  "errors": [
    {
      "error": "BadRequestError",
      "message": "Content for template has a character count greater than the limit of 918"
    }
  ]
}

403 Forbidden

Service does not have permission to send SMS
{
  "status_code": 403,
  "errors": [
    {
      "error": "BadRequestError",
      "message": "Service is not allowed to send sms"
    }
  ]
}

404 Not Found

Template not found
{
  "status_code": 404,
  "errors": [
    {
      "error": "NoResultFound",
      "message": "No result found"
    }
  ]
}

429 Too Many Requests

Rate limit exceeded
{
  "status_code": 429,
  "errors": [
    {
      "error": "RateLimitError",
      "message": "Exceeded rate limit for key type LIVE of 3000 requests per 60 seconds"
    }
  ]
}
Daily sending limit exceeded
{
  "status_code": 429,
  "errors": [
    {
      "error": "TooManyRequestsError",
      "message": "Exceeded send limits (daily: 1000) for today"
    }
  ]
}

Build docs developers (and LLMs) love