GOV.UK Notify · Schema

Notification

A GOV.UK Notify notification object returned when retrieving notification status.

NotificationsEmailSMSText MessagesLettersGovernmentUnited KingdomPublic SectorGDSREST

Properties

Name Type Description
id string Unique identifier for the notification.
reference stringnull Client-supplied reference string.
email_address string Recipient email address (email notifications only).
phone_number string Recipient phone number (SMS notifications only).
line_1 string Address line 1 (letter notifications only).
line_2 stringnull
line_3 stringnull
line_4 stringnull
line_5 stringnull
line_6 stringnull
postcode stringnull Postcode (letter notifications only).
type string Type of notification.
status string Current delivery status. Values vary by notification type.
template object Reference to the template used.
body string Rendered notification body.
subject stringnull Rendered email subject (email notifications only).
created_at string ISO 8601 timestamp when the notification was created.
sent_at stringnull ISO 8601 timestamp when the notification was sent.
completed_at stringnull ISO 8601 timestamp when the notification reached a terminal status.
estimated_delivery stringnull Estimated delivery time (letter notifications only).
cost_in_pounds numbernull Cost of the notification in GBP.
postage stringnull Postage class used (letter notifications only).
created_by_name stringnull Name of the user who sent the notification (if sent via the web interface).
View JSON Schema on GitHub

JSON Schema

notification.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/gov-uk-notify/main/json-schema/notification.json",
  "title": "Notification",
  "description": "A GOV.UK Notify notification object returned when retrieving notification status.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the notification."
    },
    "reference": {
      "type": ["string", "null"],
      "description": "Client-supplied reference string."
    },
    "email_address": {
      "type": "string",
      "format": "email",
      "description": "Recipient email address (email notifications only)."
    },
    "phone_number": {
      "type": "string",
      "description": "Recipient phone number (SMS notifications only)."
    },
    "line_1": { "type": "string", "description": "Address line 1 (letter notifications only)." },
    "line_2": { "type": ["string", "null"] },
    "line_3": { "type": ["string", "null"] },
    "line_4": { "type": ["string", "null"] },
    "line_5": { "type": ["string", "null"] },
    "line_6": { "type": ["string", "null"] },
    "postcode": { "type": ["string", "null"], "description": "Postcode (letter notifications only)." },
    "type": {
      "type": "string",
      "enum": ["email", "sms", "letter"],
      "description": "Type of notification."
    },
    "status": {
      "type": "string",
      "description": "Current delivery status. Values vary by notification type.",
      "examples": [
        "created", "sending", "delivered", "permanent-failure",
        "temporary-failure", "technical-failure", "accepted", "received",
        "pending", "sent", "cancelled", "pending-virus-check",
        "virus-scan-failed", "validation-failed"
      ]
    },
    "template": {
      "type": "object",
      "description": "Reference to the template used.",
      "properties": {
        "id": { "type": "string", "format": "uuid" },
        "version": { "type": "integer" },
        "uri": { "type": "string", "format": "uri" }
      }
    },
    "body": {
      "type": "string",
      "description": "Rendered notification body."
    },
    "subject": {
      "type": ["string", "null"],
      "description": "Rendered email subject (email notifications only)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when the notification was created."
    },
    "sent_at": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "ISO 8601 timestamp when the notification was sent."
    },
    "completed_at": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "ISO 8601 timestamp when the notification reached a terminal status."
    },
    "estimated_delivery": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "Estimated delivery time (letter notifications only)."
    },
    "cost_in_pounds": {
      "type": ["number", "null"],
      "description": "Cost of the notification in GBP."
    },
    "postage": {
      "type": ["string", "null"],
      "enum": ["first", "second", "economy", null],
      "description": "Postage class used (letter notifications only)."
    },
    "created_by_name": {
      "type": ["string", "null"],
      "description": "Name of the user who sent the notification (if sent via the web interface)."
    }
  }
}