{
  "openapi": "3.1.0",
  "info": {
    "title": "Developer API",
    "version": "1.0.0",
    "description": "Render posters, videos and PDFs from templates. JSON, snake_case, bearer token. Errors are application/problem+json (RFC 9457). Cursor pagination. Every response carries X-Request-Id; RateLimit headers on every authenticated response."
  },
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "Account, field types and OpenAPI specification"
    },
    {
      "name": "Templates",
      "description": "Discover and manage render templates and scenes"
    },
    {
      "name": "Library",
      "description": "Original starter template designs"
    },
    {
      "name": "Media",
      "description": "Upload images for render fields"
    },
    {
      "name": "Renders",
      "description": "Create, inspect, list, cancel and delete poster, video and PDF renders"
    },
    {
      "name": "Webhooks",
      "description": "Manage webhook subscriptions, secret rotation and delivery logs"
    },
    {
      "name": "Audit",
      "description": "Inspect project API request audit logs"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getAccount",
        "summary": "The project and token behind the bearer token",
        "tags": [
          "Discovery"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "The account",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/field-types": {
      "get": {
        "operationId": "listFieldTypes",
        "summary": "Field kinds and their constraints",
        "tags": [
          "Discovery"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "Field kinds",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldTypeList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/templates": {
      "get": {
        "operationId": "listTemplates",
        "summary": "List templates",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "poster, video or pdf",
            "schema": {
              "type": "string",
              "enum": [
                "poster",
                "video",
                "pdf"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Title substring",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Tag (also matches nested tags \"tag/...\")",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "collection",
            "in": "query",
            "required": false,
            "description": "Collection id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listed",
            "in": "query",
            "required": false,
            "description": "true (default), false or all",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false",
                "all"
              ],
              "default": "true"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "-created_at",
                "title",
                "-title",
                "updated_at",
                "-updated_at"
              ],
              "default": "-created_at"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100 (default 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor: the next_cursor of the previous page (same filters)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of templates",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createTemplate",
        "summary": "Create a template (blank, from a scene, from a library design)",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/templates/{id}": {
      "get": {
        "operationId": "getTemplate",
        "summary": "A template with its fields",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "updateTemplate",
        "summary": "Change title, tags, description, listed or kind",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "deleteTemplate",
        "summary": "Delete a template",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/templates/{id}/fields": {
      "get": {
        "operationId": "listTemplateFields",
        "summary": "The dynamic fields of a template",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fields in reading order",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/templates/{id}/scene": {
      "get": {
        "operationId": "getTemplateScene",
        "summary": "The current scene document and its revision",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The scene",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SceneEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "put": {
        "operationId": "replaceTemplateScene",
        "summary": "Replace the scene (optimistic concurrency with base_revision)",
        "tags": [
          "Templates"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SceneUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/library": {
      "get": {
        "operationId": "listLibrary",
        "summary": "Original starter designs",
        "tags": [
          "Library"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "poster, video or pdf (all library designs are posters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Size preset id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Tag",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free text",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100 (default 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor: the next_cursor of the previous page (same filters)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of library designs",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryTemplateList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/library/{id}/preview": {
      "get": {
        "operationId": "getLibraryPreview",
        "summary": "Preview image (PNG) of a library design",
        "tags": [
          "Library"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Library design id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Size preset id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PNG image",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "ETag": {
                "description": "Cache tag of this preview",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "contentEncoding": "base64"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/media": {
      "post": {
        "operationId": "uploadMedia",
        "summary": "Upload an image for use in an image field",
        "tags": [
          "Media"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "image/*",
                    "contentEncoding": "binary",
                    "description": "png, jpg, webp, svg or gif"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The media",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/renders": {
      "post": {
        "operationId": "createRender",
        "summary": "Create a render (poster, video or pdf)",
        "description": "Prefer: wait=N (1 to 10 seconds) is honoured for posters. 200 when finished inside the window, otherwise 202 with Retry-After.",
        "tags": [
          "Renders"
        ],
        "x-required-scope": "render:preview or render:final",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Prefer"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderCreate"
              },
              "examples": {
                "poster": {
                  "summary": "Poster render",
                  "value": {
                    "kind": "poster",
                    "template_id": "tpl_poster_01",
                    "fields": {
                      "title": "Weekly data",
                      "price": "KES 100",
                      "logo": {
                        "media_id": "m_0123456789abcdef0123456789abcdef"
                      },
                      "photo": "https://example.com/photo.jpg",
                      "$canvas": "#0D774D"
                    },
                    "options": {
                      "format": "png",
                      "width": 1080,
                      "filename": "weekly-data",
                      "color_mode": "rgb"
                    },
                    "output_mode": "preview",
                    "metadata": {
                      "order": "1042"
                    }
                  }
                },
                "video": {
                  "summary": "Video render (single clip shorthand)",
                  "value": {
                    "kind": "video",
                    "template_id": "tpl_video_01",
                    "fields": {
                      "headline": "Weekly data"
                    },
                    "options": {
                      "width": 1080,
                      "height": 1920,
                      "fps": 25,
                      "canvas_background": "#000000"
                    },
                    "output_mode": "preview"
                  }
                },
                "videoClips": {
                  "summary": "Video render (multi-clip)",
                  "value": {
                    "kind": "video",
                    "clips": [
                      {
                        "template_id": "tpl_video_01",
                        "fields": {
                          "headline": "Part 1"
                        }
                      },
                      {
                        "template_id": "tpl_video_02",
                        "fields": {
                          "headline": "Part 2"
                        }
                      }
                    ],
                    "options": {
                      "width": 1080,
                      "height": 1920,
                      "fps": 25
                    },
                    "output_mode": "final"
                  }
                },
                "pdf": {
                  "summary": "PDF render (single page shorthand)",
                  "value": {
                    "kind": "pdf",
                    "template_id": "tpl_pdf_01",
                    "fields": {
                      "business_name": "Shop Hub",
                      "price": "KES 500"
                    },
                    "options": {
                      "filename": "agent-flyer",
                      "dpi": 150,
                      "color_mode": "rgb"
                    },
                    "output_mode": "final"
                  }
                },
                "pdfPages": {
                  "summary": "PDF render (multi-page)",
                  "value": {
                    "kind": "pdf",
                    "pages": [
                      {
                        "template_id": "tpl_pdf_01",
                        "fields": {
                          "title": "Page 1"
                        }
                      },
                      {
                        "template_id": "tpl_pdf_02",
                        "fields": {
                          "till_number": "123456"
                        }
                      }
                    ],
                    "options": {
                      "filename": "guide",
                      "dpi": 150
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finished inside the wait window",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Render-Output": {
                "$ref": "#/components/headers/XRenderOutput"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Preference-Applied": {
                "$ref": "#/components/headers/PreferenceApplied"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Render"
                },
                "examples": {
                  "poster": {
                    "summary": "Succeeded poster render",
                    "value": {
                      "object": "render",
                      "id": "123",
                      "kind": "poster",
                      "status": "succeeded",
                      "template_id": "tpl_poster_01",
                      "output_mode": "preview",
                      "progress": 100,
                      "outputs": [
                        {
                          "format": "png",
                          "url": "https://api.example.com/files/renders/123.png?exp=1794400000&sig=abc123",
                          "expires_at": "2026-11-11T12:05:00.000Z",
                          "bytes": 184233,
                          "width": 1080,
                          "height": 1350,
                          "duration_ms": null,
                          "pages": null,
                          "content_type": "image/png"
                        }
                      ],
                      "error": null,
                      "warnings": [],
                      "metadata": {
                        "order": "1042"
                      },
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": "2026-11-11T12:00:01.000Z",
                      "finished_at": "2026-11-11T12:00:02.000Z",
                      "polling_url": "https://api.example.com/api/v1/renders/123"
                    }
                  },
                  "video": {
                    "summary": "Succeeded video render",
                    "value": {
                      "object": "render",
                      "id": "124",
                      "kind": "video",
                      "status": "succeeded",
                      "template_id": "tpl_video_01",
                      "output_mode": "preview",
                      "progress": 100,
                      "outputs": [
                        {
                          "format": "mp4",
                          "url": "https://api.example.com/files/renders/124.mp4?exp=1794400000&sig=abc123",
                          "expires_at": "2026-11-11T12:05:00.000Z",
                          "bytes": 1482040,
                          "width": 1080,
                          "height": 1920,
                          "duration_ms": 5000,
                          "pages": null,
                          "content_type": "video/mp4",
                          "thumbnail_url": "https://api.example.com/files/thumbs/124.png?exp=1794400000&sig=def456"
                        }
                      ],
                      "error": null,
                      "warnings": [],
                      "metadata": {},
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": "2026-11-11T12:00:01.000Z",
                      "finished_at": "2026-11-11T12:00:02.000Z",
                      "polling_url": "https://api.example.com/api/v1/renders/124"
                    }
                  },
                  "pdf": {
                    "summary": "Succeeded PDF render",
                    "value": {
                      "object": "render",
                      "id": "125",
                      "kind": "pdf",
                      "status": "succeeded",
                      "template_id": "tpl_pdf_01",
                      "output_mode": "preview",
                      "progress": 100,
                      "outputs": [
                        {
                          "format": "pdf",
                          "url": "https://api.example.com/files/renders/125.pdf?exp=1794400000&sig=abc123",
                          "expires_at": "2026-11-11T12:05:00.000Z",
                          "bytes": 92410,
                          "width": 1080,
                          "height": 1350,
                          "duration_ms": null,
                          "pages": 2,
                          "content_type": "application/pdf"
                        }
                      ],
                      "error": null,
                      "warnings": [],
                      "metadata": {},
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": "2026-11-11T12:00:01.000Z",
                      "finished_at": "2026-11-11T12:00:02.000Z",
                      "polling_url": "https://api.example.com/api/v1/renders/125"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted; poll the render",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Render-Output": {
                "$ref": "#/components/headers/XRenderOutput"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Preference-Applied": {
                "$ref": "#/components/headers/PreferenceApplied"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Render"
                },
                "examples": {
                  "poster": {
                    "summary": "Queued poster render",
                    "value": {
                      "object": "render",
                      "id": "123",
                      "kind": "poster",
                      "status": "queued",
                      "template_id": "tpl_poster_01",
                      "output_mode": "preview",
                      "progress": 0,
                      "outputs": [],
                      "error": null,
                      "warnings": [],
                      "metadata": {
                        "order": "1042"
                      },
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": null,
                      "finished_at": null,
                      "polling_url": "https://api.example.com/api/v1/renders/123"
                    }
                  },
                  "video": {
                    "summary": "Queued video render",
                    "value": {
                      "object": "render",
                      "id": "124",
                      "kind": "video",
                      "status": "queued",
                      "template_id": "tpl_video_01",
                      "output_mode": "preview",
                      "progress": 0,
                      "outputs": [],
                      "error": null,
                      "warnings": [],
                      "metadata": {},
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": null,
                      "finished_at": null,
                      "polling_url": "https://api.example.com/api/v1/renders/124"
                    }
                  },
                  "pdf": {
                    "summary": "Queued PDF render",
                    "value": {
                      "object": "render",
                      "id": "125",
                      "kind": "pdf",
                      "status": "queued",
                      "template_id": "tpl_pdf_01",
                      "output_mode": "preview",
                      "progress": 0,
                      "outputs": [],
                      "error": null,
                      "warnings": [],
                      "metadata": {},
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": null,
                      "finished_at": null,
                      "polling_url": "https://api.example.com/api/v1/renders/125"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/InsufficientCredits"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "listRenders",
        "summary": "List renders, newest first",
        "tags": [
          "Renders"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "poster, video or pdf",
            "schema": {
              "type": "string",
              "enum": [
                "poster",
                "video",
                "pdf"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "queued, processing, succeeded, failed or cancelled",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "processing",
                "succeeded",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "name": "template_id",
            "in": "query",
            "required": false,
            "description": "Template id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "ISO 8601",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "ISO 8601",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100 (default 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor: the next_cursor of the previous page (same filters)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of renders",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenderList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/renders/{id}": {
      "get": {
        "operationId": "getRender",
        "summary": "A render (call again for fresh signed output URLs)",
        "tags": [
          "Renders"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Render id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The render",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "X-Render-Output": {
                "$ref": "#/components/headers/XRenderOutput"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Render"
                },
                "examples": {
                  "poster": {
                    "summary": "Succeeded poster render",
                    "value": {
                      "object": "render",
                      "id": "123",
                      "kind": "poster",
                      "status": "succeeded",
                      "template_id": "tpl_poster_01",
                      "output_mode": "preview",
                      "progress": 100,
                      "outputs": [
                        {
                          "format": "png",
                          "url": "https://api.example.com/files/renders/123.png?exp=1794400000&sig=abc123",
                          "expires_at": "2026-11-11T12:05:00.000Z",
                          "bytes": 184233,
                          "width": 1080,
                          "height": 1350,
                          "duration_ms": null,
                          "pages": null,
                          "content_type": "image/png"
                        }
                      ],
                      "error": null,
                      "warnings": [],
                      "metadata": {
                        "order": "1042"
                      },
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": "2026-11-11T12:00:01.000Z",
                      "finished_at": "2026-11-11T12:00:02.000Z",
                      "polling_url": "https://api.example.com/api/v1/renders/123"
                    }
                  },
                  "video": {
                    "summary": "Succeeded video render",
                    "value": {
                      "object": "render",
                      "id": "124",
                      "kind": "video",
                      "status": "succeeded",
                      "template_id": "tpl_video_01",
                      "output_mode": "preview",
                      "progress": 100,
                      "outputs": [
                        {
                          "format": "mp4",
                          "url": "https://api.example.com/files/renders/124.mp4?exp=1794400000&sig=abc123",
                          "expires_at": "2026-11-11T12:05:00.000Z",
                          "bytes": 1482040,
                          "width": 1080,
                          "height": 1920,
                          "duration_ms": 5000,
                          "pages": null,
                          "content_type": "video/mp4",
                          "thumbnail_url": "https://api.example.com/files/thumbs/124.png?exp=1794400000&sig=def456"
                        }
                      ],
                      "error": null,
                      "warnings": [],
                      "metadata": {},
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": "2026-11-11T12:00:01.000Z",
                      "finished_at": "2026-11-11T12:00:02.000Z",
                      "polling_url": "https://api.example.com/api/v1/renders/124"
                    }
                  },
                  "pdf": {
                    "summary": "Succeeded PDF render",
                    "value": {
                      "object": "render",
                      "id": "125",
                      "kind": "pdf",
                      "status": "succeeded",
                      "template_id": "tpl_pdf_01",
                      "output_mode": "preview",
                      "progress": 100,
                      "outputs": [
                        {
                          "format": "pdf",
                          "url": "https://api.example.com/files/renders/125.pdf?exp=1794400000&sig=abc123",
                          "expires_at": "2026-11-11T12:05:00.000Z",
                          "bytes": 92410,
                          "width": 1080,
                          "height": 1350,
                          "duration_ms": null,
                          "pages": 2,
                          "content_type": "application/pdf"
                        }
                      ],
                      "error": null,
                      "warnings": [],
                      "metadata": {},
                      "created_at": "2026-11-11T12:00:00.000Z",
                      "started_at": "2026-11-11T12:00:01.000Z",
                      "finished_at": "2026-11-11T12:00:02.000Z",
                      "polling_url": "https://api.example.com/api/v1/renders/125"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "deleteRender",
        "summary": "Delete a render and its stored output",
        "tags": [
          "Renders"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Render id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/renders/{id}/cancel": {
      "post": {
        "operationId": "cancelRender",
        "summary": "Cancel a queued or running render",
        "tags": [
          "Renders"
        ],
        "x-required-scope": "render:preview or render:final",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Render id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The render",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "X-Render-Output": {
                "$ref": "#/components/headers/XRenderOutput"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Render"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhook subscriptions, newest first",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100 (default 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor: the next_cursor of the previous page (same filters)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of webhook subscriptions",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Create a webhook subscription (returns the signing secret once)",
        "description": "URL must be https (http allowed only with WEBHOOK_ALLOW_PRIVATE) and resolve to public IP addresses. Up to 100 subscriptions per project.",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created webhook subscription with secret",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "summary": "Get a webhook subscription",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook subscription",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update a webhook subscription (setting active=true clears disabled state and failure streak)",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated webhook subscription",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook subscription",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate the webhook signing secret (previous secret stays valid for 24 hours)",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook subscription with the new secret",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "summary": "Enqueue a signed webhook.test delivery (1 attempt)",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The queued test delivery",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List delivery attempts for a webhook subscription, newest first",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Delivery status filter",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivering",
                "delivered",
                "failed"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Event type filter (e.g. render.completed, render.failed, render.cancelled, webhook.test)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100 (default 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor: the next_cursor of the previous page (same filters)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of webhook deliveries",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}/deliveries/{delivery_id}/replay": {
      "post": {
        "operationId": "replayWebhookDelivery",
        "summary": "Replay a previous delivery with the same event_id / webhook-id",
        "tags": [
          "Webhooks"
        ],
        "x-required-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook subscription id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "description": "Webhook delivery id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The new replay delivery",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/audit-log": {
      "get": {
        "operationId": "listAuditLog",
        "summary": "List request audit entries for this project, newest first",
        "tags": [
          "Audit"
        ],
        "x-required-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "HTTP status (e.g. 404) or status class (e.g. 4xx)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "route",
            "in": "query",
            "required": false,
            "description": "Exact route pattern, or prefix ending with * (e.g. /api/v1/renders*)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 timestamp lower bound",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100 (default 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor: the next_cursor of the previous page (same filters)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of audit log entries",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEntryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "This document",
        "tags": [
          "Discovery"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A project API token: Authorization: Bearer <token>. Scopes: read, write, render:preview, render:final."
      }
    },
    "parameters": {
      "XRequestId": {
        "name": "X-Request-Id",
        "in": "header",
        "required": false,
        "description": "Optional request trace id (8 to 64 characters of A-Z a-z 0-9 . _ -); valid values are echoed in the X-Request-Id response header.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._-]{8,64}$"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Makes the create safe to retry (1 to 255 characters, kept 24 hours).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "Prefer": {
        "name": "Prefer",
        "in": "header",
        "required": false,
        "description": "wait=N, 1 to 10 seconds (honoured for posters only; values above 10 are clamped).",
        "schema": {
          "type": "string",
          "pattern": "^wait=\\d+$"
        }
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Request id (echoes a valid inbound X-Request-Id: 8 to 64 characters of A-Z a-z 0-9 . _ -)",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "IETF RateLimit header: limit=<n>, remaining=<n>, reset=<seconds>",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitPolicy": {
        "description": "IETF RateLimit-Policy header: <limit>;w=<window_seconds>",
        "schema": {
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before polling or retrying",
        "schema": {
          "type": "integer"
        }
      },
      "Location": {
        "description": "Path of the created resource",
        "schema": {
          "type": "string"
        }
      },
      "XRenderOutput": {
        "description": "Output mode produced (preview when a preview-only key requested final)",
        "schema": {
          "type": "string",
          "enum": [
            "preview",
            "final"
          ]
        }
      },
      "IdempotentReplayed": {
        "description": "true when an earlier response for the same Idempotency-Key is replayed",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      },
      "PreferenceApplied": {
        "description": "wait=N when Prefer: wait was applied",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Account": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account"
          },
          "project": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "token": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "prefix": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "created_at": {
                "type": "string",
                "description": "ISO 8601 timestamp (UTC)"
              },
              "last_used_at": {
                "description": "ISO 8601 timestamp (UTC) or null",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "prefix",
              "scopes",
              "created_at",
              "last_used_at"
            ],
            "additionalProperties": false
          },
          "limits": {
            "type": "object",
            "properties": {
              "rate_per_min": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "max_upload_bytes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "max_concurrent_renders": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Per-token in-flight render cap (RENDER_MAX_CONCURRENT_PER_TOKEN)"
              }
            },
            "required": [
              "rate_per_min",
              "max_upload_bytes",
              "max_concurrent_renders"
            ],
            "additionalProperties": false
          },
          "features": {
            "type": "object",
            "properties": {
              "video": {
                "type": "boolean"
              },
              "pdf": {
                "type": "boolean"
              },
              "bulk": {
                "type": "boolean"
              }
            },
            "required": [
              "video",
              "pdf",
              "bulk"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "object",
          "project",
          "token",
          "limits",
          "features"
        ],
        "additionalProperties": false
      },
      "AuditEntry": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "audit_entry"
          },
          "id": {
            "type": "string"
          },
          "token_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "method": {
            "type": "string"
          },
          "route": {
            "type": "string",
            "description": "Route pattern, for example /api/v1/renders/:id (\"(unmatched)\" for unknown routes)"
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "bytes_in": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          }
        },
        "required": [
          "object",
          "id",
          "token_id",
          "method",
          "route",
          "status",
          "ip",
          "request_id",
          "bytes_in",
          "duration_ms",
          "created_at"
        ],
        "additionalProperties": false
      },
      "AuditEntryList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEntry"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "Field": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The exact key to use in `fields` when rendering"
          },
          "label": {
            "type": "string"
          },
          "layer": {
            "type": "string"
          },
          "property": {
            "type": "string",
            "description": "REST property name of the layer (text, text_color, background_color, image, ...)"
          },
          "layer_type": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "text",
              "money",
              "phone",
              "till",
              "color",
              "image",
              "select",
              "number"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "max_length": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "pattern": {
            "type": [
              "string",
              "null"
            ]
          },
          "options": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "value",
                    "label"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "default": {
            "description": "The current scene value",
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "accepts": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "color",
              "url_or_media"
            ]
          }
        },
        "required": [
          "key",
          "label",
          "layer",
          "property",
          "layer_type",
          "kind",
          "required",
          "max_length",
          "pattern",
          "options",
          "default",
          "description",
          "accepts"
        ],
        "additionalProperties": false
      },
      "FieldErrorCode": {
        "type": "string",
        "enum": [
          "unknown_field",
          "required",
          "invalid_type",
          "invalid_value",
          "too_long",
          "too_short",
          "pattern_mismatch",
          "invalid_option",
          "kind_mismatch",
          "conflicting_fields",
          "stale_revision",
          "template_not_found",
          "media_not_found",
          "template_kind_mismatch",
          "limit_reached",
          "blocked_address",
          "insecure_scheme",
          "invalid_url",
          "dns_failed"
        ],
        "description": "Known values of ProblemError.code (errors[].code)"
      },
      "FieldList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "FieldType": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "text",
              "money",
              "phone",
              "till",
              "color",
              "image",
              "select",
              "number"
            ]
          },
          "json_type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "validation": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "kind",
          "json_type",
          "description",
          "validation"
        ],
        "additionalProperties": false
      },
      "FieldTypeList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldType"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "FieldValues": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "object",
              "properties": {
                "media_id": {
                  "type": "string"
                }
              },
              "required": [
                "media_id"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Text/money/phone/till/select/colour: string; number: JSON number; image: https URL or {\"media_id\":\"m_...\"}"
        },
        "description": "Keyed by Field.key"
      },
      "LibraryTemplate": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "library_template"
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TemplateKind"
          },
          "width": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "height": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "preview_url": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "title",
          "kind",
          "width",
          "height",
          "tags",
          "preview_url"
        ],
        "additionalProperties": false
      },
      "LibraryTemplateList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryTemplate"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "Media": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "media"
          },
          "id": {
            "type": "string",
            "description": "m_... ; usable as {\"media_id\": id} in an image field"
          },
          "url": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "width": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          }
        },
        "required": [
          "object",
          "id",
          "url",
          "content_type",
          "bytes",
          "width",
          "height",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PdfRenderCreate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "pdf"
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "fields": {
            "$ref": "#/components/schemas/FieldValues"
          },
          "pages": {
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "fields": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              },
              "required": [
                "template_id"
              ],
              "additionalProperties": false
            }
          },
          "options": {
            "type": "object",
            "properties": {
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "dpi": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 96
                  },
                  {
                    "type": "number",
                    "const": 150
                  },
                  {
                    "type": "number",
                    "const": 300
                  }
                ]
              },
              "color_mode": {
                "type": "string",
                "enum": [
                  "rgb",
                  "cmyk"
                ]
              }
            },
            "additionalProperties": false
          },
          "output_mode": {
            "type": "string",
            "enum": [
              "preview",
              "final"
            ]
          },
          "webhook_url": {
            "description": "https only; called once when the render finishes",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 256
                },
                "description": "Up to 16 keys; returned verbatim"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "kind"
        ],
        "additionalProperties": false
      },
      "PosterRenderCreate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "poster"
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "fields": {
            "$ref": "#/components/schemas/FieldValues"
          },
          "options": {
            "type": "object",
            "properties": {
              "format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpg",
                  "webp",
                  "auto"
                ]
              },
              "width": {
                "type": "integer",
                "minimum": 1,
                "maximum": 8000
              },
              "height": {
                "type": "integer",
                "minimum": 1,
                "maximum": 8000
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "color_mode": {
                "type": "string",
                "enum": [
                  "rgb",
                  "cmyk"
                ]
              }
            },
            "additionalProperties": false
          },
          "output_mode": {
            "type": "string",
            "enum": [
              "preview",
              "final"
            ]
          },
          "webhook_url": {
            "description": "https only; called once when the render finishes",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 256
                },
                "description": "Up to 16 keys; returned verbatim"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "kind",
          "template_id"
        ],
        "additionalProperties": false
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"about:blank\" until the docs site exists"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "Stable snake_case error code (see ProblemCode): invalid_input, not_found, insufficient_scope, token_expired, idempotency_key_reused, concurrency_limit_reached, daily_cost_cap_reached, kind_mismatch, ..."
          },
          "request_id": {
            "type": "string"
          },
          "param": {
            "type": [
              "string",
              "null"
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProblemError"
            }
          },
          "resource": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "retry_after": {
            "description": "Seconds (also the Retry-After header) for 429 and 503",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "request_id",
          "param",
          "errors",
          "resource",
          "retryable",
          "retry_after"
        ],
        "additionalProperties": false,
        "description": "RFC 9457 problem details (application/problem+json)"
      },
      "ProblemCode": {
        "type": "string",
        "enum": [
          "invalid_input",
          "bad_request",
          "unauthorized",
          "token_expired",
          "forbidden",
          "insufficient_scope",
          "insufficient_credits",
          "entitlement_required",
          "not_found",
          "method_not_allowed",
          "conflict",
          "idempotency_key_reused",
          "kind_mismatch",
          "unsupported_option",
          "unsupported_layer",
          "unsupported_schema",
          "payload_too_large",
          "unsupported_media_type",
          "rate_limited",
          "concurrency_limit_reached",
          "daily_cost_cap_reached",
          "feature_disabled",
          "service_unavailable",
          "internal_error",
          "media_download_failed",
          "font_load_failed",
          "render_script_error",
          "render_timeout",
          "encoding_failed",
          "storage_failed",
          "transfer_failed",
          "cancelled"
        ],
        "description": "Known values of Problem.code; the list may grow, so handle unknown codes"
      },
      "ProblemError": {
        "type": "object",
        "properties": {
          "pointer": {
            "type": "string",
            "description": "JSON pointer into the request body (\"\" = the whole body)"
          },
          "field": {
            "type": [
              "string",
              "null"
            ]
          },
          "code": {
            "type": "string",
            "description": "Stable snake_case code, for example unknown_field, required, invalid_type, too_long"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "pointer",
          "field",
          "code",
          "detail"
        ],
        "additionalProperties": false
      },
      "Render": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "render"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TemplateKind"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "template_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "output_mode": {
            "type": "string",
            "enum": [
              "preview",
              "final"
            ]
          },
          "progress": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RenderOutput"
            },
            "description": "Empty until the render succeeded (and after the retention window)"
          },
          "outputs_expired": {
            "description": "Only present when the retention sweeper deleted the stored output",
            "type": "boolean",
            "const": true
          },
          "outputs_expired_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "warnings": {
            "description": "For example a final request served as a preview",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "field",
                "detail"
              ],
              "additionalProperties": false
            }
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "detail": {
                    "type": "string"
                  },
                  "retryable": {
                    "type": "boolean"
                  },
                  "layers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "detail": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "field",
                        "detail"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "code",
                  "detail",
                  "retryable",
                  "layers"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 256
                },
                "description": "Up to 16 keys; returned verbatim"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "started_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "finished_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "polling_url": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "kind",
          "status",
          "template_id",
          "output_mode",
          "progress",
          "outputs",
          "error",
          "metadata",
          "created_at",
          "started_at",
          "finished_at",
          "polling_url"
        ],
        "additionalProperties": false
      },
      "RenderCreate": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PosterRenderCreate"
          },
          {
            "$ref": "#/components/schemas/VideoRenderCreate"
          },
          {
            "$ref": "#/components/schemas/PdfRenderCreate"
          }
        ],
        "description": "Discriminated on `kind`",
        "discriminator": {
          "propertyName": "kind",
          "mapping": {
            "poster": "#/components/schemas/PosterRenderCreate",
            "video": "#/components/schemas/VideoRenderCreate",
            "pdf": "#/components/schemas/PdfRenderCreate"
          }
        }
      },
      "RenderList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Render"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RenderOutput": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "Signed and short lived; GET the render again to mint a fresh URL"
          },
          "expires_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "width": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "content_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "thumbnail_url": {
            "description": "Video outputs only: signed still image",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "format",
          "url",
          "expires_at",
          "bytes",
          "width",
          "height",
          "duration_ms",
          "pages",
          "content_type"
        ],
        "additionalProperties": false
      },
      "SceneDocument": {
        "type": "object",
        "properties": {},
        "additionalProperties": {},
        "description": "A scene-schema SceneDoc: { schema_version, canvas, layers, ... }. Validated server side."
      },
      "SceneEnvelope": {
        "type": "object",
        "properties": {
          "scene": {
            "$ref": "#/components/schemas/SceneDocument"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "scene",
          "revision"
        ],
        "additionalProperties": false
      },
      "SceneUpdate": {
        "type": "object",
        "properties": {
          "scene": {
            "$ref": "#/components/schemas/SceneDocument"
          },
          "base_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "scene",
          "base_revision"
        ],
        "additionalProperties": false
      },
      "Template": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "template"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TemplateKind"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "width": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "height": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Video templates only"
          },
          "page_count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "PDF templates only"
          },
          "thumbnail_url": {
            "description": "Signed, short lived; null while the thumbnail regenerates",
            "type": [
              "string",
              "null"
            ]
          },
          "listed": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "field_count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "updated_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          }
        },
        "required": [
          "object",
          "id",
          "kind",
          "title",
          "description",
          "tags",
          "width",
          "height",
          "duration_ms",
          "page_count",
          "thumbnail_url",
          "listed",
          "revision",
          "field_count",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "TemplateCreate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "kind": {
            "$ref": "#/components/schemas/TemplateKind"
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8000
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8000
          },
          "tags": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "listed": {
            "type": "boolean"
          },
          "scene": {
            "$ref": "#/components/schemas/SceneDocument"
          },
          "library_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        },
        "required": [
          "title",
          "kind"
        ],
        "additionalProperties": false
      },
      "TemplateDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "template"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TemplateKind"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "width": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "height": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Video templates only"
          },
          "page_count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "PDF templates only"
          },
          "thumbnail_url": {
            "description": "Signed, short lived; null while the thumbnail regenerates",
            "type": [
              "string",
              "null"
            ]
          },
          "listed": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "field_count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "updated_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "kind",
          "title",
          "description",
          "tags",
          "width",
          "height",
          "duration_ms",
          "page_count",
          "thumbnail_url",
          "listed",
          "revision",
          "field_count",
          "created_at",
          "updated_at",
          "fields",
          "instructions"
        ],
        "additionalProperties": false
      },
      "TemplateKind": {
        "type": "string",
        "enum": [
          "poster",
          "video",
          "pdf"
        ],
        "description": "Workspace of a template"
      },
      "TemplateList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Template"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "TemplatePatch": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "tags": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "listed": {
            "type": "boolean"
          },
          "kind": {
            "$ref": "#/components/schemas/TemplateKind"
          }
        },
        "additionalProperties": false
      },
      "VideoRenderCreate": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "video"
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "fields": {
            "$ref": "#/components/schemas/FieldValues"
          },
          "clips": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "fields": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              },
              "required": [
                "template_id"
              ],
              "additionalProperties": false
            }
          },
          "options": {
            "type": "object",
            "properties": {
              "width": {
                "type": "integer",
                "minimum": 1,
                "maximum": 8000
              },
              "height": {
                "type": "integer",
                "minimum": 1,
                "maximum": 8000
              },
              "fps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "canvas_background": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "output_mode": {
            "type": "string",
            "enum": [
              "preview",
              "final"
            ]
          },
          "webhook_url": {
            "description": "https only; called once when the render finishes",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 256
                },
                "description": "Up to 16 keys; returned verbatim"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "kind"
        ],
        "additionalProperties": false
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "description": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "disabled_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "disabled_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "endpoint_gone",
                  "sustained_failure"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "failure_streak": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "last_delivery_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "last_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "previous_secret_expires_at": {
            "description": "Set while a rotated secret is still valid (24 h overlap)",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "updated_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          }
        },
        "required": [
          "object",
          "id",
          "url",
          "events",
          "description",
          "active",
          "disabled_at",
          "disabled_reason",
          "failure_streak",
          "last_delivery_at",
          "last_status",
          "previous_secret_expires_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "WebhookCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "https only (http only with the dev flag); must resolve to public addresses"
          },
          "events": {
            "description": "Default: all three render events",
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_delivery"
          },
          "id": {
            "type": "string"
          },
          "webhook_id": {
            "type": "string"
          },
          "event_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "description": "render.completed, render.failed, render.cancelled or webhook.test"
          },
          "render_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "delivered",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "max_attempts": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "next_attempt_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "response_snippet": {
            "description": "At most 512 characters",
            "type": [
              "string",
              "null"
            ]
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "replay_of": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "delivered_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "webhook_id",
          "event_id",
          "type",
          "render_id",
          "status",
          "attempts",
          "max_attempts",
          "next_attempt_at",
          "response_status",
          "response_snippet",
          "duration_ms",
          "error",
          "replay_of",
          "created_at",
          "delivered_at"
        ],
        "additionalProperties": false
      },
      "WebhookDeliveryList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable per render and type; receivers dedupe on the webhook-id header"
          },
          "type": {
            "type": "string",
            "enum": [
              "render.completed",
              "render.failed",
              "render.cancelled",
              "webhook.test"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "data": {
            "type": "object",
            "properties": {
              "render": {
                "$ref": "#/components/schemas/Render"
              },
              "test": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "render"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ],
        "additionalProperties": false,
        "description": "Body of a webhook delivery. Signed with Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature)."
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "render.completed",
          "render.failed",
          "render.cancelled"
        ],
        "description": "Subscribable events"
      },
      "WebhookList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WebhookPatch": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "events": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "active": {
            "description": "true on a disabled endpoint clears disabled_at and the failure streak",
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "WebhookWithSecret": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "description": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "disabled_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "disabled_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "endpoint_gone",
                  "sustained_failure"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "failure_streak": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "last_delivery_at": {
            "description": "ISO 8601 timestamp (UTC) or null",
            "type": [
              "string",
              "null"
            ]
          },
          "last_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "previous_secret_expires_at": {
            "description": "Set while a rotated secret is still valid (24 h overlap)",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "updated_at": {
            "type": "string",
            "description": "ISO 8601 timestamp (UTC)"
          },
          "secret": {
            "type": "string",
            "description": "whsec_ + base64 key. Returned only on create and rotate-secret; store it now"
          }
        },
        "required": [
          "object",
          "id",
          "url",
          "events",
          "description",
          "active",
          "disabled_at",
          "disabled_reason",
          "failure_streak",
          "last_delivery_at",
          "last_status",
          "previous_secret_expires_at",
          "created_at",
          "updated_at",
          "secret"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed request",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid or expired token (codes unauthorized, token_expired)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InsufficientCredits": {
        "description": "A final render needs credit",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The token lacks the required scope (code insufficient_scope)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "Unknown resource, or a resource of another project",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict (stale base_revision, idempotency key in flight, render already finished, disabled webhook)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "Request body or upload too large",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "Unsupported content type",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "Validation failed (or idempotency_key_reused / kind_mismatch); errors[] lists every problem with a JSON pointer",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit, concurrency limit or daily cost cap reached; see Retry-After",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal error; only the request_id is exposed",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The database or queue is temporarily unavailable",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  }
}