{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passportcraft-com/json-schema/passportcraft-com-document-schema.json",
  "title": "Document",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passportcraft-com-openapi.json#/components/schemas/Document",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "document"
    },
    "id": {
      "type": "string",
      "maxLength": 255
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "organization_id": {
      "type": "string",
      "maxLength": 255
    },
    "passport_id": {
      "type": "string",
      "maxLength": 255
    },
    "passport": {
      "type": "string",
      "maxLength": 255
    },
    "type": {
      "type": "string",
      "enum": [
        "certification",
        "image",
        "document",
        "conformity_declaration"
      ]
    },
    "access_tier": {
      "type": "string",
      "enum": [
        "public",
        "restricted",
        "authority"
      ]
    },
    "file_name": {
      "type": "string"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mime_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "file_size": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "upload_state": {
      "type": "string",
      "enum": [
        "pending",
        "ready",
        "unknown"
      ]
    },
    "uploaded_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "livemode": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string"
    },
    "linked_at": {
      "type": "string"
    },
    "upload": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "method": {
          "type": "string",
          "const": "PUT"
        },
        "headers": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_bytes": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "url",
        "method",
        "headers",
        "expires_at",
        "max_bytes"
      ],
      "additionalProperties": {}
    }
  },
  "required": [
    "object",
    "id",
    "name",
    "organization_id",
    "passport_id",
    "passport",
    "type",
    "access_tier",
    "file_name",
    "display_name",
    "mime_type",
    "file_size",
    "upload_state",
    "uploaded_at",
    "livemode",
    "created_at",
    "linked_at"
  ],
  "additionalProperties": {}
}