{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usps/json-schema/usps-address-notification-event-schema.json",
  "title": "Address Subscription Event",
  "description": "Address Notification Event",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usps-subscriptions-addresses-openapi.yml#/components/schemas/AddressNotificationEvent",
  "type": "object",
  "required": [
    "subscriptionId",
    "subscriptionType",
    "timestamp",
    "payload"
  ],
  "properties": {
    "subscriptionId": {
      "type": "string",
      "description": "Unique identifier created for this Subscription.",
      "pattern": "^[A-Za-z0-9\\-]+$"
    },
    "subscriptionType": {
      "type": "string",
      "description": "The name of the topic related to this event.",
      "pattern": "^[A-Za-z0-9\\s]+$"
    },
    "timestamp": {
      "type": "string",
      "description": "Timestamp message was generated, in ISO-8601 format.",
      "format": "date-time"
    },
    "payload": {
      "type": "string",
      "description": "Change of Address subscription details converted into a JSON formatted string.",
      "pattern": "^[\\s\\S]*$"
    },
    "links": {
      "title": "Hypermedia Links",
      "type": "array",
      "description": "Hypermedia links to related resources.",
      "minItems": 0,
      "maxItems": 20,
      "items": {
        "required": [
          "href",
          "rel"
        ],
        "type": "object",
        "properties": {
          "rel": {
            "type": "array",
            "description": "The short name(s) of the relationship corresponding to the link.",
            "minItems": 0,
            "maxItems": 20,
            "items": {
              "type": "string"
            }
          },
          "title": {
            "type": "string",
            "description": "A human-readable description of the link relationship.",
            "pattern": "^[A-Za-z\\-]+$"
          },
          "href": {
            "type": "string",
            "description": "The URL to a related resource.",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "description": "The HTTP method to use to access this link.",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "DELETE"
            ]
          },
          "submissionMediaType": {
            "type": "string",
            "description": "The media type of the resource request.",
            "minLength": 0,
            "maxLength": 50,
            "pattern": "^[A-Za-z0-9\\-]+$"
          },
          "targetMediaType": {
            "type": "string",
            "description": "The media type of the resource response.",
            "minLength": 0,
            "maxLength": 50,
            "pattern": "^[A-Za-z0-9\\-]+$"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}