{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/terminal49/json-schema/terminal49-email-submission-document-schema.json",
  "title": "Email Submission Document",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/terminal49-email-submissions-api-openapi.yml#/components/schemas/email_submission_document",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "type": {
      "type": "string",
      "enum": [
        "document"
      ]
    },
    "attributes": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "enum": [
            "upload",
            "api",
            "email",
            "split_document"
          ]
        },
        "document_type": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "relationships": {
      "type": "object",
      "properties": {
        "last_document_representation": {
          "type": "object",
          "properties": {
            "data": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "document_representation"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "required": [
    "id",
    "type"
  ]
}