curl --request GET \
--url https://api.example.com/v2/templates{
"templates": [
{
"id": "<string>",
"type": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"created_by": "<string>",
"version": 123,
"body": "<string>",
"subject": "<string>",
"name": "<string>",
"postage": "<string>"
}
],
"status_code": 123,
"errors": [
{}
]
}curl --request GET \
--url https://api.example.com/v2/templates{
"templates": [
{
"id": "<string>",
"type": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"created_by": "<string>",
"version": 123,
"body": "<string>",
"subject": "<string>",
"name": "<string>",
"postage": "<string>"
}
],
"status_code": 123,
"errors": [
{}
]
}Retrieves all templates for your service. You can optionally filter by template type.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.
sms - SMS message templatesemail - Email templatesletter - Letter templatesShow Template object properties
sms, email, or lettercurl -X GET "https://api.notifications.service.gov.uk/v2/templates" \
-H "Authorization: Bearer your_api_key_here"
{
"templates": [
{
"id": "f33517ff-2a88-4f6e-b855-c550268ce08a",
"type": "email",
"created_at": "2024-01-15T14:30:00.000000Z",
"updated_at": "2024-01-16T09:15:00.000000Z",
"created_by": "user@example.gov.uk",
"version": 3,
"body": "Hello ((name)),\n\nYour reference number is ((reference)).",
"subject": "Your application has been received",
"name": "Application confirmation email",
"postage": null
},
{
"id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
"type": "sms",
"created_at": "2024-01-10T10:00:00.000000Z",
"updated_at": null,
"created_by": "admin@example.gov.uk",
"version": 1,
"body": "Your security code is ((code)). Do not share this code.",
"subject": null,
"name": "Security code SMS",
"postage": null
},
{
"id": "b2c3d4e5-f6a7-4b6c-9d0e-1f2a3b4c5d6e",
"type": "letter",
"created_at": "2024-01-05T08:00:00.000000Z",
"updated_at": "2024-01-12T11:30:00.000000Z",
"created_by": "letters@example.gov.uk",
"version": 2,
"body": "Dear ((name)),\n\nThis is to confirm your appointment on ((date)).",
"subject": null,
"name": "Appointment confirmation letter",
"postage": "second"
}
]
}
{
"status_code": 400,
"errors": [
{
"error": "ValidationError",
"message": "type is not one of: sms, email, letter"
}
]
}
{
"status_code": 403,
"errors": [
{
"error": "AuthError",
"message": "Invalid token: service not found"
}
]
}