{
  "openapi": "3.1.0",
  "info": {
    "title": "Plety public API",
    "version": "1.0.0",
    "description": "Read-only access to the public pages of the Plety website (Plety Limited, UK company 17598186). No key, no sign-in, GET only. Versioned in the path (/api/v1); a breaking change would ship as /api/v2, with v1 kept for at least 6 months and a Deprecation header announced on v1 first. Errors share one shape: { error: { code, message, hint, docs } }. Also available as an MCP server at https://plety-desk.vercel.app/mcp. Rate limit: up to 120 requests a minute per client, reported on every answer in RateLimit-Policy and RateLimit headers (plus RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset); a 429 answer carries Retry-After. Natural-language search follows NLWeb 0.55 at POST /ask.",
    "contact": {
      "name": "Plety",
      "email": "herman.plety.official@gmail.com",
      "url": "https://plety-desk.vercel.app/about/contact"
    },
    "termsOfService": "https://plety-desk.vercel.app/about/terms"
  },
  "servers": [
    {
      "url": "https://plety-desk.vercel.app/api/v1"
    }
  ],
  "externalDocs": {
    "description": "Plety for AI assistants",
    "url": "https://plety-desk.vercel.app/about/agents"
  },
  "paths": {
    "/search": {
      "get": {
        "operationId": "searchPages",
        "summary": "Search the public pages",
        "description": "Full-text search over every guide, answer and company page. Returns the best matches with a matching passage.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "What to look for, in plain words.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 300
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many results, 1 to 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "markdown_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "section": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "title",
                          "url"
                        ]
                      }
                    }
                  },
                  "required": [
                    "query",
                    "results"
                  ]
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pages": {
      "get": {
        "operationId": "listPages",
        "summary": "List the guide pages",
        "description": "Guide and answer pages, optionally for one section, paginated with an opaque cursor: pass next_cursor from the previous response to get the next page; null means there are no more.",
        "parameters": [
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "A section id from /sections.",
            "schema": {
              "type": "string",
              "enum": [
                "guides",
                "questions",
                "records",
                "situations",
                "market",
                "compliance",
                "insolvency",
                "buyers",
                "industries"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Pages per response, 1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor value from the previous response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "section": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "markdown_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "section": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "updated": {
                            "type": "string",
                            "format": "date"
                          }
                        },
                        "required": [
                          "title",
                          "url"
                        ]
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "pages",
                    "next_cursor"
                  ]
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/page": {
      "get": {
        "operationId": "getPage",
        "summary": "Read one page",
        "description": "One public page as Markdown, with its sources. Pass format=markdown to get text/markdown instead of JSON.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "The page address or path, for example /about/privacy.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or markdown.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "markdown"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "title",
                    "markdown"
                  ]
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sections": {
      "get": {
        "operationId": "listSections",
        "summary": "List the sections",
        "description": "The sections of the site, with their addresses and page counts.",
        "responses": {
          "200": {
            "description": "Sections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "pages": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "url"
                        ]
                      }
                    }
                  },
                  "required": [
                    "sections"
                  ]
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/company": {
      "get": {
        "operationId": "getCompanyFacts",
        "summary": "Company facts",
        "description": "The facts needed to describe Plety accurately.",
        "responses": {
          "200": {
            "description": "Facts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "legal_name": {
                      "type": "string"
                    },
                    "company_number": {
                      "type": "string"
                    },
                    "registered_in": {
                      "type": "string"
                    },
                    "registered_office": {
                      "type": "string"
                    },
                    "incorporated": {
                      "type": "string"
                    },
                    "companies_house": {
                      "type": "string"
                    },
                    "website": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "what_it_does": {
                      "type": "string"
                    },
                    "never_does": {
                      "type": "string"
                    },
                    "works_with": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "record_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "always_excluded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "how_paid": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "contact_email": {
                      "type": "string"
                    },
                    "book_a_call": {
                      "type": "string"
                    },
                    "privacy_notice": {
                      "type": "string"
                    },
                    "pricing": {
                      "type": "string"
                    },
                    "updated": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "legal_name",
                    "company_number"
                  ]
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ask": {
      "servers": [
        {
          "url": "https://plety-desk.vercel.app",
          "description": "NLWeb lives at the site root"
        }
      ],
      "get": {
        "operationId": "askPlety",
        "summary": "Ask in plain words (NLWeb 0.55)",
        "description": "Natural-language search over the public pages, following the NLWeb 0.55 protocol. Read-only and safe to repeat. The NLWeb POST form is also accepted at the same address, with a JSON body {\"query\":{\"text\":\"...\"},\"prefer\":{\"streaming\":false,\"mode\":\"list\"}}; it returns the same answers. mode \"list, summarize\" adds a SearchSummary item first.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "The question, in plain words.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 300
            }
          },
          {
            "name": "streaming",
            "in": "query",
            "required": false,
            "description": "true for Server-Sent Events.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "list, or list, summarize.",
            "schema": {
              "type": "string",
              "default": "list"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An NLWeb answer (or an application-level failure such as NO_RESULTS). With prefer.streaming true, or Accept: text/event-stream, the same content arrives as Server-Sent Events: start, result, complete.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "response_type": {
                          "type": "string",
                          "enum": [
                            "answer",
                            "failure"
                          ]
                        },
                        "response_format": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "response_type",
                        "version"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "A schema.org object for one matching page, or a SearchSummary.",
                        "properties": {
                          "@type": {
                            "type": "string",
                            "enum": [
                              "Article",
                              "WebPage",
                              "SearchSummary"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "description": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "grounding": {
                            "type": "object",
                            "properties": {
                              "source_urls": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uri"
                                }
                              }
                            }
                          }
                        },
                        "required": [
                          "@type"
                        ]
                      }
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "NO_RESULTS",
                            "INVALID_QUERY",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code"
                      ]
                    }
                  },
                  "required": [
                    "_meta"
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "event: start | result | error | complete, each with a JSON data line"
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request: INVALID_QUERY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit": {
                "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Requests allowed per window (120).",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: RATE_LIMITED, with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "PageSummary": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdown_url": {
            "type": "string",
            "format": "uri"
          },
          "section": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "updated": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "title",
          "url"
        ]
      },
      "SearchResults": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "markdown_url": {
                  "type": "string",
                  "format": "uri"
                },
                "section": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                },
                "score": {
                  "type": "number"
                }
              },
              "required": [
                "title",
                "url"
              ]
            }
          }
        },
        "required": [
          "query",
          "results"
        ]
      },
      "Page": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "title",
          "markdown"
        ]
      },
      "CompanyFacts": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "company_number": {
            "type": "string"
          },
          "registered_in": {
            "type": "string"
          },
          "registered_office": {
            "type": "string"
          },
          "incorporated": {
            "type": "string"
          },
          "companies_house": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "what_it_does": {
            "type": "string"
          },
          "never_does": {
            "type": "string"
          },
          "works_with": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "record_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "always_excluded": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "how_paid": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "contact_email": {
            "type": "string"
          },
          "book_a_call": {
            "type": "string"
          },
          "privacy_notice": {
            "type": "string"
          },
          "pricing": {
            "type": "string"
          },
          "updated": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "legal_name",
          "company_number"
        ]
      },
      "NlwebItem": {
        "type": "object",
        "description": "A schema.org object for one matching page, or a SearchSummary.",
        "properties": {
          "@type": {
            "type": "string",
            "enum": [
              "Article",
              "WebPage",
              "SearchSummary"
            ]
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "grounding": {
            "type": "object",
            "properties": {
              "source_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        },
        "required": [
          "@type"
        ]
      },
      "NlwebResponse": {
        "type": "object",
        "properties": {
          "_meta": {
            "type": "object",
            "properties": {
              "response_type": {
                "type": "string",
                "enum": [
                  "answer",
                  "failure"
                ]
              },
              "response_format": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "required": [
              "response_type",
              "version"
            ]
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NlwebItem"
            }
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "NO_RESULTS",
                  "INVALID_QUERY",
                  "RATE_LIMITED",
                  "INTERNAL_ERROR"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code"
            ]
          }
        },
        "required": [
          "_meta"
        ]
      }
    },
    "headers": {
      "RateLimit": {
        "description": "Requests left in the current window and seconds until it resets (IETF RateLimit header), for example \"per-client\";r=119;t=60.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Policy": {
        "description": "The policy: 120 requests per 60 seconds per client, for example \"per-client\";q=120;w=60.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Limit": {
        "description": "Requests allowed per window (120).",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      }
    }
  }
}