cURL
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": [ {} ] }
sms
email
letter
Show Template object properties
curl -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": "[email protected]", "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": "[email protected]", "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": "[email protected]", "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" } ] }