{
  "openapi": "3.1.0",
  "info": {
    "title": "sitecms API",
    "version": "1.0.0",
    "summary": "Content API for sites connected to sitecms, a Swedish headless CMS run as a service.",
    "description": "sitecms är ett svenskt headless CMS där företagare redigerar texter, bilder, nyheter, tjänster och priser på sin hemsida själva, och där utvecklaren kopplar sajten med ett npm-paket för Next.js, Astro, Nuxt, SvelteKit eller ren JavaScript.\n\nThis is the key-based API the npm packages use. The site is identified by the `x-api-key` header. Only published content is returned. All responses are JSON (except `events`, which answers 204) with `Cache-Control: private, no-store`; cache on your side. Error messages are in Swedish. The editing panel is in Swedish. sitecms is a hosted service and cannot be self-hosted.\n\nDocumentation: https://sitecms.se/docs (Swedish). For AI assistants: https://sitecms.se/llms.txt",
    "contact": {
      "name": "sitecms",
      "url": "https://sitecms.se",
      "email": "info@oskarostlind.se"
    }
  },
  "externalDocs": {
    "description": "Developer documentation (Swedish)",
    "url": "https://sitecms.se/docs#api"
  },
  "servers": [
    {
      "url": "https://sitecms.se",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Content",
      "description": "Pages, blocks, services and SEO."
    },
    {
      "name": "Posts",
      "description": "News and blog posts."
    },
    {
      "name": "Collections",
      "description": "Custom content types declared in the site's config."
    },
    {
      "name": "Schema",
      "description": "Declare and read the site's structure."
    },
    {
      "name": "Site",
      "description": "Connection check and live preview."
    },
    {
      "name": "Traffic",
      "description": "Cookie-free page view counting."
    },
    {
      "name": "Quote requests",
      "description": "Quote request forms on the site."
    },
    {
      "name": "Older slug addresses",
      "description": "`/api/v1/sites/{slug}/…`: older addresses with the site's slug, kept for existing integrations."
    }
  ],
  "paths": {
    "/api/v1/site/content": {
      "get": {
        "operationId": "getContent",
        "tags": [
          "Content"
        ],
        "summary": "Get all content",
        "description": "The site's name, every page with its blocks in order, visible services and SEO per page. Richtext blocks carry ready `html`; image blocks carry `alt`. Only published content.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Locale"
          },
          {
            "$ref": "#/components/parameters/Preview"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetContent200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/GetContent401"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/content": {
      "get": {
        "operationId": "getContentBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Get all content",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/content`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "$ref": "#/components/parameters/Locale"
          },
          {
            "$ref": "#/components/parameters/Preview"
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetContent200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/GetContent401"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          }
        }
      }
    },
    "/api/v1/site/posts": {
      "get": {
        "operationId": "listPosts",
        "tags": [
          "Posts"
        ],
        "summary": "List posts",
        "description": "Published posts, newest first, without the body (for listing pages).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListPosts200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/posts": {
      "get": {
        "operationId": "listPostsBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "List posts",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/posts`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListPosts200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          }
        }
      }
    },
    "/api/v1/site/posts/{postSlug}": {
      "get": {
        "operationId": "getPost",
        "tags": [
          "Posts"
        ],
        "summary": "Get a post",
        "description": "One published post with the Markdown `body` and rendered `bodyHtml`. Drafts are not visible.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PostSlug"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetPost200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/GetPost404"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/posts/{postSlug}": {
      "get": {
        "operationId": "getPostBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Get a post",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/posts/{postSlug}`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "$ref": "#/components/parameters/PostSlug"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetPost200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/GetPost404"
          }
        }
      }
    },
    "/api/v1/site/collections": {
      "get": {
        "operationId": "listCollections",
        "tags": [
          "Collections"
        ],
        "summary": "List collections",
        "description": "The site's custom content types with their fields and the number of published entries.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListCollections200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/collections": {
      "get": {
        "operationId": "listCollectionsBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "List collections",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/collections`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListCollections200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          }
        }
      }
    },
    "/api/v1/site/collections/{key}": {
      "get": {
        "operationId": "listEntries",
        "tags": [
          "Collections"
        ],
        "summary": "List entries in a collection",
        "description": "Published entries, in manual order for sortable collections, otherwise newest first. Hidden fields are not sent.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CollectionKey"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListEntries200"
          },
          "400": {
            "$ref": "#/components/responses/ListEntries400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/ListEntries404"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/collections/{key}": {
      "get": {
        "operationId": "listEntriesBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "List entries in a collection",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/collections/{key}`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "$ref": "#/components/parameters/CollectionKey"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListEntries200"
          },
          "400": {
            "$ref": "#/components/responses/ListEntries400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/ListEntries404"
          }
        }
      }
    },
    "/api/v1/site/collections/{key}/{slugOrId}": {
      "get": {
        "operationId": "getEntry",
        "tags": [
          "Collections"
        ],
        "summary": "Get an entry",
        "description": "One published entry, by slug or id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CollectionKey"
          },
          {
            "$ref": "#/components/parameters/SlugOrId"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetEntry200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/GetEntry404"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/collections/{key}/{slugOrId}": {
      "get": {
        "operationId": "getEntryBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Get an entry",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/collections/{key}/{slugOrId}`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "$ref": "#/components/parameters/CollectionKey"
          },
          {
            "$ref": "#/components/parameters/SlugOrId"
          },
          {
            "$ref": "#/components/parameters/Locale"
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetEntry200"
          },
          "400": {
            "$ref": "#/components/responses/LocaleUnknown"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/GetEntry404"
          }
        }
      }
    },
    "/api/v1/site/schema": {
      "get": {
        "operationId": "getSchema",
        "tags": [
          "Schema"
        ],
        "summary": "Get the current structure",
        "description": "The pages, fields and collections as they are stored, in the same format as the declaration but without `default` and with `hasValue` per field. Useful for diffing against your config.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetSchema200"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "syncSchema",
        "tags": [
          "Schema"
        ],
        "summary": "Sync the structure",
        "description": "Declares the site's pages and fields (and collections in version 2). Creates what is missing and updates labels and order. Content is never overwritten. `sitecms-<framework> sync` calls this at build time. Max 2 MB.",
        "requestBody": {
          "$ref": "#/components/requestBodies/SyncSchemaBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SyncSchema200"
          },
          "400": {
            "$ref": "#/components/responses/SyncSchema400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SyncSchema404"
          },
          "409": {
            "$ref": "#/components/responses/SyncSchema409"
          },
          "413": {
            "$ref": "#/components/responses/SyncSchema413"
          },
          "500": {
            "$ref": "#/components/responses/SyncSchema500"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/schema": {
      "get": {
        "operationId": "getSchemaBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Get the current structure",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/schema`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetSchema200"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          }
        }
      },
      "post": {
        "operationId": "syncSchemaBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Sync the structure",
        "description": "Older address with the site's slug. Same response as `POST /api/v1/site/schema`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "requestBody": {
          "$ref": "#/components/requestBodies/SyncSchemaBody"
        },
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SyncSchema200"
          },
          "400": {
            "$ref": "#/components/responses/SyncSchema400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SyncSchema404"
          },
          "409": {
            "$ref": "#/components/responses/SyncSchema409"
          },
          "413": {
            "$ref": "#/components/responses/SyncSchema413"
          },
          "500": {
            "$ref": "#/components/responses/SyncSchema500"
          }
        }
      }
    },
    "/api/v1/site/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "Site"
        ],
        "summary": "Check the connection",
        "description": "Confirms that the key belongs to a site, and reports pages, last schema sync and the status of the last webhook.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetHealth200"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/health": {
      "get": {
        "operationId": "getHealthBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Check the connection",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/health`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/GetHealth200"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          }
        }
      }
    },
    "/api/v1/site/preview": {
      "get": {
        "operationId": "verifyPreview",
        "tags": [
          "Site"
        ],
        "summary": "Verify a live preview token",
        "description": "Used by the site's preview route before it turns on draft mode.",
        "parameters": [
          {
            "name": "x-sitecms-preview",
            "in": "header",
            "required": true,
            "description": "Live preview token (sent by the panel to the site's preview route). Adds saved drafts and unsaved panel values and `\"preview\": true`. Invalid or expired: 401 `preview_invalid`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VerifyPreview200"
          },
          "401": {
            "$ref": "#/components/responses/VerifyPreview401"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/preview": {
      "get": {
        "operationId": "verifyPreviewBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Verify a live preview token",
        "description": "Older address with the site's slug. Same response as `GET /api/v1/site/preview`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          },
          {
            "name": "x-sitecms-preview",
            "in": "header",
            "required": true,
            "description": "Live preview token (sent by the panel to the site's preview route). Adds saved drafts and unsaved panel values and `\"preview\": true`. Invalid or expired: 401 `preview_invalid`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "$ref": "#/components/responses/VerifyPreview200"
          },
          "401": {
            "$ref": "#/components/responses/VerifyPreview401"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          }
        }
      }
    },
    "/api/v1/site/events": {
      "post": {
        "operationId": "recordPageviews",
        "tags": [
          "Traffic"
        ],
        "summary": "Record page views",
        "description": "Server-to-server from the site's analytics route. Bots are filtered out; IP and user agent are only used for a daily visitor hash and are never stored. Max 20 events and 4 kB per request, 600 events per minute and site.",
        "requestBody": {
          "$ref": "#/components/requestBodies/RecordPageviewsBody"
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/RecordPageviews204"
          },
          "400": {
            "$ref": "#/components/responses/RecordPageviews400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "413": {
            "$ref": "#/components/responses/RecordPageviews413"
          },
          "429": {
            "$ref": "#/components/responses/RecordPageviews429"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/events": {
      "post": {
        "operationId": "recordPageviewsBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Record page views",
        "description": "Older address with the site's slug. Same response as `POST /api/v1/site/events`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "requestBody": {
          "$ref": "#/components/requestBodies/RecordPageviewsBody"
        },
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          }
        ],
        "responses": {
          "204": {
            "$ref": "#/components/responses/RecordPageviews204"
          },
          "400": {
            "$ref": "#/components/responses/RecordPageviews400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          },
          "413": {
            "$ref": "#/components/responses/RecordPageviews413"
          },
          "429": {
            "$ref": "#/components/responses/RecordPageviews429"
          }
        }
      }
    },
    "/api/v1/site/quote-requests": {
      "post": {
        "operationId": "createQuoteRequest",
        "tags": [
          "Quote requests"
        ],
        "summary": "Send a quote request",
        "description": "Server-to-server from the site's quote form. Every field is validated again, the request is stored and the company and the customer are e-mailed. Rate limit: 5 per hour and `ipHash`.",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateQuoteRequestBody"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/CreateQuoteRequest201"
          },
          "400": {
            "$ref": "#/components/responses/CreateQuoteRequest400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/CreateQuoteRequest429"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/quote-requests": {
      "post": {
        "operationId": "createQuoteRequestBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Send a quote request",
        "description": "Older address with the site's slug. Same response as `POST /api/v1/site/quote-requests`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateQuoteRequestBody"
        },
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          }
        ],
        "responses": {
          "201": {
            "$ref": "#/components/responses/CreateQuoteRequest201"
          },
          "400": {
            "$ref": "#/components/responses/CreateQuoteRequest400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          },
          "429": {
            "$ref": "#/components/responses/CreateQuoteRequest429"
          }
        }
      }
    },
    "/api/v1/site/quote-requests/attachments": {
      "post": {
        "operationId": "uploadQuoteAttachment",
        "tags": [
          "Quote requests"
        ],
        "summary": "Upload an attachment",
        "description": "Uploads one file (JPG, PNG, WEBP, HEIC or PDF, max 10 MB) before the quote request is sent. The response goes into `attachments` on the request. Rate limit: 30 per hour and `ipHash`, 200 per hour per site without it.",
        "requestBody": {
          "$ref": "#/components/requestBodies/UploadQuoteAttachmentBody"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/UploadQuoteAttachment201"
          },
          "400": {
            "$ref": "#/components/responses/UploadQuoteAttachment400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "413": {
            "$ref": "#/components/responses/UploadQuoteAttachment413"
          },
          "429": {
            "$ref": "#/components/responses/UploadQuoteAttachment429"
          },
          "500": {
            "$ref": "#/components/responses/UploadQuoteAttachment500"
          },
          "503": {
            "$ref": "#/components/responses/UploadQuoteAttachment503"
          }
        }
      }
    },
    "/api/v1/sites/{slug}/quote-requests/attachments": {
      "post": {
        "operationId": "uploadQuoteAttachmentBySlug",
        "tags": [
          "Older slug addresses"
        ],
        "summary": "Upload an attachment",
        "description": "Older address with the site's slug. Same response as `POST /api/v1/site/quote-requests/attachments`, plus 404 for an unknown slug. Existing integrations keep working; new ones use the address without slug.",
        "requestBody": {
          "$ref": "#/components/requestBodies/UploadQuoteAttachmentBody"
        },
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteSlug"
          }
        ],
        "responses": {
          "201": {
            "$ref": "#/components/responses/UploadQuoteAttachment201"
          },
          "400": {
            "$ref": "#/components/responses/UploadQuoteAttachment400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/SiteNotFound"
          },
          "413": {
            "$ref": "#/components/responses/UploadQuoteAttachment413"
          },
          "429": {
            "$ref": "#/components/responses/UploadQuoteAttachment429"
          },
          "500": {
            "$ref": "#/components/responses/UploadQuoteAttachment500"
          },
          "503": {
            "$ref": "#/components/responses/UploadQuoteAttachment503"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "The site's API key, created under Integration in the panel. Use it server-side only: it gives read access to all published content and can sync the structure."
      }
    },
    "headers": {
      "CacheControl": {
        "description": "Responses are never cached by sitecms. Cache on your side.",
        "schema": {
          "type": "string",
          "example": "private, no-store"
        }
      }
    },
    "parameters": {
      "Locale": {
        "name": "locale",
        "in": "query",
        "required": false,
        "description": "Language code, e.g. `en`. Returns the content in that language with field-level fallback to the default language, plus `locale`, `locales` and `defaultLocale` last in the body. Without the parameter (or empty) the response is exactly as without languages. Unknown language: 400 `locale_unknown`.",
        "schema": {
          "type": "string"
        }
      },
      "Preview": {
        "name": "x-sitecms-preview",
        "in": "header",
        "required": false,
        "description": "Live preview token (sent by the panel to the site's preview route). Adds saved drafts and unsaved panel values and `\"preview\": true`. Invalid or expired: 401 `preview_invalid`.",
        "schema": {
          "type": "string"
        }
      },
      "SiteSlug": {
        "name": "slug",
        "in": "path",
        "required": true,
        "description": "The site's slug (older addresses).",
        "schema": {
          "type": "string"
        }
      },
      "PostSlug": {
        "name": "postSlug",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "CollectionKey": {
        "name": "key",
        "in": "path",
        "required": true,
        "description": "The collection's key, e.g. `team`.",
        "schema": {
          "type": "string"
        }
      },
      "SlugOrId": {
        "name": "slugOrId",
        "in": "path",
        "required": true,
        "description": "The entry's slug or id.",
        "schema": {
          "type": "string"
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "1–200 (higher values are capped at 200). Default 100.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 100
        }
      },
      "Offset": {
        "name": "offset",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "The `x-api-key` header is missing, or the key is unknown (with the slug addresses: belongs to another site).",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Ogiltig API-nyckel."
                }
              }
            }
          }
        }
      },
      "LocaleUnknown": {
        "description": "Unknown language in `?locale=`.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/LocaleError"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Språket \"de\" finns inte på sajten. Sajtens språk: sv, en.",
                  "code": "locale_unknown"
                }
              }
            }
          }
        }
      },
      "SiteNotFound": {
        "description": "No site with that slug (only the older slug addresses).",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Sajten hittades inte."
                }
              }
            }
          }
        }
      },
      "GetContent200": {
        "description": "All content.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Content"
            },
            "examples": {
              "default": {
                "summary": "Without ?locale",
                "value": {
                  "site": {
                    "name": "I18n API-fixture",
                    "domain": "i18n.example.se"
                  },
                  "pages": [
                    {
                      "slug": "home",
                      "title": "Startsida",
                      "description": "Det besökaren ser först.",
                      "blocks": [
                        {
                          "key": "hero.title",
                          "type": "text",
                          "value": "Välkommen",
                          "alt": null,
                          "html": null,
                          "label": "Rubrik",
                          "help": null
                        },
                        {
                          "key": "hero.body",
                          "type": "richtext",
                          "value": "Vi bygger **hus**.",
                          "alt": null,
                          "html": "<p>Vi bygger <strong>hus</strong>.</p>",
                          "label": null,
                          "help": null
                        },
                        {
                          "key": "hero.image",
                          "type": "image",
                          "value": "https://bilder.example.se/hus.jpg",
                          "alt": "Ett rött hus",
                          "html": null,
                          "label": null,
                          "help": null
                        },
                        {
                          "key": "hero.cta",
                          "type": "text",
                          "value": "Kontakta oss",
                          "alt": null,
                          "html": null,
                          "label": null,
                          "help": null
                        }
                      ]
                    },
                    {
                      "slug": "om-oss",
                      "title": "Om oss",
                      "description": null,
                      "blocks": [
                        {
                          "key": "about.title",
                          "type": "text",
                          "value": "Om företaget",
                          "alt": null,
                          "html": null,
                          "label": null,
                          "help": "Kort"
                        }
                      ]
                    }
                  ],
                  "services": [
                    {
                      "title": "Takbyte",
                      "description": "Vi byter tak.",
                      "price": "Från 50 000 kr"
                    },
                    {
                      "title": "Fönster",
                      "description": null,
                      "price": null
                    }
                  ],
                  "seo": [
                    {
                      "pageSlug": "home",
                      "title": "Byggfirman",
                      "description": "Vi bygger hus i Luleå.",
                      "ogImage": "https://bilder.example.se/og.jpg"
                    }
                  ]
                }
              },
              "en": {
                "summary": "?locale=en (fallback per field)",
                "value": {
                  "site": {
                    "name": "I18n API-fixture",
                    "domain": "i18n.example.se"
                  },
                  "pages": [
                    {
                      "slug": "home",
                      "title": "Startsida",
                      "description": "Det besökaren ser först.",
                      "blocks": [
                        {
                          "key": "hero.title",
                          "type": "text",
                          "value": "Welcome",
                          "alt": null,
                          "html": null,
                          "label": "Rubrik",
                          "help": null,
                          "fallback": false
                        },
                        {
                          "key": "hero.body",
                          "type": "richtext",
                          "value": "We build **houses**.",
                          "alt": null,
                          "html": "<p>We build <strong>houses</strong>.</p>",
                          "label": null,
                          "help": null,
                          "fallback": false
                        },
                        {
                          "key": "hero.image",
                          "type": "image",
                          "value": "https://bilder.example.se/hus.jpg",
                          "alt": "A red house",
                          "html": null,
                          "label": null,
                          "help": null,
                          "fallback": false
                        },
                        {
                          "key": "hero.cta",
                          "type": "text",
                          "value": "Kontakta oss",
                          "alt": null,
                          "html": null,
                          "label": null,
                          "help": null,
                          "fallback": true
                        }
                      ]
                    },
                    {
                      "slug": "om-oss",
                      "title": "Om oss",
                      "description": null,
                      "blocks": [
                        {
                          "key": "about.title",
                          "type": "text",
                          "value": "Om företaget",
                          "alt": null,
                          "html": null,
                          "label": null,
                          "help": "Kort",
                          "fallback": true
                        }
                      ]
                    }
                  ],
                  "services": [
                    {
                      "title": "Roof replacement",
                      "description": "Vi byter tak.",
                      "price": "From SEK 50,000",
                      "fallback": true,
                      "fallbackFields": [
                        "description"
                      ]
                    },
                    {
                      "title": "Fönster",
                      "description": null,
                      "price": null,
                      "fallback": true,
                      "fallbackFields": [
                        "title"
                      ]
                    }
                  ],
                  "seo": [
                    {
                      "pageSlug": "home",
                      "title": "The builders",
                      "description": "Vi bygger hus i Luleå.",
                      "ogImage": "https://bilder.example.se/og.jpg",
                      "fallback": true,
                      "fallbackFields": [
                        "description"
                      ]
                    }
                  ],
                  "locale": "en",
                  "locales": [
                    "sv",
                    "en"
                  ],
                  "defaultLocale": "sv"
                }
              }
            }
          }
        }
      },
      "GetContent401": {
        "description": "Missing or wrong key, or an invalid preview token.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "$ref": "#/components/schemas/PreviewInvalid"
                }
              ]
            },
            "examples": {
              "key": {
                "value": {
                  "error": "Ogiltig API-nyckel."
                }
              },
              "preview": {
                "value": {
                  "error": "Förhandsgranskningen har gått ut. Öppna den igen i sitecms.",
                  "code": "preview_invalid"
                }
              }
            }
          }
        }
      },
      "ListPosts200": {
        "description": "Published posts.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PostList"
            },
            "examples": {
              "default": {
                "value": {
                  "posts": [
                    {
                      "slug": "nytt-tak",
                      "title": "Nytt tak på Hertsön",
                      "excerpt": "Ett snabbt jobb.",
                      "coverImage": "https://bilder.example.se/tak.jpg",
                      "coverImageAlt": "Taket",
                      "publishedAt": "2026-11-01T10:00:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "GetPost200": {
        "description": "The post.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PostResponse"
            },
            "examples": {
              "default": {
                "value": {
                  "post": {
                    "slug": "nytt-tak",
                    "title": "Nytt tak på Hertsön",
                    "excerpt": "Ett snabbt jobb.",
                    "body": "## Rubrik\n\nText med *kursiv*.",
                    "bodyHtml": "<h2>Rubrik</h2><p>Text med <em>kursiv</em>.</p>",
                    "coverImage": "https://bilder.example.se/tak.jpg",
                    "coverImageAlt": "Taket",
                    "publishedAt": "2026-11-01T10:00:00.000Z"
                  }
                }
              }
            }
          }
        }
      },
      "GetPost404": {
        "description": "No published post with that slug.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Inlägget hittades inte."
                }
              }
            }
          }
        }
      },
      "ListCollections200": {
        "description": "Collections.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CollectionList"
            },
            "examples": {
              "default": {
                "value": {
                  "collections": [
                    {
                      "key": "team",
                      "label": "Team",
                      "singular": "Medarbetare",
                      "description": null,
                      "titleField": "namn",
                      "slug": true,
                      "sortable": true,
                      "fields": [
                        {
                          "key": "namn",
                          "type": "text",
                          "label": "Namn",
                          "help": null,
                          "required": true
                        },
                        {
                          "key": "bio",
                          "type": "richtext",
                          "label": "Om mig",
                          "help": null,
                          "required": false
                        },
                        {
                          "key": "roll",
                          "type": "select",
                          "label": "Roll",
                          "help": null,
                          "required": false,
                          "options": [
                            {
                              "label": "Snickare",
                              "value": "snickare"
                            },
                            {
                              "label": "Elektriker",
                              "value": "el"
                            }
                          ]
                        },
                        {
                          "key": "bild",
                          "type": "image",
                          "label": "Porträtt",
                          "help": null,
                          "required": false
                        },
                        {
                          "key": "timpris",
                          "type": "number",
                          "label": "Timpris",
                          "help": null,
                          "required": false
                        },
                        {
                          "key": "aktiv",
                          "type": "boolean",
                          "label": "Aktiv",
                          "help": null,
                          "required": false
                        }
                      ],
                      "entryCount": 2
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "ListEntries200": {
        "description": "Entries.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EntryList"
            },
            "examples": {
              "default": {
                "value": {
                  "collection": {
                    "key": "team",
                    "label": "Team",
                    "singular": "Medarbetare",
                    "description": null,
                    "titleField": "namn",
                    "slug": true,
                    "sortable": true,
                    "fields": [
                      {
                        "key": "namn",
                        "type": "text",
                        "label": "Namn",
                        "help": null,
                        "required": true
                      },
                      {
                        "key": "bio",
                        "type": "richtext",
                        "label": "Om mig",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "roll",
                        "type": "select",
                        "label": "Roll",
                        "help": null,
                        "required": false,
                        "options": [
                          {
                            "label": "Snickare",
                            "value": "snickare"
                          },
                          {
                            "label": "Elektriker",
                            "value": "el"
                          }
                        ]
                      },
                      {
                        "key": "bild",
                        "type": "image",
                        "label": "Porträtt",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "timpris",
                        "type": "number",
                        "label": "Timpris",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "aktiv",
                        "type": "boolean",
                        "label": "Aktiv",
                        "help": null,
                        "required": false
                      }
                    ]
                  },
                  "entries": [
                    {
                      "id": "6f3c1a52-1111-4c8e-9a00-000000000001",
                      "slug": "anna",
                      "title": "Anna",
                      "sortOrder": 0,
                      "publishedAt": "2026-11-02T08:00:00.000Z",
                      "updatedAt": "2026-11-02T08:00:00.000Z",
                      "data": {
                        "namn": "Anna",
                        "bio": {
                          "value": "Bygger **tak**.",
                          "html": "<p>Bygger <strong>tak</strong>.</p>"
                        },
                        "roll": "snickare",
                        "bild": {
                          "value": "https://bilder.example.se/anna.jpg",
                          "alt": "Anna på taket"
                        },
                        "timpris": 650,
                        "aktiv": true
                      }
                    },
                    {
                      "id": "6f3c1a52-1111-4c8e-9a00-000000000002",
                      "slug": "bo",
                      "title": "Bo",
                      "sortOrder": 1,
                      "publishedAt": "2026-11-02T08:00:00.000Z",
                      "updatedAt": "2026-11-02T08:00:00.000Z",
                      "data": {
                        "namn": "Bo",
                        "bio": null,
                        "roll": "el",
                        "bild": null,
                        "timpris": null,
                        "aktiv": false
                      }
                    }
                  ],
                  "total": 2,
                  "limit": 100,
                  "offset": 0
                }
              }
            }
          }
        }
      },
      "ListEntries400": {
        "description": "Invalid `limit`/`offset`, or unknown language.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "$ref": "#/components/schemas/LocaleError"
                }
              ]
            },
            "examples": {
              "limit": {
                "value": {
                  "error": "limit måste vara ett heltal mellan 1 och 200."
                }
              },
              "locale": {
                "value": {
                  "error": "Språket \"de\" finns inte på sajten. Sajtens språk: sv, en.",
                  "code": "locale_unknown"
                }
              }
            }
          }
        }
      },
      "ListEntries404": {
        "description": "Unknown collection.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Samlingen \"saknas\" hittades inte."
                }
              }
            }
          }
        }
      },
      "GetEntry200": {
        "description": "The entry.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EntryResponse"
            },
            "examples": {
              "default": {
                "summary": "Without ?locale",
                "value": {
                  "collection": {
                    "key": "team",
                    "label": "Team",
                    "singular": "Medarbetare",
                    "description": null,
                    "titleField": "namn",
                    "slug": true,
                    "sortable": true,
                    "fields": [
                      {
                        "key": "namn",
                        "type": "text",
                        "label": "Namn",
                        "help": null,
                        "required": true
                      },
                      {
                        "key": "bio",
                        "type": "richtext",
                        "label": "Om mig",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "roll",
                        "type": "select",
                        "label": "Roll",
                        "help": null,
                        "required": false,
                        "options": [
                          {
                            "label": "Snickare",
                            "value": "snickare"
                          },
                          {
                            "label": "Elektriker",
                            "value": "el"
                          }
                        ]
                      },
                      {
                        "key": "bild",
                        "type": "image",
                        "label": "Porträtt",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "timpris",
                        "type": "number",
                        "label": "Timpris",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "aktiv",
                        "type": "boolean",
                        "label": "Aktiv",
                        "help": null,
                        "required": false
                      }
                    ]
                  },
                  "entry": {
                    "id": "6f3c1a52-1111-4c8e-9a00-000000000001",
                    "slug": "anna",
                    "title": "Anna",
                    "sortOrder": 0,
                    "publishedAt": "2026-11-02T08:00:00.000Z",
                    "updatedAt": "2026-11-02T08:00:00.000Z",
                    "data": {
                      "namn": "Anna",
                      "bio": {
                        "value": "Bygger **tak**.",
                        "html": "<p>Bygger <strong>tak</strong>.</p>"
                      },
                      "roll": "snickare",
                      "bild": {
                        "value": "https://bilder.example.se/anna.jpg",
                        "alt": "Anna på taket"
                      },
                      "timpris": 650,
                      "aktiv": true
                    }
                  }
                }
              },
              "en": {
                "summary": "?locale=en",
                "value": {
                  "collection": {
                    "key": "team",
                    "label": "Team",
                    "singular": "Medarbetare",
                    "description": null,
                    "titleField": "namn",
                    "slug": true,
                    "sortable": true,
                    "fields": [
                      {
                        "key": "namn",
                        "type": "text",
                        "label": "Namn",
                        "help": null,
                        "required": true
                      },
                      {
                        "key": "bio",
                        "type": "richtext",
                        "label": "Om mig",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "roll",
                        "type": "select",
                        "label": "Roll",
                        "help": null,
                        "required": false,
                        "options": [
                          {
                            "label": "Snickare",
                            "value": "snickare"
                          },
                          {
                            "label": "Elektriker",
                            "value": "el"
                          }
                        ]
                      },
                      {
                        "key": "bild",
                        "type": "image",
                        "label": "Porträtt",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "timpris",
                        "type": "number",
                        "label": "Timpris",
                        "help": null,
                        "required": false
                      },
                      {
                        "key": "aktiv",
                        "type": "boolean",
                        "label": "Aktiv",
                        "help": null,
                        "required": false
                      }
                    ]
                  },
                  "entry": {
                    "id": "6f3c1a52-1111-4c8e-9a00-000000000001",
                    "slug": "anna",
                    "title": "Anna (EN)",
                    "sortOrder": 0,
                    "publishedAt": "2026-11-02T08:00:00.000Z",
                    "updatedAt": "2026-11-02T08:00:00.000Z",
                    "data": {
                      "namn": "Anna (EN)",
                      "bio": {
                        "value": "Builds **roofs**.",
                        "html": "<p>Builds <strong>roofs</strong>.</p>"
                      },
                      "roll": "snickare",
                      "bild": {
                        "value": "https://bilder.example.se/anna.jpg",
                        "alt": "Anna på taket"
                      },
                      "timpris": 650,
                      "aktiv": true
                    },
                    "fallback": false,
                    "fallbackFields": []
                  },
                  "locale": "en",
                  "locales": [
                    "sv",
                    "en"
                  ],
                  "defaultLocale": "sv"
                }
              }
            }
          }
        }
      },
      "GetEntry404": {
        "description": "Unknown collection, or no published entry.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "collection": {
                "value": {
                  "error": "Samlingen \"saknas\" hittades inte."
                }
              },
              "entry": {
                "value": {
                  "error": "Posten hittades inte."
                }
              }
            }
          }
        }
      },
      "GetSchema200": {
        "description": "The current structure.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CurrentSchema"
            },
            "examples": {
              "default": {
                "value": {
                  "version": 1,
                  "pages": [
                    {
                      "slug": "om-oss",
                      "title": "Om oss",
                      "description": null,
                      "blocks": [
                        {
                          "key": "intro.title",
                          "type": "text",
                          "label": "Rubrik",
                          "help": null,
                          "hasValue": true
                        }
                      ]
                    }
                  ],
                  "lastSchemaSyncAt": "2026-12-01T09:14:03.000Z",
                  "collections": [
                    {
                      "key": "medarbetare",
                      "label": "Medarbetare",
                      "singular": "Medarbetare",
                      "description": "Visas på /om-oss",
                      "titleField": "namn",
                      "slug": true,
                      "sortable": true,
                      "fields": [
                        {
                          "key": "namn",
                          "help": null,
                          "type": "text",
                          "label": "Namn",
                          "required": true,
                          "maxLength": 80,
                          "multiline": false
                        }
                      ],
                      "entryCount": 3
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "SyncSchema200": {
        "description": "Synced (or, for a locked account, not synced but still 200).",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SchemaSyncReport"
                },
                {
                  "$ref": "#/components/schemas/SchemaSyncLocked"
                }
              ]
            },
            "examples": {
              "default": {
                "value": {
                  "ok": true,
                  "created": {
                    "pages": 0,
                    "blocks": 1
                  },
                  "updated": {
                    "pages": 1,
                    "blocks": 0
                  },
                  "orphans": [
                    {
                      "pageSlug": "om-oss",
                      "key": "gammal.rubrik"
                    }
                  ],
                  "orphanPages": [],
                  "pruned": {
                    "pages": 0,
                    "blocks": 0
                  },
                  "syncedAt": "2026-12-01T09:14:03.000Z",
                  "collections": {
                    "created": 1,
                    "updated": 0,
                    "pruned": {
                      "collections": 0,
                      "fields": 0
                    },
                    "orphans": [],
                    "orphanCollections": []
                  },
                  "revalidateUrl": "https://jjbygg.se/api/sitecms/revalidate"
                }
              }
            }
          }
        }
      },
      "SyncSchema400": {
        "description": "The declaration is invalid, or the body is not JSON.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SchemaInvalid"
                },
                {
                  "$ref": "#/components/schemas/Error"
                }
              ]
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Schemat är ogiltigt.",
                  "issues": [
                    "pages[0].blocks[1].type: \"video\" stöds inte – använd text, richtext, image."
                  ]
                }
              }
            }
          }
        }
      },
      "SyncSchema404": {
        "description": "The site was removed during the sync.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "SyncSchema409": {
        "description": "Another sync for the site was running. Try again.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "En annan schema-sync för sajten pågick samtidigt. Försök igen."
                }
              }
            }
          }
        }
      },
      "SyncSchema413": {
        "description": "The body is larger than 2 MB.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "SyncSchema500": {
        "description": "Could not save. Nothing was changed.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Kunde inte spara strukturen. Inget ändrades – försök igen."
                }
              }
            }
          }
        }
      },
      "GetHealth200": {
        "description": "The key works.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Health"
            },
            "examples": {
              "default": {
                "value": {
                  "ok": true,
                  "site": {
                    "name": "JJ Bygg",
                    "slug": "jjbygg"
                  },
                  "pages": 4,
                  "lastSchemaSyncAt": "2026-10-18T09:14:03.000Z",
                  "revalidateUrl": "https://jjbygg.se/api/sitecms/revalidate",
                  "webhook": {
                    "configured": true,
                    "lastStatus": "ok",
                    "lastAt": "2026-10-20T14:02:11.000Z",
                    "lastError": null
                  }
                }
              }
            }
          }
        }
      },
      "VerifyPreview200": {
        "description": "The token is valid.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PreviewSession"
            },
            "examples": {
              "default": {
                "value": {
                  "ok": true,
                  "expiresAt": "2026-10-21T16:42:00.000Z",
                  "panelOrigin": "https://sitecms.se"
                }
              }
            }
          }
        }
      },
      "VerifyPreview401": {
        "description": "Missing or wrong key, or an invalid preview token.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "$ref": "#/components/schemas/PreviewInvalid"
                }
              ]
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Förhandsgranskningen har gått ut. Öppna den igen i sitecms.",
                  "code": "preview_invalid"
                }
              }
            }
          }
        }
      },
      "RecordPageviews204": {
        "description": "Recorded (also when everything was filtered out).",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        }
      },
      "RecordPageviews400": {
        "description": "Invalid body.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "events måste vara en lista med minst ett event."
                }
              }
            }
          }
        }
      },
      "RecordPageviews413": {
        "description": "The body is larger than 4 kB.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RecordPageviews429": {
        "description": "More than 600 events per minute for the site.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CreateQuoteRequest201": {
        "description": "Stored. `emailStatus` says whether the e-mails went out; the request is stored either way.",
        "headers": {
          "Cache-Control": {
            "description": "no-store",
            "schema": {
              "type": "string",
              "example": "no-store"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/QuoteRequestCreated"
            },
            "examples": {
              "default": {
                "value": {
                  "id": "7c1a2f0e-5b1d-4c62-9a8e-2f1d3c4b5a69",
                  "emailStatus": "sent"
                }
              }
            }
          }
        }
      },
      "CreateQuoteRequest400": {
        "description": "Invalid JSON or invalid fields.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/QuoteValidationError"
                },
                {
                  "$ref": "#/components/schemas/Error"
                }
              ]
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Valideringsfel.",
                  "fields": {
                    "phone": "Ange ett svenskt telefonnummer, t.ex. 070-123 45 67.",
                    "consent": "Du behöver godkänna att vi behandlar dina uppgifter."
                  }
                }
              }
            }
          }
        }
      },
      "CreateQuoteRequest429": {
        "description": "Too many requests from the same `ipHash`. The Swedish message can be shown to the visitor.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "För många förfrågningar från samma adress. Försök igen om en stund eller ring oss."
                }
              }
            }
          }
        }
      },
      "UploadQuoteAttachment201": {
        "description": "Uploaded.",
        "headers": {
          "Cache-Control": {
            "description": "no-store",
            "schema": {
              "type": "string",
              "example": "no-store"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/QuoteAttachment"
            },
            "examples": {
              "default": {
                "value": {
                  "url": "https://example.public.blob.vercel-storage.com/quotes/tomt.jpg",
                  "name": "tomt.jpg",
                  "contentType": "image/jpeg",
                  "size": 182331
                }
              }
            }
          }
        }
      },
      "UploadQuoteAttachment400": {
        "description": "Missing, empty or unsupported file, or a type that does not match the content.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "default": {
                "value": {
                  "error": "Filtypen stöds inte. Använd JPG, PNG, WEBP, HEIC eller PDF."
                }
              }
            }
          }
        }
      },
      "UploadQuoteAttachment413": {
        "description": "The file is larger than 10 MB.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UploadQuoteAttachment429": {
        "description": "Too many uploads.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UploadQuoteAttachment500": {
        "description": "The upload failed.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UploadQuoteAttachment503": {
        "description": "Attachments are not configured on the server.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Description of the error, in Swedish."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "description": "Generic error. `error` is a Swedish message that can be logged or, for 429 on quote requests, shown to the visitor."
      },
      "LocaleError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Swedish message that lists the site's languages."
          },
          "code": {
            "type": "string",
            "const": "locale_unknown"
          }
        },
        "required": [
          "error",
          "code"
        ],
        "additionalProperties": false,
        "description": "`?locale=` is not a valid language code or a language the site does not have."
      },
      "PreviewInvalid": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "const": "preview_invalid"
          }
        },
        "required": [
          "error",
          "code"
        ],
        "additionalProperties": false,
        "description": "The `x-sitecms-preview` token is wrong, expired or belongs to another site. Show normal content instead."
      },
      "SchemaInvalid": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One Swedish line per problem, with the JSON path."
          }
        },
        "required": [
          "error",
          "issues"
        ],
        "additionalProperties": false
      },
      "QuoteValidationError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "const": "Valideringsfel."
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Field name → Swedish message."
          }
        },
        "required": [
          "error",
          "fields"
        ],
        "additionalProperties": false
      },
      "Site": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "domain"
        ],
        "additionalProperties": false
      },
      "Block": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Field key, e.g. `hero.title`."
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "richtext",
              "image"
            ]
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Text, Markdown (richtext) or image URL."
          },
          "alt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Image description (image blocks), otherwise null."
          },
          "html": {
            "type": [
              "string",
              "null"
            ],
            "description": "`value` rendered from Markdown (richtext blocks), otherwise null."
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "help": {
            "type": [
              "string",
              "null"
            ]
          },
          "fallback": {
            "type": "boolean",
            "description": "Only with `?locale=` for a non-default language: true when at least one field fell back to the default language."
          }
        },
        "required": [
          "key",
          "type",
          "value",
          "alt",
          "html",
          "label",
          "help"
        ],
        "additionalProperties": false
      },
      "Page": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Block"
            }
          }
        },
        "required": [
          "slug",
          "title",
          "description",
          "blocks"
        ],
        "additionalProperties": false
      },
      "Service": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "string",
              "null"
            ]
          },
          "fallback": {
            "type": "boolean",
            "description": "Only with `?locale=` for a non-default language: true when at least one field fell back to the default language."
          },
          "fallbackFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only with `?locale=` for a non-default language: the fields that fell back to the default language."
          }
        },
        "required": [
          "title",
          "description",
          "price"
        ],
        "additionalProperties": false
      },
      "Seo": {
        "type": "object",
        "properties": {
          "pageSlug": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "ogImage": {
            "type": [
              "string",
              "null"
            ]
          },
          "fallback": {
            "type": "boolean",
            "description": "Only with `?locale=` for a non-default language: true when at least one field fell back to the default language."
          },
          "fallbackFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only with `?locale=` for a non-default language: the fields that fell back to the default language."
          }
        },
        "required": [
          "pageSlug",
          "title",
          "description",
          "ogImage"
        ],
        "additionalProperties": false
      },
      "Content": {
        "type": "object",
        "properties": {
          "site": {
            "$ref": "#/components/schemas/Site"
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Page"
            }
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "description": "Visible services in order."
          },
          "seo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Seo"
            }
          },
          "preview": {
            "type": "boolean",
            "const": true,
            "description": "Only present in live preview (`x-sitecms-preview`)."
          },
          "locale": {
            "type": "string",
            "description": "The language of the response. Only present when `?locale=` was sent."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All languages of the site. Only with `?locale=`."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The site's default language. Only with `?locale=`."
          }
        },
        "required": [
          "site",
          "pages",
          "services",
          "seo"
        ],
        "additionalProperties": false
      },
      "PostSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverImage": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverImageAlt": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "fallback": {
            "type": "boolean",
            "description": "Only with `?locale=` for a non-default language: true when at least one field fell back to the default language."
          },
          "fallbackFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only with `?locale=` for a non-default language: the fields that fell back to the default language."
          }
        },
        "required": [
          "slug",
          "title",
          "excerpt",
          "coverImage",
          "coverImageAlt",
          "publishedAt"
        ],
        "additionalProperties": false
      },
      "Post": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "Markdown."
          },
          "bodyHtml": {
            "type": [
              "string",
              "null"
            ],
            "description": "`body` rendered as HTML."
          },
          "coverImage": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverImageAlt": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "fallback": {
            "type": "boolean",
            "description": "Only with `?locale=` for a non-default language: true when at least one field fell back to the default language."
          },
          "fallbackFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only with `?locale=` for a non-default language: the fields that fell back to the default language."
          }
        },
        "required": [
          "slug",
          "title",
          "excerpt",
          "body",
          "bodyHtml",
          "coverImage",
          "coverImageAlt",
          "publishedAt"
        ],
        "additionalProperties": false
      },
      "PostList": {
        "type": "object",
        "properties": {
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostSummary"
            }
          },
          "locale": {
            "type": "string",
            "description": "The language of the response. Only present when `?locale=` was sent."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All languages of the site. Only with `?locale=`."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The site's default language. Only with `?locale=`."
          }
        },
        "required": [
          "posts"
        ],
        "additionalProperties": false
      },
      "PostResponse": {
        "type": "object",
        "properties": {
          "post": {
            "$ref": "#/components/schemas/Post"
          },
          "locale": {
            "type": "string",
            "description": "The language of the response. Only present when `?locale=` was sent."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All languages of the site. Only with `?locale=`."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The site's default language. Only with `?locale=`."
          }
        },
        "required": [
          "post"
        ],
        "additionalProperties": false
      },
      "SelectOption": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "label"
        ],
        "additionalProperties": false
      },
      "CollectionField": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "richtext",
              "image",
              "number",
              "boolean",
              "date",
              "select",
              "url"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "help": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SelectOption"
            },
            "description": "Only for `select` fields."
          }
        },
        "required": [
          "key",
          "type",
          "label",
          "help",
          "required"
        ],
        "additionalProperties": false
      },
      "Collection": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "singular": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "titleField": {
            "type": "string"
          },
          "slug": {
            "type": "boolean",
            "description": "Entries have a slug."
          },
          "sortable": {
            "type": "boolean",
            "description": "Entries are ordered manually in the panel."
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollectionField"
            }
          }
        },
        "required": [
          "key",
          "label",
          "singular",
          "description",
          "titleField",
          "slug",
          "sortable",
          "fields"
        ],
        "additionalProperties": false
      },
      "CollectionSummary": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "singular": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "titleField": {
            "type": "string"
          },
          "slug": {
            "type": "boolean"
          },
          "sortable": {
            "type": "boolean"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollectionField"
            }
          },
          "entryCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of published entries."
          }
        },
        "required": [
          "key",
          "label",
          "singular",
          "description",
          "titleField",
          "slug",
          "sortable",
          "fields",
          "entryCount"
        ],
        "additionalProperties": false
      },
      "FieldValue": {
        "description": "A field value: string (text, date, select, url), number, boolean, `{ value, html }` (richtext), `{ value, alt }` (image) or null when empty.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "html": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "html"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "alt": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "value",
              "alt"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Entry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer"
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/FieldValue"
            },
            "description": "Field key → value. Every visible field is present."
          },
          "fallback": {
            "type": "boolean",
            "description": "Only with `?locale=` for a non-default language: true when at least one field fell back to the default language."
          },
          "fallbackFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only with `?locale=` for a non-default language: the fields that fell back to the default language."
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "sortOrder",
          "publishedAt",
          "updatedAt",
          "data"
        ],
        "additionalProperties": false
      },
      "CollectionList": {
        "type": "object",
        "properties": {
          "collections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollectionSummary"
            }
          },
          "locale": {
            "type": "string",
            "description": "The language of the response. Only present when `?locale=` was sent."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All languages of the site. Only with `?locale=`."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The site's default language. Only with `?locale=`."
          }
        },
        "required": [
          "collections"
        ],
        "additionalProperties": false
      },
      "EntryList": {
        "type": "object",
        "properties": {
          "collection": {
            "$ref": "#/components/schemas/Collection"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Entry"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "locale": {
            "type": "string",
            "description": "The language of the response. Only present when `?locale=` was sent."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All languages of the site. Only with `?locale=`."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The site's default language. Only with `?locale=`."
          }
        },
        "required": [
          "collection",
          "entries",
          "total",
          "limit",
          "offset"
        ],
        "additionalProperties": false
      },
      "EntryResponse": {
        "type": "object",
        "properties": {
          "collection": {
            "$ref": "#/components/schemas/Collection"
          },
          "entry": {
            "$ref": "#/components/schemas/Entry"
          },
          "locale": {
            "type": "string",
            "description": "The language of the response. Only present when `?locale=` was sent."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All languages of the site. Only with `?locale=`."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The site's default language. Only with `?locale=`."
          }
        },
        "required": [
          "collection",
          "entry"
        ],
        "additionalProperties": false
      },
      "SchemaBlockDeclaration": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$",
            "maxLength": 100
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "richtext",
              "image"
            ],
            "default": "text"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "help": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "default": {
            "type": [
              "string",
              "null"
            ],
            "description": "Initial value for new or empty fields. Never overwrites content."
          },
          "defaultAlt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          }
        },
        "required": [
          "key"
        ]
      },
      "SchemaPageDeclaration": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]*$",
            "maxLength": 100
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SchemaBlockDeclaration"
            },
            "maxItems": 200
          }
        },
        "required": [
          "slug",
          "title"
        ]
      },
      "CollectionFieldDeclaration": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$",
            "maxLength": 64
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "richtext",
              "image",
              "number",
              "boolean",
              "date",
              "select",
              "url"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "help": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "description": "`select`: allowed values, as strings or `{ value, label }`.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/SelectOption"
                }
              ]
            }
          },
          "min": {
            "type": [
              "number",
              "null"
            ]
          },
          "max": {
            "type": [
              "number",
              "null"
            ]
          },
          "integer": {
            "type": "boolean"
          },
          "maxLength": {
            "type": [
              "integer",
              "null"
            ]
          },
          "multiline": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "type"
        ]
      },
      "CollectionDeclaration": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]*$",
            "maxLength": 64
          },
          "label": {
            "type": "string"
          },
          "singular": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "titleField": {
            "type": "string",
            "description": "A `text` field that is the entry's title."
          },
          "slug": {
            "type": "boolean"
          },
          "sortable": {
            "type": "boolean"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollectionFieldDeclaration"
            },
            "maxItems": 30
          }
        },
        "required": [
          "key",
          "label",
          "titleField",
          "fields"
        ]
      },
      "SchemaDeclaration": {
        "type": "object",
        "description": "The site's pages and fields (version 1), plus custom content types (version 2). Unknown top-level fields are ignored.",
        "properties": {
          "version": {
            "type": "integer",
            "enum": [
              1,
              2
            ],
            "default": 1
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SchemaPageDeclaration"
            },
            "maxItems": 100
          },
          "prune": {
            "type": "boolean",
            "default": false,
            "description": "Remove pages and fields that are not declared."
          },
          "collections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollectionDeclaration"
            },
            "maxItems": 20
          },
          "siteUrl": {
            "type": "string",
            "description": "Optional public https address of the site. Sets the revalidate URL if the site has none."
          }
        },
        "required": [
          "pages"
        ]
      },
      "CurrentSchemaField": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "richtext",
              "image",
              "number",
              "boolean",
              "date",
              "select",
              "url"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "help": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SelectOption"
            }
          },
          "min": {
            "type": [
              "number",
              "null"
            ]
          },
          "max": {
            "type": [
              "number",
              "null"
            ]
          },
          "integer": {
            "type": "boolean"
          },
          "maxLength": {
            "type": [
              "integer",
              "null"
            ]
          },
          "multiline": {
            "type": "boolean"
          },
          "hidden": {
            "type": "boolean",
            "description": "The field is no longer declared; its data is kept."
          }
        },
        "required": [
          "key",
          "type",
          "label",
          "help",
          "required"
        ],
        "additionalProperties": false
      },
      "CurrentSchema": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "blocks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "text",
                          "richtext",
                          "image"
                        ]
                      },
                      "label": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "help": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "hasValue": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "key",
                      "type",
                      "label",
                      "help",
                      "hasValue"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "slug",
                "title",
                "description",
                "blocks"
              ],
              "additionalProperties": false
            }
          },
          "lastSchemaSyncAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "collections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "singular": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "titleField": {
                  "type": "string"
                },
                "slug": {
                  "type": "boolean"
                },
                "sortable": {
                  "type": "boolean"
                },
                "fields": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CurrentSchemaField"
                  }
                },
                "entryCount": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "key",
                "label",
                "singular",
                "description",
                "titleField",
                "slug",
                "sortable",
                "fields",
                "entryCount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "pages",
          "lastSchemaSyncAt",
          "collections"
        ],
        "additionalProperties": false
      },
      "Counts": {
        "type": "object",
        "properties": {
          "pages": {
            "type": "integer"
          },
          "blocks": {
            "type": "integer"
          }
        },
        "required": [
          "pages",
          "blocks"
        ],
        "additionalProperties": false
      },
      "CollectionSyncReport": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "pruned": {
            "type": "object",
            "properties": {
              "collections": {
                "type": "integer"
              },
              "fields": {
                "type": "integer"
              }
            },
            "required": [
              "collections",
              "fields"
            ],
            "additionalProperties": false
          },
          "orphans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "collection": {
                  "type": "string"
                },
                "field": {
                  "type": "string"
                }
              },
              "required": [
                "collection",
                "field"
              ],
              "additionalProperties": false
            }
          },
          "orphanCollections": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "created",
          "updated",
          "pruned",
          "orphans",
          "orphanCollections"
        ],
        "additionalProperties": false
      },
      "SchemaSyncReport": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "created": {
            "$ref": "#/components/schemas/Counts"
          },
          "updated": {
            "$ref": "#/components/schemas/Counts"
          },
          "orphans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pageSlug": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                }
              },
              "required": [
                "pageSlug",
                "key"
              ],
              "additionalProperties": false
            }
          },
          "orphanPages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pruned": {
            "$ref": "#/components/schemas/Counts"
          },
          "syncedAt": {
            "type": "string",
            "format": "date-time"
          },
          "collections": {
            "$ref": "#/components/schemas/CollectionSyncReport"
          },
          "revalidateUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The site's revalidate URL, masked unless it is the standard path."
          }
        },
        "required": [
          "ok",
          "created",
          "updated",
          "orphans",
          "orphanPages",
          "pruned",
          "syncedAt",
          "revalidateUrl"
        ],
        "additionalProperties": false
      },
      "SchemaSyncLocked": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "locked": {
            "type": "boolean",
            "const": true
          },
          "message": {
            "type": "string"
          },
          "created": {
            "$ref": "#/components/schemas/Counts"
          },
          "updated": {
            "$ref": "#/components/schemas/Counts"
          },
          "pruned": {
            "$ref": "#/components/schemas/Counts"
          },
          "orphans": {
            "type": "array",
            "maxItems": 0
          },
          "collections": {
            "$ref": "#/components/schemas/CollectionSyncReport"
          }
        },
        "required": [
          "ok",
          "locked",
          "message",
          "created",
          "updated",
          "pruned",
          "orphans"
        ],
        "additionalProperties": false,
        "description": "The account that owns the site has no active subscription: nothing was synced, but the response is 200 so the site's build does not fail."
      },
      "Health": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "site": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "slug"
            ],
            "additionalProperties": false
          },
          "pages": {
            "type": "integer",
            "minimum": 0
          },
          "lastSchemaSyncAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revalidateUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Masked: a deploy hook is shown as `<origin>/••••`."
          },
          "webhook": {
            "type": "object",
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "lastStatus": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "ok",
                  "failed",
                  null
                ]
              },
              "lastAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "lastError": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "configured",
              "lastStatus",
              "lastAt",
              "lastError"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ok",
          "site",
          "pages",
          "lastSchemaSyncAt",
          "revalidateUrl",
          "webhook"
        ],
        "additionalProperties": false
      },
      "PreviewSession": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "panelOrigin": {
            "type": "string",
            "description": "The origin the site should accept postMessage from."
          }
        },
        "required": [
          "ok",
          "expiresAt",
          "panelOrigin"
        ],
        "additionalProperties": false
      },
      "PageviewEvents": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "properties": {
                "p": {
                  "type": "string",
                  "description": "Path, at most 2048 characters.",
                  "minLength": 1,
                  "maxLength": 2048
                },
                "r": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Referrer."
                },
                "q": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Query string (utm_*)."
                },
                "ua": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "User agent. Used for bot filtering and the daily visitor hash, never stored."
                },
                "ip": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Visitor IP. Only used for the daily visitor hash, never stored."
                },
                "c": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Country code, e.g. from x-vercel-ip-country."
                },
                "t": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Client time in ms. Ignored: the day is the server's UTC day."
                }
              },
              "required": [
                "p"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "events"
        ],
        "additionalProperties": false
      },
      "QuoteAttachment": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "https URL from the upload endpoint.",
            "maxLength": 2048
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "contentType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "url",
          "name",
          "contentType",
          "size"
        ],
        "additionalProperties": false
      },
      "QuoteRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "phone": {
            "type": "string",
            "description": "A Swedish phone number."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          },
          "jobType": {
            "type": "string",
            "maxLength": 100
          },
          "machine": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "desiredStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "YYYY-MM-DD, not in the past."
          },
          "description": {
            "type": "string",
            "minLength": 10,
            "maxLength": 3000
          },
          "consent": {
            "description": "Must be true (or \"true\"/\"on\").",
            "anyOf": [
              {
                "type": "boolean",
                "const": true
              },
              {
                "type": "string",
                "enum": [
                  "true",
                  "on"
                ]
              }
            ]
          },
          "customerType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "privat",
              "foretag",
              null
            ]
          },
          "budget": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "rot": {
            "type": [
              "boolean",
              "string",
              "null"
            ],
            "description": "ROT deduction. Booleans or the usual form spellings."
          },
          "postalCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "attachments": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/QuoteAttachment"
            }
          },
          "extra": {
            "type": [
              "object",
              "null"
            ],
            "maxProperties": 20,
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            }
          },
          "ipHash": {
            "type": "string",
            "description": "Salted hash of the visitor's IP (hex, 16–128 characters). Enables the rate limit per sender.",
            "pattern": "^[a-f0-9]{16,128}$"
          }
        },
        "required": [
          "name",
          "phone",
          "email",
          "jobType",
          "description",
          "consent"
        ]
      },
      "QuoteRequestCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "emailStatus": {
            "type": "string",
            "enum": [
              "sent",
              "failed",
              "skipped"
            ]
          }
        },
        "required": [
          "id",
          "emailStatus"
        ],
        "additionalProperties": false
      }
    },
    "requestBodies": {
      "SyncSchemaBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SchemaDeclaration"
            },
            "examples": {
              "default": {
                "value": {
                  "version": 1,
                  "pages": [
                    {
                      "slug": "home",
                      "title": "Startsida",
                      "description": "Det besökaren ser först.",
                      "blocks": [
                        {
                          "key": "hero.title",
                          "type": "text",
                          "label": "Rubrik",
                          "help": "Max 60 tecken",
                          "default": "Välkommen"
                        },
                        {
                          "key": "intro.body",
                          "type": "richtext",
                          "label": "Ingress"
                        }
                      ]
                    }
                  ],
                  "prune": false
                }
              }
            }
          }
        }
      },
      "RecordPageviewsBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PageviewEvents"
            },
            "examples": {
              "default": {
                "value": {
                  "events": [
                    {
                      "p": "/tjanster",
                      "r": "https://www.google.com/",
                      "ua": "Mozilla/5.0 …",
                      "ip": "203.0.113.7",
                      "c": "SE"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "CreateQuoteRequestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/QuoteRequest"
            },
            "examples": {
              "default": {
                "value": {
                  "name": "Anna Andersson",
                  "company": null,
                  "phone": "070-123 45 67",
                  "email": "anna@example.se",
                  "jobType": "Takbyte",
                  "machine": null,
                  "location": "Luleå",
                  "desiredStart": "2026-11-15",
                  "description": "Byta tak på villa, ca 120 kvm. Befintligt tegeltak från 1978.",
                  "consent": true,
                  "customerType": "privat",
                  "budget": "100 000–200 000 kr",
                  "rot": true,
                  "postalCode": "972 31",
                  "source": "referrer=https://www.google.com/ sida=/offert utm_source=google",
                  "attachments": [
                    {
                      "url": "https://example.public.blob.vercel-storage.com/quotes/tomt.jpg",
                      "name": "tomt.jpg",
                      "contentType": "image/jpeg",
                      "size": 182331
                    }
                  ],
                  "extra": {
                    "takyta": "120 kvm",
                    "antal-vaningar": "2"
                  },
                  "ipHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
                }
              }
            }
          }
        }
      },
      "UploadQuoteAttachmentBody": {
        "required": true,
        "content": {
          "multipart/form-data": {
            "schema": {
              "type": "object",
              "properties": {
                "file": {
                  "type": "string",
                  "format": "binary"
                },
                "ipHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{16,128}$"
                }
              },
              "required": [
                "file"
              ]
            }
          }
        }
      }
    }
  }
}
