{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dynamicdocumentapi-com/json-schema/dynamicdocumentapi-com-render-schema.json",
  "title": "Render",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dynamicdocumentapi-com-openapi.yml#/components/schemas/Render",
  "properties": {
    "batch_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "billed_renders": {
      "description": "Renders billed for this request (0 for test renders, previews, failed and canceled renders).",
      "type": "integer"
    },
    "completed_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "format": "date-time",
      "type": "string"
    },
    "email": {
      "description": "The render's email sends in creation order. They are created when the render's result is processed, so a render still running (or a sync response) lists none yet; `render.succeeded` shows them as created: `pending`, or `skipped` / `failed`.",
      "items": {
        "$ref": "#/$defs/RenderEmail"
      },
      "type": "array"
    },
    "engine": {
      "type": "string"
    },
    "engine_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/RenderError"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "files": {
      "items": {
        "$ref": "#/$defs/RenderFile"
      },
      "type": "array"
    },
    "id": {
      "type": "string"
    },
    "input_type": {
      "enum": [
        "template",
        "html",
        "url",
        "markdown",
        "pdf_tool",
        "einvoice"
      ],
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "type": "object"
    },
    "mode": {
      "enum": [
        "sync",
        "async"
      ],
      "type": "string"
    },
    "object": {
      "enum": [
        "render"
      ],
      "type": "string"
    },
    "output_format": {
      "enum": [
        "pdf",
        "png",
        "jpeg",
        "webp",
        "html",
        "zip",
        "xml"
      ],
      "type": "string"
    },
    "pages": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "reference": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "region": {
      "type": "string"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/$defs/RenderResult"
        },
        {
          "type": "null"
        }
      ]
    },
    "source": {
      "type": "string"
    },
    "status": {
      "enum": [
        "queued",
        "processing",
        "succeeded",
        "failed",
        "canceled",
        "expired"
      ],
      "type": "string"
    },
    "storage": {
      "items": {
        "$ref": "#/$defs/StorageResult"
      },
      "type": "array"
    },
    "template": {
      "anyOf": [
        {
          "properties": {
            "id": {
              "type": "string"
            },
            "version": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ]
            },
            "version_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "test": {
      "type": "boolean"
    },
    "timings": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object"
    },
    "warnings": {
      "description": "Non-fatal: `slow_asset`, `asset_failed`, `wait_timeout` (the wait condition timed out and `wait.strict` is off, so the page was rendered as it was), `header_footer_overlap` (a header or footer is taller than its margin and may cover the body), `locale_unsupported` (the engine doesn't support `locale`), `feature_unavailable` (something in the request or template was ignored; the message names it), `font_fallback_used` (canvas templates: an unavailable font was replaced by Noto Sans; HTML renders fall back silently), `data_coerced` (canvas templates: a data value couldn't be used as given), `text_overflow` (canvas templates: text was cut off or overflows its box), `storage_upload_failed`, `einvoice_validation_warning`, `einvoice_validation_unavailable`, `pdfa_validation_unavailable`, `pdfua_validation_unavailable` (veraPDF was not reachable: the PDF/UA file is delivered unvalidated), `accessibility_validation_unavailable` (`tagged` without `pdfua`: no PDF/UA report, veraPDF was not reachable), `einvoice_skipped_plan`, `storage_skipped_plan`, `email_skipped_plan` (the template's email rules need the Growth plan or higher; no email was sent), `email_skipped_zero_retention` (zero-retention renders have no file to email), `invoice_totals_unavailable`.",
      "items": {
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "object",
    "status",
    "mode",
    "test",
    "region",
    "files",
    "created_at"
  ],
  "type": "object",
  "$defs": {
    "ConformanceFinding": {
      "description": "One validator finding; identical rule + location are merged (`count`).",
      "properties": {
        "count": {
          "minimum": 1,
          "type": "integer"
        },
        "location": {
          "description": "JSON path into the invoice for model issues found before the XML was written, else the validator's XPath or veraPDF context; empty when the finding concerns the whole document (e.g. a PDF/A `conversion` error).",
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "rule": {
          "description": "Business rule (EN 16931 `BR-…`, XRechnung `BR-DE-…`), schema rule, or PDF/A or PDF/UA clause and test number (`6.2.4.3-2`, `7.3-1`).",
          "type": "string"
        }
      },
      "required": [
        "rule",
        "message",
        "location",
        "count"
      ],
      "type": "object"
    },
    "ConformanceReport": {
      "description": "Validation of the delivered file against the standards it claims.",
      "properties": {
        "einvoice": {
          "$ref": "#/$defs/EInvoiceConformance"
        },
        "pdfa": {
          "$ref": "#/$defs/PdfaConformance"
        },
        "pdfua": {
          "$ref": "#/$defs/PdfuaConformance"
        }
      },
      "type": "object"
    },
    "EInvoiceConformance": {
      "properties": {
        "errors": {
          "items": {
            "$ref": "#/$defs/ConformanceFinding"
          },
          "maxItems": 100,
          "type": "array"
        },
        "profile": {
          "enum": [
            "MINIMUM",
            "BASIC_WL",
            "BASIC",
            "EN16931",
            "EXTENDED",
            "XRECHNUNG"
          ],
          "type": "string"
        },
        "scenario": {
          "anyOf": [
            {
              "description": "The validator scenario that matched; `null` when it did not run.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "description": "`unavailable`: the validator was not configured or did not answer in time; the file was delivered unvalidated (warning `einvoice_validation_unavailable`).",
          "enum": [
            "passed",
            "failed",
            "unavailable"
          ],
          "type": "string"
        },
        "syntax": {
          "enum": [
            "cii",
            "ubl"
          ],
          "type": "string"
        },
        "validator": {
          "anyOf": [
            {
              "description": "`null` when the validator did not run (`einvoice_invalid`: the model broke a rule before any XML was written, or unavailable).",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "warnings": {
          "items": {
            "$ref": "#/$defs/ConformanceFinding"
          },
          "maxItems": 100,
          "type": "array"
        }
      },
      "required": [
        "profile",
        "syntax",
        "status",
        "validator",
        "scenario",
        "errors",
        "warnings"
      ],
      "type": "object"
    },
    "EmailSendError": {
      "additionalProperties": true,
      "description": "Why a send failed or waits: never message bodies or addresses.",
      "properties": {
        "code": {
          "description": "`email_template_error`, `email_too_large`, `email_recipient_missing`, `email_address_invalid`, `email_too_many_recipients`, `email_attachment_too_large`, `email_attachment_type_not_allowed`, `email_needs_hosted_file`, `email_provider_rejected`, `email_provider_auth_failed`, `email_provider_unavailable`, `email_ip_not_authorized`, `email_rate_limited`, `email_outcome_unknown`, `email_daily_cap_reached`, `email_disabled`, `email_credentials_removed`, `email_send_expired`, `internal_error`",
          "type": "string"
        },
        "column": {
          "type": "integer"
        },
        "field": {
          "description": "`email_template_error`, `email_too_large`: the rule field, e.g. `subject`.",
          "type": "string"
        },
        "line": {
          "description": "`email_template_error`: where in the field.",
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "provider_code": {
          "anyOf": [
            {
              "description": "The provider's own error code.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "provider_status": {
          "anyOf": [
            {
              "description": "The provider's HTTP or SMTP status.",
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "PdfaConformance": {
      "properties": {
        "errors": {
          "items": {
            "$ref": "#/$defs/ConformanceFinding"
          },
          "maxItems": 100,
          "type": "array"
        },
        "level": {
          "enum": [
            "2b",
            "3b"
          ],
          "type": "string"
        },
        "profile": {
          "anyOf": [
            {
              "description": "veraPDF validation profile; `null` when veraPDF did not run.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "description": "`unavailable`: the validator was not configured or did not answer in time; the file was delivered unvalidated (warning `pdfa_validation_unavailable`).",
          "enum": [
            "passed",
            "failed",
            "unavailable"
          ],
          "type": "string"
        },
        "validator": {
          "anyOf": [
            {
              "description": "`null` when veraPDF did not run (conversion failed, or unavailable).",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "warnings": {
          "items": {
            "$ref": "#/$defs/ConformanceFinding"
          },
          "maxItems": 100,
          "type": "array"
        }
      },
      "required": [
        "level",
        "status",
        "validator",
        "profile",
        "errors",
        "warnings"
      ],
      "type": "object"
    },
    "PdfuaConformance": {
      "description": "veraPDF's PDF/UA-1 check of a render with `pdf.pdfua` or `pdf.tagged`. With `pdfua`, `failed` fails the render (`pdfua_validation_failed`); with `tagged` alone, and in previews, the report is information. The machine checks don't judge whether alt text is meaningful or the reading order right.",
      "properties": {
        "errors": {
          "items": {
            "$ref": "#/$defs/ConformanceFinding"
          },
          "maxItems": 100,
          "type": "array"
        },
        "profile": {
          "anyOf": [
            {
              "description": "veraPDF validation profile; `null` when veraPDF did not run.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "standard": {
          "enum": [
            "PDF/UA-1"
          ],
          "type": "string"
        },
        "status": {
          "description": "`unavailable`: the validator was not configured or did not answer in time; the file was delivered unvalidated (warning `pdfua_validation_unavailable`).",
          "enum": [
            "passed",
            "failed",
            "unavailable"
          ],
          "type": "string"
        },
        "validator": {
          "anyOf": [
            {
              "description": "`null` when veraPDF did not run (the title or language was missing, or unavailable).",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "warnings": {
          "items": {
            "$ref": "#/$defs/ConformanceFinding"
          },
          "maxItems": 100,
          "type": "array"
        }
      },
      "required": [
        "standard",
        "status",
        "validator",
        "profile",
        "errors",
        "warnings"
      ],
      "type": "object"
    },
    "RenderEmail": {
      "description": "One email send of the render.",
      "properties": {
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/EmailSendError"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "type": "string"
        },
        "provider_message_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "rule_id": {
          "type": "string"
        },
        "sent_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "enum": [
            "pending",
            "sending",
            "retrying",
            "sent",
            "sandboxed",
            "skipped",
            "failed",
            "unknown",
            "canceled"
          ],
          "type": "string"
        },
        "to": {
          "description": "The `to` addresses.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "id",
        "rule_id",
        "status",
        "to",
        "provider_message_id",
        "error",
        "sent_at"
      ],
      "type": "object"
    },
    "RenderError": {
      "properties": {
        "code": {
          "type": "string"
        },
        "column": {
          "type": "integer"
        },
        "detail": {
          "type": "string"
        },
        "excerpt": {
          "type": "string"
        },
        "line": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "RenderFile": {
      "properties": {
        "bytes": {
          "type": "integer"
        },
        "content_base64": {
          "description": "Only with `delivery.type=base64`.",
          "type": "string"
        },
        "content_type": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "format": {
          "enum": [
            "pdf",
            "png",
            "jpeg",
            "webp",
            "html",
            "zip",
            "xml"
          ],
          "type": "string"
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "type": "string"
        },
        "pages": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "sha256": {
          "type": "string"
        },
        "short_url": {
          "description": "Short link to the same file on the API host, present with `url` and valid until `url_expires_at`. It redirects to a fresh signed URL and ignores query parameters it doesn't know, so it still opens where chat apps or mail clients add their own; `url`, whose signature covers every parameter, doesn't. `?download=true` asks for an attachment.",
          "format": "uri",
          "type": "string"
        },
        "url": {
          "description": "Signed URL (omitted when not hosted).",
          "format": "uri",
          "type": "string"
        },
        "url_expires_at": {
          "format": "date-time",
          "type": "string"
        },
        "variant": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "format",
        "filename",
        "bytes"
      ],
      "type": "object"
    },
    "RenderResult": {
      "additionalProperties": true,
      "description": "Structured result, `null` for most renders. PDF/A, PDF/UA, tagged and e-invoice renders carry their conformance report here — succeeded **and** failed ones; `pdf-tools/metadata` without `set` returns the document information (`pages`, `page_sizes`, `encrypted`, `metadata`); an e-invoice validation returns its verdict (`EInvoiceValidationResult`: `valid`, `document`, `invoice`, `vat_breakdown`, `totals`, `conformance`).",
      "properties": {
        "conformance": {
          "$ref": "#/$defs/ConformanceReport"
        }
      },
      "type": "object"
    },
    "StorageResult": {
      "properties": {
        "destination_id": {
          "type": "string"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "location": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "enum": [
            "pending",
            "succeeded",
            "failed",
            "skipped"
          ],
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}