{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postedly-com/json-schema/postedly-com-document-schema.json",
  "title": "Document",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/postedly-com-api-openapi.json#/components/schemas/Document",
  "type": "object",
  "required": [
    "id",
    "name",
    "pages",
    "bytes",
    "sha256",
    "contentType",
    "previewUrl"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Use this value as documentId in a quote; the person does not need to copy it."
    },
    "name": {
      "type": "string",
      "maxLength": 180
    },
    "pages": {
      "type": "integer",
      "minimum": 1,
      "description": "Inspected page count; images count as one. Upload PDFs allow up to 50 pages; service-specific quote limits can be lower."
    },
    "bytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10485760
    },
    "sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "Server-computed SHA-256 of the stored raw file bytes."
    },
    "contentType": {
      "type": "string",
      "enum": [
        "application/pdf",
        "image/jpeg",
        "image/png"
      ],
      "description": "Detected media type, not a trusted client declaration."
    },
    "previewUrl": {
      "type": "string",
      "format": "uri-reference",
      "description": "Private preview. Standard document URLs require the same owner’s bearer token; capability-scoped handoff URLs require their unexpired ticket. Resolve relative URLs against this API origin. Never make the file public to show a preview."
    },
    "coverPage": {
      "type": "string",
      "enum": [
        "mail-address",
        "fax-cover"
      ],
      "description": "An added first page in the final proof. Content pages follow it; an ordinary upload or postcard has no added cover label."
    }
  }
}