{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-gouv-fr/json-schema/api-gouv-fr-notification-page-schema.json",
  "title": "NotificationPage",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-gouv-fr-notifications-api-openapi.yml#/components/schemas/NotificationPage",
  "properties": {
    "data": {
      "description": "The page data",
      "items": {
        "$ref": "#/$defs/Notification__read"
      },
      "type": "array"
    },
    "next_page": {
      "description": "The next page URL if exists",
      "type": "string"
    },
    "page": {
      "description": "The current page",
      "minimum": 1,
      "type": "integer"
    },
    "page_size": {
      "description": "The page size used for pagination",
      "minimum": 0,
      "type": "integer"
    },
    "previous_page": {
      "description": "The previous page URL if exists",
      "type": "string"
    },
    "total": {
      "description": "The total paginated items",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "page",
    "page_size",
    "total"
  ],
  "type": "object",
  "$defs": {
    "BaseReference": {
      "properties": {
        "class": {
          "description": "The object class",
          "type": "string"
        },
        "id": {
          "description": "The object unique identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "Notification__read": {
      "properties": {
        "created_at": {
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "details": {
          "type": "object"
        },
        "handled_at": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "last_modified": {
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "reasons": {
          "items": {
            "enum": [
              "owner",
              "organization.admin",
              "organization.editor",
              "organization.partial_editor",
              "discussion.participant",
              "explicit_subscriber",
              "contributor",
              "discussant",
              "requester"
            ],
            "readOnly": true,
            "type": "string"
          },
          "readOnly": true,
          "type": "array"
        },
        "requires_action": {
          "description": "Whether the notification is resolved by acting on its subject rather than by reading it",
          "readOnly": true,
          "type": "boolean"
        },
        "type": {
          "enum": [
            "discussion.new",
            "discussion.comment",
            "discussion.closed",
            "organization.membership.requested",
            "organization.membership.invited",
            "organization.membership.accepted",
            "organization.membership.refused",
            "organization.badge.certified",
            "organization.badge.public-service",
            "organization.badge.company",
            "organization.badge.association",
            "organization.badge.local-authority",
            "reuse.created",
            "dataservice.created",
            "transfer.requested",
            "harvest.source.pending",
            "harvest.source.accepted",
            "harvest.source.refused"
          ],
          "readOnly": true,
          "type": "string"
        },
        "user": {
          "allOf": [
            {
              "$ref": "#/$defs/UserReference"
            }
          ],
          "readOnly": true
        }
      },
      "required": [
        "created_at",
        "id",
        "last_modified",
        "type"
      ],
      "type": "object"
    },
    "UserReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {
            "avatar": {
              "description": "URL of the image",
              "readOnly": true,
              "type": "string"
            },
            "avatar_thumbnail": {
              "description": "URL of the cropped and squared image (500x500)",
              "readOnly": true,
              "type": "string"
            },
            "deleted": {
              "description": "The date the account was deleted, null for a live account",
              "format": "date-time",
              "readOnly": true,
              "type": "string"
            },
            "first_name": {
              "maxLength": 255,
              "type": "string"
            },
            "last_name": {
              "maxLength": 255,
              "type": "string"
            },
            "page": {
              "description": "Link to the udata web page for this user",
              "readOnly": true,
              "type": "string"
            },
            "slug": {
              "maxLength": 255,
              "readOnly": true,
              "type": "string"
            },
            "uri": {
              "description": "Link to the API endpoint for this user",
              "readOnly": true,
              "type": "string"
            }
          },
          "required": [
            "first_name",
            "last_name",
            "slug"
          ],
          "type": "object"
        }
      ]
    }
  }
}