{
  "openapi": "3.0.0",
  "info": {
    "title": "Express API for Sites",
    "version": "1.0.0",
    "description": "This is a simple Express application that uses Sequelize and PostgreSQL to manage Transkribus sites.",
    "termsOfService": "https://readcoop.eu/terms-and-conditions/",
    "contact": {
      "email": "info@readcoop.eu"
    }
  },
  "servers": [
    {
      "url": "https://api-sites.transkribus.eu",
      "description": "Production server"
    }
  ],
  "components": {
    "securitySchemes": {
      "oAuth2AuthCode": {
        "type": "oauth2",
        "description": "READCOOP SSO",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://account.readcoop.eu/auth/realms/readcoop/protocol/openid-connect/auth",
            "tokenUrl": "https://account.readcoop.eu/auth/realms/readcoop/protocol/openid-connect/token",
            "refreshUrl": "https://account.readcoop.eu/auth/realms/readcoop/protocol/openid-connect/token",
            "scopes": {
              "openid": "standard scope"
            },
            "clientId": "sites-api-client-swagger"
          }
        }
      }
    },
    "schemas": {
      "Config": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "range": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "to": {
                  "type": "integer"
                },
                "from": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "field": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            },
            "description": "The range of values for the site"
          },
          "hasURL": {
            "type": "boolean",
            "description": "Indicates if the site has a URL"
          },
          "imprint": {
            "type": "string",
            "description": "The imprint information of the site"
          },
          "hasFilter": {
            "type": "boolean",
            "description": "Indicates if the site has a filter"
          }
        }
      },
      "Site": {
        "type": "object",
        "required": [
          "title",
          "colId",
          "userId"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "The title of the site"
          },
          "aboutText": {
            "type": "string",
            "description": "The about text of the site"
          },
          "description": {
            "type": "string",
            "description": "The description of the site"
          },
          "url": {
            "type": "string",
            "description": "The URL of the site"
          },
          "colId": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "The images of the site"
          },
          "userId": {
            "type": "integer",
            "description": "The user ID of the site"
          },
          "additionalUsers": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Additional users of the site"
          },
          "status": {
            "type": "string",
            "description": "The status of the site"
          },
          "config": {
            "$ref": "#/components/schemas/Config",
            "description": "The configuration of the site"
          },
          "imprint": {
            "type": "object",
            "description": "The imprint of the site"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The images of the site"
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The locales of the site"
          }
        }
      }
    }
  },
  "security": [
    {
      "oAuth2AuthCode": [
        "openid"
      ]
    }
  ],
  "paths": {
    "/v2/sites": {
      "post": {
        "summary": "Create a new site with initial draft version",
        "tags": [
          "V2 Sites"
        ],
        "description": "Creates a site AND its first draft version with default home page and hero block",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "userId"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Unique site URL/slug"
                  },
                  "userId": {
                    "type": "integer",
                    "description": "Owner user ID"
                  },
                  "title": {
                    "type": "string",
                    "description": "Site title"
                  },
                  "description": {
                    "type": "string",
                    "description": "Site description"
                  },
                  "colId": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Collection IDs (required)"
                  },
                  "config": {
                    "type": "object",
                    "description": "Site configuration"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Site created with initial draft"
          },
          "400": {
            "description": "Missing required fields"
          },
          "409": {
            "description": "URL already taken"
          }
        },
        "operationId": "post-v2-sites"
      }
    },
    "/v2/sites/by-url/{url}": {
      "get": {
        "summary": "Get site by URL slug",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Site URL slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Site found"
          },
          "404": {
            "description": "Site not found"
          },
          "500": {
            "description": "Server error"
          }
        },
        "operationId": "get-v2-sites-by-url-url"
      }
    },
    "/v2/sites/by-url/{url}/pages/{pageKey}": {
      "get": {
        "summary": "Get page by site URL and page key",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Site URL slug"
          },
          {
            "in": "path",
            "name": "pageKey",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Page key/slug"
          },
          {
            "in": "query",
            "name": "published",
            "schema": {
              "type": "boolean"
            },
            "description": "Get published version (default is draft)"
          }
        ],
        "responses": {
          "200": {
            "description": "Page found with site and version info"
          },
          "404": {
            "description": "Site, version, or page not found"
          },
          "500": {
            "description": "Server error"
          }
        },
        "operationId": "get-v2-sites-by-url-url-pages-pagekey"
      }
    },
    "/v2/sites/{siteId}": {
      "get": {
        "summary": "Get a site by ID",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Site details"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "get-v2-sites-siteid"
      },
      "put": {
        "summary": "Update a site by ID",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "colId": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "config": {
                    "type": "object"
                  },
                  "locales": {
                    "type": "array"
                  },
                  "metadata": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Site updated"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "put-v2-sites-siteid"
      },
      "delete": {
        "summary": "Delete a site (Owner/Admin only)",
        "tags": [
          "V2 Sites"
        ],
        "description": "Soft-deletes the site and all associated v2 data (versions, pages, blocks, changelog).",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Site deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "delete-v2-sites-siteid"
      }
    },
    "/v2/sites/url-taken/{url}": {
      "get": {
        "summary": "Url taken",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-url-taken-url"
      }
    },
    "/v2/sites/{siteId}/theme": {
      "patch": {
        "summary": "Update the theme of a site (Owner/Admin/Editor)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "theme"
                ],
                "properties": {
                  "theme": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Site theme updated"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "patch-v2-sites-siteid-theme"
      }
    },
    "/v2/sites/{siteId}/restore": {
      "post": {
        "summary": "Restore a soft-deleted site (Owner/Admin only)",
        "tags": [
          "V2 Sites"
        ],
        "description": "Restores the site and all associated v2 data (versions, pages, blocks, changelog).",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Site restored successfully"
          },
          "400": {
            "description": "Site is not deleted"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "post-v2-sites-siteid-restore"
      }
    },
    "/v2/sites/{siteId}/versions": {
      "get": {
        "summary": "Get all versions for a site",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          }
        ],
        "responses": {
          "200": {
            "description": "List of versions"
          },
          "500": {
            "description": "Server error"
          }
        },
        "operationId": "get-v2-sites-siteid-versions"
      }
    },
    "/v2/sites/{siteId}/versions/draft": {
      "get": {
        "summary": "Get the draft version for a site",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pages"
              ]
            },
            "description": "Pass \"pages\" to include nested pages and blocks in the response"
          }
        ],
        "responses": {
          "200": {
            "description": "Draft version metadata (pages and blocks included only if ?include=pages)"
          },
          "404": {
            "description": "No draft version found"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-draft"
      }
    },
    "/v2/sites/{siteId}/versions/published": {
      "get": {
        "summary": "Get the published version for a site",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Published version with pages and blocks"
          },
          "404": {
            "description": "No published version found"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-published"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}": {
      "get": {
        "summary": "Get a specific version with pages and blocks",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Version with pages and blocks"
          },
          "404": {
            "description": "Version not found"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-versionid"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/publish": {
      "post": {
        "summary": "Publish the draft version",
        "tags": [
          "V2 Sites"
        ],
        "description": "1. Sets current published version to 'frozen'\n2. Promotes draft to 'published' with new versionNumber\n3. Creates new draft (copy of published)\n",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The draft version ID to publish"
          }
        ],
        "responses": {
          "200": {
            "description": "Published successfully"
          },
          "404": {
            "description": "Draft version not found"
          }
        },
        "operationId": "post-v2-sites-siteid-versions-versionid-publish"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/locale-config": {
      "patch": {
        "summary": "Update locale configuration for a draft version",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "defaultLocale",
                  "availableLocales"
                ],
                "properties": {
                  "defaultLocale": {
                    "type": "string"
                  },
                  "availableLocales": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Locale config updated"
          },
          "400": {
            "description": "Invalid request body"
          },
          "404": {
            "description": "Version not found"
          },
          "409": {
            "description": "Version is published or frozen"
          }
        },
        "operationId": "patch-v2-sites-siteid-versions-versionid-locale-config"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/restore": {
      "post": {
        "summary": "Restore from any version (creates new draft)",
        "tags": [
          "V2 Sites"
        ],
        "description": "1. Deletes current draft and its pages/blocks\n2. Creates new draft from source version\n3. Published version remains unchanged\n",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The source version ID to restore from"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "integer",
                    "description": "User ID performing the restore"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restored successfully"
          },
          "404": {
            "description": "Source version not found"
          }
        },
        "operationId": "post-v2-sites-siteid-versions-versionid-restore"
      }
    },
    "/v2/sites/{siteId}/stats": {
      "get": {
        "summary": "Get site statistics",
        "tags": [
          "V2 Sites"
        ],
        "description": "Returns statistics for a site including collection count, document count, page count, and transcription rate",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Site statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "collections": {
                          "type": "integer"
                        },
                        "documents": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "transcriptionRate": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "get-v2-sites-siteid-stats"
      }
    },
    "/v2/sites/by-url/{url}/documents": {
      "get": {
        "summary": "List documents for a site (browse page)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 24
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "sortColumn",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortDirection",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "in": "query",
            "name": "title",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "author",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "writer",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "genre",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "description",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scriptType",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "authority",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "createdfrom",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "createdto",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "trpDocMetadata": {
                          "type": "array"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-documents"
      }
    },
    "/v2/sites/by-url/{url}/tags": {
      "get": {
        "summary": "List tags",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-tags"
      }
    },
    "/v2/sites/by-url/{url}/tag-defs": {
      "get": {
        "summary": "List tag defs",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-tag-defs"
      }
    },
    "/v2/sites/by-url/{url}/document-dates": {
      "get": {
        "summary": "List document dates",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-document-dates"
      }
    },
    "/v2/sites/by-url/{url}/hierarchy": {
      "get": {
        "summary": "List hierarchy",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-hierarchy"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages": {
      "get": {
        "summary": "Get all pages for a specific version",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID"
          }
        ],
        "responses": {
          "200": {
            "description": "List of pages with blocks"
          },
          "404": {
            "description": "Version not found"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-versionid-pages"
      },
      "post": {
        "summary": "Create a new page (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "type"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Unique page key (e.g., 'home', 'about')"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "home",
                      "about",
                      "browse",
                      "search",
                      "imprint",
                      "contact",
                      "custom"
                    ],
                    "description": "Page template type"
                  },
                  "order": {
                    "type": "integer",
                    "description": "Display order"
                  },
                  "isPinned": {
                    "type": "boolean",
                    "description": "Whether page is pinned in navigation"
                  },
                  "isHidden": {
                    "type": "boolean",
                    "description": "Whether page is hidden from navigation"
                  },
                  "title": {
                    "type": "object",
                    "description": "Localized titles, e.g. en=Home, de=Startseite"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Page created"
          },
          "400": {
            "description": "Can only create pages on draft version"
          }
        },
        "operationId": "post-v2-sites-siteid-versions-versionid-pages"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages/{pageId}": {
      "get": {
        "summary": "Get a specific page with blocks",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Page with blocks"
          },
          "404": {
            "description": "Page not found"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-versionid-pages-pageid"
      },
      "put": {
        "summary": "Update a page (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "home",
                      "about",
                      "browse",
                      "search",
                      "imprint",
                      "contact",
                      "custom"
                    ]
                  },
                  "order": {
                    "type": "integer"
                  },
                  "isPinned": {
                    "type": "boolean"
                  },
                  "isHidden": {
                    "type": "boolean"
                  },
                  "title": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Page updated"
          },
          "400": {
            "description": "Can only update pages on draft version"
          },
          "404": {
            "description": "Page not found"
          }
        },
        "operationId": "put-v2-sites-siteid-versions-versionid-pages-pageid"
      },
      "delete": {
        "summary": "Delete a page (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Page deleted"
          },
          "400": {
            "description": "Can only delete pages on draft version"
          },
          "404": {
            "description": "Page not found"
          }
        },
        "operationId": "delete-v2-sites-siteid-versions-versionid-pages-pageid"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages/{pageId}/settings": {
      "put": {
        "summary": "Update page settings (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "description": "Updates the settings JSONB for a page. Primarily used for system pages (home, browse, search, document-view, imprint).",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "settings"
                ],
                "properties": {
                  "settings": {
                    "type": "object",
                    "description": "Page-specific settings object (merged with existing settings)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Page settings updated"
          },
          "400": {
            "description": "Can only update settings on draft version"
          },
          "404": {
            "description": "Page not found"
          }
        },
        "operationId": "put-v2-sites-siteid-versions-versionid-pages-pageid-settings"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages/{pageId}/blocks": {
      "get": {
        "summary": "Get all blocks for a page",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "responses": {
          "200": {
            "description": "List of blocks"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-versionid-pages-pageid-blocks"
      },
      "post": {
        "summary": "Create a new block (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "hero",
                      "text",
                      "gallery",
                      "collection",
                      "document",
                      "contact",
                      "custom"
                    ],
                    "description": "Block type"
                  },
                  "order": {
                    "type": "integer",
                    "description": "Display order within page"
                  },
                  "config": {
                    "type": "object",
                    "description": "Block configuration (layout, settings)"
                  },
                  "locales": {
                    "type": "object",
                    "description": "Localized content per language code"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Block created"
          },
          "400": {
            "description": "Can only create blocks on draft version"
          },
          "404": {
            "description": "Page not found"
          }
        },
        "operationId": "post-v2-sites-siteid-versions-versionid-pages-pageid-blocks"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages/{pageId}/blocks/reorder": {
      "put": {
        "summary": "Reorder blocks within a page",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "blockOrder"
                ],
                "properties": {
                  "blockOrder": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Array of block IDs in desired order"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Blocks reordered"
          },
          "400": {
            "description": "Can only reorder blocks on draft version"
          },
          "404": {
            "description": "Page not found"
          }
        },
        "operationId": "put-v2-sites-siteid-versions-versionid-pages-pageid-blocks-reorder"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages/{pageId}/blocks/{blockId}": {
      "put": {
        "summary": "Update a block (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The block ID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "hero",
                      "text",
                      "gallery",
                      "collection",
                      "document",
                      "contact",
                      "custom"
                    ]
                  },
                  "order": {
                    "type": "integer"
                  },
                  "config": {
                    "type": "object"
                  },
                  "locales": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Block updated"
          },
          "400": {
            "description": "Can only update blocks on draft version"
          },
          "404": {
            "description": "Block not found"
          }
        },
        "operationId": "put-v2-sites-siteid-versions-versionid-pages-pageid-blocks-blockid"
      },
      "delete": {
        "summary": "Delete a block (only on draft version)",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID (must be draft)"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The page ID"
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The block ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Block deleted"
          },
          "400": {
            "description": "Can only delete blocks on draft version"
          },
          "404": {
            "description": "Block not found"
          }
        },
        "operationId": "delete-v2-sites-siteid-versions-versionid-pages-pageid-blocks-blockid"
      }
    },
    "/v2/sites/{siteId}/images/{type}": {
      "post": {
        "summary": "Upload an image for a site",
        "tags": [
          "V2 Sites"
        ],
        "description": "Upload an image (background, logo, favicon, etc.) for a site. Images are stored in S3 and referenced in the site's images array.",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "background",
                "logo",
                "favicon"
              ]
            },
            "description": "The type of image"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "alt": {
                    "type": "string",
                    "description": "Alt text for the image"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image uploaded successfully"
          },
          "400": {
            "description": "No file uploaded or invalid file type"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "post-v2-sites-siteid-images-type"
      },
      "delete": {
        "summary": "Delete an image from a site",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image deleted successfully"
          },
          "404": {
            "description": "Site or image not found"
          }
        },
        "operationId": "delete-v2-sites-siteid-images-type"
      }
    },
    "/v2/sites/{siteId}/images": {
      "get": {
        "summary": "Get all images for a site",
        "tags": [
          "V2 Sites"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of images with URLs"
          },
          "404": {
            "description": "Site not found"
          }
        },
        "operationId": "get-v2-sites-siteid-images"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/pages/{pageId}/blocks/{blockId}/image": {
      "post": {
        "summary": "Upload an image for a specific block",
        "tags": [
          "V2 Sites"
        ],
        "description": "Upload an image for a block. The image URL is stored directly in block.config[configKey]. This keeps block images separate from site-level images.",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Must be a draft version"
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "configKey",
            "schema": {
              "type": "string",
              "default": "src"
            },
            "description": "The config key to store the image URL (e.g., \"src\", \"backgroundImage\")"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image uploaded and block config updated"
          },
          "400": {
            "description": "No file uploaded, invalid file type, or not a draft version"
          },
          "404": {
            "description": "Block not found"
          }
        },
        "operationId": "post-v2-sites-siteid-versions-versionid-pages-pageid-blocks-blockid-image"
      },
      "delete": {
        "summary": "Delete a block's image",
        "tags": [
          "V2 Sites"
        ],
        "description": "Delete the image from S3 and clear the config reference",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "configKey",
            "schema": {
              "type": "string",
              "default": "src"
            },
            "description": "The config key containing the image URL"
          }
        ],
        "responses": {
          "200": {
            "description": "Image deleted successfully"
          },
          "400": {
            "description": "Not a draft version"
          },
          "404": {
            "description": "Block not found"
          }
        },
        "operationId": "delete-v2-sites-siteid-versions-versionid-pages-pageid-blocks-blockid-image"
      }
    },
    "/v2/sites/{siteId}/versions/{versionId}/changelog": {
      "get": {
        "summary": "Get changelog entries for a version",
        "tags": [
          "V2 Sites"
        ],
        "description": "Returns a chronological list of changes made to a version (newest first). For draft versions this shows pending changes; for published/frozen versions it shows the changes that were part of that release.",
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID"
          },
          {
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The version ID"
          }
        ],
        "responses": {
          "200": {
            "description": "List of changelog entries"
          },
          "404": {
            "description": "Version not found"
          }
        },
        "operationId": "get-v2-sites-siteid-versions-versionid-changelog"
      }
    },
    "/v2/sites/by-url/{url}/analytics/visitors": {
      "get": {
        "summary": "Get analytics visitors",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-analytics-visitors"
      }
    },
    "/v2/sites/by-url/{url}/analytics/searches": {
      "get": {
        "summary": "Get analytics searches",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-analytics-searches"
      }
    },
    "/v2/sites/by-url/{url}/search": {
      "post": {
        "summary": "Search documents",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "post-v2-sites-by-url-url-search"
      }
    },
    "/v2/sites/by-url/{url}/search/facets": {
      "post": {
        "summary": "Search facets",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "post-v2-sites-by-url-url-search-facets"
      }
    },
    "/v2/sites/by-url/{url}/search/tags": {
      "post": {
        "summary": "Search tags",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "post-v2-sites-by-url-url-search-tags"
      }
    },
    "/v2/sites/by-url/{url}/collection-names": {
      "get": {
        "summary": "Get collection names",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-collection-names"
      }
    },
    "/v2/sites/by-url/{url}/documents/{docId}/pages/{pageNum}": {
      "get": {
        "summary": "Get document page",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "docId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pageNum",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-documents-docid-pages-pagenum"
      }
    },
    "/v2/sites/by-url/{url}/documents/{docId}/metadata": {
      "get": {
        "summary": "Get document meta",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "docId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "get-v2-sites-by-url-url-documents-docid-metadata"
      }
    },
    "/v2/sites/by-url/{url}/documents/{docId}/pages": {
      "post": {
        "summary": "List document pages",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "url",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "docId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "post-v2-sites-by-url-url-documents-docid-pages"
      }
    },
    "/v2/sites/{siteId}/count-pages": {
      "post": {
        "summary": "Count pages",
        "description": "Documented from the route definition. Request and response schemas are not described yet; refine them when the operation is touched.",
        "tags": [
          "V2 Sites"
        ],
        "security": [
          {
            "oAuth2AuthCode": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "siteId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid token"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "post-v2-sites-siteid-count-pages"
      }
    }
  },
  "definitions": {
    "HiddenPage": {
      "type": "object",
      "properties": {
        "colId": {
          "type": "integer"
        },
        "docId": {
          "type": "integer"
        },
        "pageId": {
          "type": "integer"
        },
        "userId": {
          "type": "integer"
        },
        "note": {
          "type": "string"
        },
        "releaseDate": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  },
  "tags": [
    {
      "name": "V2 Sites",
      "description": "V2 API endpoints for versioned site content management"
    }
  ]
}
