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>"
}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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alphagov/notifications-api/llms.txt
Use this file to discover all available pages before exploring further.
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"
}'
{
"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
}
{
"status_code": 400,
"errors": [
{
"error": "InvalidPhoneError",
"message": "Not a valid phone number"
}
]
}
{
"status_code": 400,
"errors": [
{
"error": "ValidationError",
"message": "phone_number is a required property"
}
]
}
{
"status_code": 400,
"errors": [
{
"error": "BadRequestError",
"message": "Content for template has a character count greater than the limit of 918"
}
]
}
{
"status_code": 403,
"errors": [
{
"error": "BadRequestError",
"message": "Service is not allowed to send sms"
}
]
}
{
"status_code": 404,
"errors": [
{
"error": "NoResultFound",
"message": "No result found"
}
]
}
{
"status_code": 429,
"errors": [
{
"error": "RateLimitError",
"message": "Exceeded rate limit for key type LIVE of 3000 requests per 60 seconds"
}
]
}
{
"status_code": 429,
"errors": [
{
"error": "TooManyRequestsError",
"message": "Exceeded send limits (daily: 1000) for today"
}
]
}