{
 "openapi": "3.1.0",
 "info": {
  "title": "BidCount API",
  "version": "1.0.0-preview",
  "summary": "UK public-sector tenders, buyers and bid history, and for Pro the contracts ending, the suppliers that hold them and how each buyer awards. Read-only, Pro.",
  "description": "The facts the BidCount website shows, as JSON. API access is part of Pro: make a key in Settings (https://bidcount.co.uk/settings#api) and send it as Authorization: Bearer <key> (or X-API-Key). Every response carries as_of, its sources, the licence and the caveats; keep the caveats when you show the numbers.\n\nTwo groups of routes. The public data (tenders, coming soon, buyers, sectors, regions, rankings, search, changes) is the same as the public pages. The Pro data (contracts, frameworks, incumbents, buyer-intel) is what a signed-in visitor sees on the website: who holds a contract that is ending, who is on a framework, who a buyer awards to. It is private to the key and never cached.\n\nFull notice text, requirements and links stay on the website. Data is rebuilt once a day. This is a preview: until the label is dropped, expect shape changes with 30 days' notice; clients must ignore fields and enum values they do not know.\n\nCounts: a sector, region or buyer's open_tenders is the count on its page (tenders open for at least 3 more days at build time); /v1/tenders?sector=...&region=... counts the full open list. Regions: some tenders have no stated region, so region counts sum to less than the total. Quotas: each key is limited per minute and per day (Pro: 120 a minute and 20,000 a day); every keyed answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (seconds), and X-RateLimit-Daily-Remaining.",
  "license": {
   "name": "Open Government Licence v3.0 (the data)",
   "url": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
  },
  "contact": {
   "name": "BidCount",
   "url": "https://bidcount.co.uk/about"
  }
 },
 "servers": [
  {
   "url": "https://bidcount.co.uk"
  }
 ],
 "tags": [
  {
   "name": "meta"
  },
  {
   "name": "tenders"
  },
  {
   "name": "coming-soon"
  },
  {
   "name": "buyers"
  },
  {
   "name": "sectors"
  },
  {
   "name": "regions"
  },
  {
   "name": "search"
  },
  {
   "name": "changes"
  },
  {
   "name": "rankings"
  },
  {
   "name": "pro-data",
   "description": "The locked layer the signed-in website shows: who holds each ending contract, who is on each framework, who a buyer awards to. Pro keys only."
  },
  {
   "name": "account",
   "description": "The account behind the key: profile, digest, votes."
  },
  {
   "name": "radar",
   "description": "The paid tier's tender radar: profile, ranking, rules, alerts."
  },
  {
   "name": "webhooks",
   "description": "Signed events pushed to your own https endpoints."
  }
 ],
 "paths": {
  "/v1": {
   "get": {
    "operationId": "api_index",
    "summary": "The API index",
    "description": "Links to every resource and the rating scale. Start here.",
    "tags": [
     "meta"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IndexResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "security": []
   }
  },
  "/v1/status": {
   "get": {
    "operationId": "status",
    "summary": "Build time, counts and upstream freshness",
    "description": "How fresh the data is and how many records it holds.",
    "tags": [
     "meta"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/StatusResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/coverage": {
   "get": {
    "operationId": "coverage",
    "summary": "What BidCount reads, and what it does not",
    "description": "Generated from the build. Quote it instead of making your own coverage claim.",
    "tags": [
     "meta"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CoverageResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/tenders": {
   "get": {
    "operationId": "tenders_list",
    "summary": "Open tenders",
    "description": "Open tenders with the buyer's bid history. Public fields only. Page with links.next.",
    "tags": [
     "tenders"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TenderList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/q"
     },
     {
      "$ref": "#/components/parameters/sector"
     },
     {
      "$ref": "#/components/parameters/region"
     },
     {
      "$ref": "#/components/parameters/buyer"
     },
     {
      "$ref": "#/components/parameters/cpv"
     },
     {
      "$ref": "#/components/parameters/value_min"
     },
     {
      "$ref": "#/components/parameters/value_max"
     },
     {
      "$ref": "#/components/parameters/closes_from"
     },
     {
      "$ref": "#/components/parameters/closes_to"
     },
     {
      "$ref": "#/components/parameters/rating"
     },
     {
      "$ref": "#/components/parameters/kind"
     },
     {
      "$ref": "#/components/parameters/sme_suitable"
     },
     {
      "$ref": "#/components/parameters/sme_or_vcse_suitable"
     },
     {
      "$ref": "#/components/parameters/exclude_ceiling"
     },
     {
      "$ref": "#/components/parameters/tender_sort"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/tenders/{id}": {
   "get": {
    "operationId": "tenders_get",
    "summary": "One open tender",
    "description": "A tender that has closed since the last build is a 404.",
    "tags": [
     "tenders"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TenderResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ]
   }
  },
  "/v1/coming-soon": {
   "get": {
    "operationId": "coming-soon_list",
    "summary": "Tenders coming soon",
    "description": "Planned procurement notices and market-engagement requests. Dates are the buyer's own estimate.",
    "tags": [
     "coming-soon"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ComingSoonList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/q"
     },
     {
      "$ref": "#/components/parameters/sector"
     },
     {
      "$ref": "#/components/parameters/region"
     },
     {
      "$ref": "#/components/parameters/buyer"
     },
     {
      "$ref": "#/components/parameters/cpv"
     },
     {
      "$ref": "#/components/parameters/value_min"
     },
     {
      "$ref": "#/components/parameters/value_max"
     },
     {
      "$ref": "#/components/parameters/expected_from"
     },
     {
      "$ref": "#/components/parameters/expected_to"
     },
     {
      "$ref": "#/components/parameters/rating"
     },
     {
      "$ref": "#/components/parameters/kind"
     },
     {
      "$ref": "#/components/parameters/stage"
     },
     {
      "$ref": "#/components/parameters/soon_sort"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/coming-soon/{id}": {
   "get": {
    "operationId": "coming-soon_get",
    "summary": "One coming-soon notice",
    "description": "",
    "tags": [
     "coming-soon"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ComingSoonResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ]
   }
  },
  "/v1/buyers": {
   "get": {
    "operationId": "buyers_list",
    "summary": "Buyers",
    "description": "Every public buyer BidCount has a page for, by name.",
    "tags": [
     "buyers"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BuyerList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/q_names"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/buyers/{id}": {
   "get": {
    "operationId": "buyers_get",
    "summary": "One buyer",
    "description": "Usual bids, rating and counts. No suppliers and no ending-contract detail.",
    "tags": [
     "buyers"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BuyerResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ]
   }
  },
  "/v1/sectors": {
   "get": {
    "operationId": "sectors_list",
    "summary": "Sectors",
    "description": "Sectors with open tenders.",
    "tags": [
     "sectors"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HubList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/q_names"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/sectors/{id}": {
   "get": {
    "operationId": "sectors_get",
    "summary": "One sector",
    "description": "",
    "tags": [
     "sectors"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HubResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ]
   }
  },
  "/v1/regions": {
   "get": {
    "operationId": "regions_list",
    "summary": "Regions",
    "description": "UK regions with open tenders.",
    "tags": [
     "regions"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HubList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/q_names"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/regions/{id}": {
   "get": {
    "operationId": "regions_get",
    "summary": "One region",
    "description": "",
    "tags": [
     "regions"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HubResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ]
   }
  },
  "/v1/rankings": {
   "get": {
    "operationId": "rankings",
    "summary": "Buyers, sectors and regions by usual bids",
    "description": "Which buyers usually draw the fewest and the most bids.",
    "tags": [
     "meta"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RankingsResponse"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/search": {
   "get": {
    "operationId": "search",
    "summary": "Search tenders, coming-soon notices and buyers",
    "description": "Uses the site's own search. Tenders first, then coming-soon notices, then buyers, each best match first.",
    "tags": [
     "search"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SearchList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/q_search"
     },
     {
      "$ref": "#/components/parameters/type"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/changes": {
   "get": {
    "operationId": "changes_list",
    "summary": "Tenders new in the latest build",
    "description": "Only the latest daily build is kept, so this is a list of what is new today, not a history.",
    "tags": [
     "changes"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "Link": {
        "$ref": "#/components/headers/Link"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ChangeList"
        }
       }
      }
     },
     "304": {
      "$ref": "#/components/responses/NotModified"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "406": {
      "$ref": "#/components/responses/NotAcceptable"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/since"
     },
     {
      "$ref": "#/components/parameters/sector"
     },
     {
      "$ref": "#/components/parameters/region"
     },
     {
      "$ref": "#/components/parameters/value_min"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ]
   }
  },
  "/v1/openapi.json": {
   "get": {
    "operationId": "openapi",
    "summary": "This document",
    "tags": [
     "meta"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    },
    "security": []
   }
  },
  "/v1/docs": {
   "get": {
    "operationId": "docs",
    "summary": "Human-readable guide",
    "tags": [
     "meta"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "text/html": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "security": []
   }
  },
  "/v1/watches": {
   "get": {
    "operationId": "watches_list",
    "summary": "Your saved searches",
    "description": "The saved searches (watches) of the key's owner. Watches are shared by all keys of one owner and need an API key. They store filters only.",
    "tags": [
     "watches"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchList"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   },
   "post": {
    "operationId": "watches_create",
    "summary": "Save a search",
    "description": "Save a patch once: several sectors, regions and CPV prefixes at once, words and value bounds. At most 10 per owner. Send JSON; answers 201 with the watch.",
    "tags": [
     "watches"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WatchInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchOne"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "Too many watches."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   }
  },
  "/v1/watches/{id}": {
   "parameters": [
    {
     "name": "id",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string"
     }
    }
   ],
   "get": {
    "operationId": "watch_get",
    "summary": "One saved search",
    "tags": [
     "watches"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchOne"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   },
   "delete": {
    "operationId": "watch_delete",
    "summary": "Delete a saved search",
    "description": "Deletes the saved filters only.",
    "tags": [
     "watches"
    ],
    "responses": {
     "204": {
      "description": "Deleted"
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   },
   "patch": {
    "operationId": "watch_update",
    "summary": "Change a saved search",
    "description": "Send only the fields to change; null removes one, a list replaces the old list.",
    "tags": [
     "watches"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "name": {
          "type": "string",
          "maxLength": 60
         },
         "sectors": {
          "type": [
           "array",
           "null"
          ],
          "items": {
           "type": "string"
          }
         },
         "regions": {
          "type": [
           "array",
           "null"
          ],
          "items": {
           "type": "string"
          }
         },
         "cpv_prefixes": {
          "type": [
           "array",
           "null"
          ],
          "items": {
           "type": "string"
          }
         },
         "q": {
          "type": [
           "string",
           "null"
          ]
         },
         "value_min": {
          "type": [
           "number",
           "null"
          ]
         },
         "value_max": {
          "type": [
           "number",
           "null"
          ]
         },
         "sme_or_vcse": {
          "type": [
           "boolean",
           "null"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchOne"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/v1/watches/{id}/new": {
   "parameters": [
    {
     "name": "id",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string"
     }
    }
   ],
   "get": {
    "operationId": "watch_new",
    "summary": "What is new for a saved search",
    "description": "Open tenders first seen after `since` (default the last 7 days) and, with `until`, on or before it, that pass the watch, newest first. First-seen days exist only from the day tracking began (the note in `meta` says which day); tenders already open then have none and are listed by `/open`. Rows are the public tender rows plus first_seen, closes_in_days and, when the watch has words, matched_words.",
    "tags": [
     "watches"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/since"
     },
     {
      "$ref": "#/components/parameters/until"
     },
     {
      "$ref": "#/components/parameters/closes_to"
     },
     {
      "$ref": "#/components/parameters/hide_seen"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchTenders"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   }
  },
  "/v1/watches/{id}/open": {
   "parameters": [
    {
     "name": "id",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string"
     }
    }
   ],
   "get": {
    "operationId": "watch_open",
    "summary": "Everything open for a saved search",
    "description": "Every open tender that passes the watch, soonest closing first. Rows are the public tender rows plus closes_in_days, first_seen when known and, when the watch has words, matched_words.",
    "tags": [
     "watches"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/closes_to"
     },
     {
      "$ref": "#/components/parameters/hide_seen"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchTenders"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   }
  },
  "/v1/watches/{id}/marks": {
   "parameters": [
    {
     "name": "id",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string"
     }
    }
   ],
   "get": {
    "operationId": "watch_marks",
    "summary": "Marks on a saved search's tenders",
    "tags": [
     "watches"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/WatchMark"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "watch_mark",
    "summary": "Mark a tender seen, ignored or pursuing",
    "description": "Send {tender_id, mark} or {marks: [{tender_id, mark}, ...]} (up to 50); mark is seen, ignored, pursuing or clear. Answers all the marks. Marks stay while the tender is open; at most 500.",
    "tags": [
     "watches"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "tender_id": {
          "type": "string"
         },
         "mark": {
          "type": "string",
          "enum": [
           "seen",
           "ignored",
           "pursuing",
           "clear"
          ]
         },
         "marks": {
          "type": "array",
          "maxItems": 50,
          "items": {
           "type": "object",
           "additionalProperties": false,
           "required": [
            "tender_id",
            "mark"
           ],
           "properties": {
            "tender_id": {
             "type": "string"
            },
            "mark": {
             "type": "string",
             "enum": [
              "seen",
              "ignored",
              "pursuing",
              "clear"
             ]
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "All the marks",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/WatchMark"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "Too many marks."
     }
    }
   }
  },
  "/v1/contracts": {
   "get": {
    "operationId": "contracts_list",
    "summary": "Contracts ending, and who holds them",
    "description": "Awarded contracts that end in the next twelve months, from award notices and councils' own contracts registers, with the supplier that holds each. Pro. Private to the key, never cached. Page with links.next.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/pro_q"
     },
     {
      "$ref": "#/components/parameters/sector"
     },
     {
      "$ref": "#/components/parameters/region"
     },
     {
      "$ref": "#/components/parameters/buyer"
     },
     {
      "$ref": "#/components/parameters/holder"
     },
     {
      "$ref": "#/components/parameters/ends_from"
     },
     {
      "$ref": "#/components/parameters/ends_to"
     },
     {
      "$ref": "#/components/parameters/value_min"
     },
     {
      "$ref": "#/components/parameters/value_max"
     },
     {
      "$ref": "#/components/parameters/contract_source"
     },
     {
      "$ref": "#/components/parameters/pro_sort"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProContractList"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/contracts/{id}": {
   "get": {
    "operationId": "contracts_get",
    "summary": "One contract",
    "description": "One ending contract by id. Pro.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProContractResponse"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/frameworks": {
   "get": {
    "operationId": "frameworks_list",
    "summary": "Framework agreements and who is on them",
    "description": "Framework agreements in force, with the suppliers on each. Pro.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/pro_q"
     },
     {
      "$ref": "#/components/parameters/sector"
     },
     {
      "$ref": "#/components/parameters/region"
     },
     {
      "$ref": "#/components/parameters/buyer"
     },
     {
      "$ref": "#/components/parameters/holder"
     },
     {
      "$ref": "#/components/parameters/ends_from"
     },
     {
      "$ref": "#/components/parameters/ends_to"
     },
     {
      "$ref": "#/components/parameters/pro_sort"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProFrameworkList"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/frameworks/{id}": {
   "get": {
    "operationId": "frameworks_get",
    "summary": "One framework agreement",
    "description": "One framework agreement by id. Pro.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProFrameworkResponse"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/incumbents": {
   "get": {
    "operationId": "incumbents_list",
    "summary": "Probable incumbents of open tenders",
    "description": "The open tenders for which BidCount names the supplier that probably holds the contract being replaced. Pro. Paged by tender id.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProIncumbentList"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/incumbents/{tender_id}": {
   "get": {
    "operationId": "incumbents_get",
    "summary": "Probable incumbent of one tender",
    "description": "The probable incumbent of one open tender. 404 when none is named. Pro.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "in": "path",
      "name": "tender_id",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProIncumbentResponse"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/buyer-intel": {
   "get": {
    "operationId": "buyer_intel_list",
    "summary": "Buyer profiles",
    "description": "How buyers award: usual value and term, usual bids, who wins most, the share of direct awards, and the procurement mailbox. Pro. Largest buyers first.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/buyer_q"
     },
     {
      "$ref": "#/components/parameters/limit"
     },
     {
      "$ref": "#/components/parameters/cursor"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProBuyerIntelList"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/buyer-intel/{id}": {
   "get": {
    "operationId": "buyer_intel_get",
    "summary": "One buyer profile",
    "description": "One buyer's profile, by the id this API gives it or by its public buyer id. Pro.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/Id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProBuyerIntelResponse"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/suppliers/{company_number}": {
   "get": {
    "operationId": "suppliers_get",
    "summary": "What a company has won",
    "description": "The public contracts a limited company has won, from award notices and councils' own registers, found by Companies House number. Pro. Private to the key, never cached.",
    "tags": [
     "pro-data"
    ],
    "parameters": [
     {
      "in": "path",
      "name": "company_number",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^(\\d{8}|[A-Za-z]{2}\\d{6})$"
      },
      "description": "A Companies House number: 8 digits, or two letters and 6 digits (case and spaces are ignored). 00000000 is refused."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProSupplierResponse"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Invalid"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "405": {
      "description": "A method other than GET."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/v1/account": {
   "get": {
    "operationId": "get_account",
    "summary": "Read the account",
    "description": "The account behind this key: its tier (free or pro), the business profile that decides which tenders fit, the digest email setting (off, daily or weekly, and the weekday of the weekly one) and the Bid / Pass / Know votes made on tenders.",
    "tags": [
     "account"
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   },
   "patch": {
    "operationId": "update_account",
    "summary": "Change the account's profile or digest",
    "description": "Change any of: the business profile, whether a digest email is sent (off, daily, weekly) and on which weekday the weekly one goes. Send only what changes. The digest goes to the address the account signed in with; turning it on is the account holder's own choice, so only do it when they asked. Delivery is at the one morning run, not at a time of day.",
    "tags": [
     "account"
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "profile": {
          "type": [
           "object",
           "null"
          ],
          "additionalProperties": false,
          "description": "What the business does, used to choose which tenders fit. null clears it. Sectors and regions may be given as ids (south-west) or names (South West) from /v1/sectors and /v1/regions; they are stored as names. 0 for a value means not given.",
          "properties": {
           "sectors": {
            "type": "array",
            "maxItems": 60,
            "items": {
             "type": "string",
             "maxLength": 60,
             "description": "A sector name."
            }
           },
           "regions": {
            "type": "array",
            "maxItems": 20,
            "items": {
             "type": "string",
             "maxLength": 40,
             "description": "A region name."
            }
           },
           "accreds": {
            "type": "array",
            "maxItems": 20,
            "items": {
             "type": "string",
             "maxLength": 40,
             "description": "An accreditation, for example ISO 9001."
            }
           },
           "kw": {
            "type": "array",
            "maxItems": 8,
            "items": {
             "type": "string",
             "maxLength": 40,
             "description": "A word a tender must mention."
            }
           },
           "vmin": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000,
            "description": "Smallest contract value in pounds."
           },
           "vmax": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000,
            "description": "Largest contract value in pounds."
           },
           "tur": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000,
            "description": "Annual turnover in pounds."
           },
           "pl": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000000,
            "description": "Public liability cover in pounds."
           }
          }
         },
         "digest": {
          "enum": [
           "off",
           "daily",
           "weekly"
          ],
          "description": "off, or an email each weekday morning (daily) or once a week."
         },
         "digest_day": {
          "enum": [
           "Mon",
           "Tue",
           "Wed",
           "Thu",
           "Fri"
          ],
          "description": "The weekday a weekly digest goes (Monday by default)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/account/votes/{tender_id}": {
   "put": {
    "operationId": "vote_on_tender",
    "summary": "Bid, pass or know a tender",
    "description": "Record the account's decision on one tender: bid, pass or know (or clear it). Tenders voted bid are the ones the morning digest reminds the person about in the last week. Up to 300 votes are kept.",
    "tags": [
     "account"
    ],
    "parameters": [
     {
      "name": "tender_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{6,80}$",
       "description": "The tender's id."
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "vote": {
          "enum": [
           "bid",
           "pass",
           "know",
           null
          ],
          "description": "bid (going for it), pass (not for us), know (already known), or null to clear the vote."
         },
         "title": {
          "type": "string",
          "maxLength": 200,
          "description": "Kept with the vote so it still reads after the tender closes."
         },
         "buyer": {
          "type": "string",
          "maxLength": 120,
          "description": "The buyer's name."
         },
         "closes": {
          "type": "string",
          "maxLength": 10,
          "description": "The closing day, YYYY-MM-DD.",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         }
        },
        "required": [
         "vote"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar": {
   "get": {
    "operationId": "get_radar",
    "summary": "Read the radar",
    "description": "The radar: its profile (what the business wants), its ranking configuration and its rules with their ids, cadence and channel. Paid tier only.",
    "tags": [
     "radar"
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   },
   "post": {
    "operationId": "create_radar",
    "summary": "Set the radar up",
    "description": "Set up the account's radar with the default ranking and two starter rules (new tenders that fit; contracts ending soon). One radar per account. Then give it a profile with set_radar_profile.",
    "tags": [
     "radar"
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "label": {
          "type": "string",
          "maxLength": 80,
          "description": "A name for the radar."
         },
         "company_number": {
          "type": "string",
          "maxLength": 8,
          "description": "The business's Companies House number, to build the profile from.",
          "pattern": "^[A-Za-z0-9]{8}$"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   },
   "delete": {
    "operationId": "delete_radar",
    "summary": "Delete the radar",
    "description": "Delete the account's radar with its profile, configuration, rules and alert history. Only on the person's clear instruction.",
    "tags": [
     "radar"
    ],
    "parameters": [
     {
      "name": "confirm",
      "in": "query",
      "required": true,
      "schema": {
       "const": true,
       "description": "Must be true: deleting the radar, its profile, rules and alert history cannot be undone."
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Done; no content."
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/profile": {
   "put": {
    "operationId": "set_radar_profile",
    "summary": "Describe what the radar looks for",
    "description": "Replace the radar's profile (a new version is kept; the old stays on record). Give whichever parts apply: weighted procurement codes, buyers and words, regions, exclusions and a value range.",
    "tags": [
     "radar"
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "cpv": {
          "type": "object",
          "description": "Procurement-code prefixes of 3 digits (a group, 454) or 5 digits (a class, 45261): other lengths never match a tender: a name or code mapped to a weight between 0 and 1."
         },
         "buyers": {
          "type": "object",
          "description": "Buyers, any case: a name or code mapped to a weight between 0 and 1."
         },
         "terms": {
          "type": "object",
          "description": "Words that matter, lower case with underscores: a name or code mapped to a weight between 0 and 1."
         },
         "regions": {
          "type": "array",
          "maxItems": 12,
          "items": {
           "type": "string",
           "maxLength": 40,
           "description": "A region: an id (south-west) or a name (South West) from /v1/regions."
          }
         },
         "exclude_terms": {
          "type": "array",
          "maxItems": 25,
          "items": {
           "type": "string",
           "maxLength": 40,
           "description": "A word that rules a tender out."
          }
         },
         "exclude_buyers": {
          "type": "array",
          "maxItems": 25,
          "items": {
           "type": "string",
           "maxLength": 80,
           "description": "A buyer to leave out."
          }
         },
         "min_value": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000000,
          "description": "Smallest contract value in pounds."
         },
         "max_value": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000000,
          "description": "Largest contract value in pounds (0 for no limit)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/config": {
   "put": {
    "operationId": "set_radar_config",
    "summary": "Tune how the radar ranks and how often it speaks",
    "description": "Replace the ranking configuration: feature weights, the alert threshold and the weekly alert budget. Omitted parts return to the defaults, so send the whole configuration.",
    "tags": [
     "radar"
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "weights": {
          "type": "object",
          "description": "How much each fit feature counts, 0 to 3 each, at least one above 0."
         },
         "alert_threshold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Lowest score that alerts, 0 to 100."
         },
         "weekly_budget": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000,
          "description": "Most alerts a week; the paid tier allows more than the free."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/rules": {
   "post": {
    "operationId": "add_radar_rule",
    "summary": "Add a radar rule",
    "description": "Add a standing rule: what to watch for, how sensitive, how often to deliver and where. At most 10 rules.",
    "tags": [
     "radar"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "name": {
          "type": "string",
          "maxLength": 60,
          "description": "A short name for the rule."
         },
         "trigger": {
          "enum": [
           "new_match",
           "renewal_window",
           "buyer_watch",
           "competitor_win"
          ],
          "description": "new_match (a new tender fits), renewal_window (a contract is ending), buyer_watch (a named buyer publishes), competitor_win (a named competitor wins)."
         },
         "threshold": {
          "type": [
           "number",
           "null"
          ],
          "minimum": 0,
          "maximum": 100,
          "description": "Lowest fit score that alerts, 0 to 100. null uses the radar's own threshold."
         },
         "cadence": {
          "enum": [
           "immediate",
           "daily",
           "weekly"
          ],
          "description": "immediate, or batched into a daily or weekly delivery."
         },
         "channel": {
          "enum": [
           "email",
           "feed",
           "webhook"
          ],
          "description": "email, feed (read with get_radar_alerts) or webhook (sent to the account's registered endpoints)."
         },
         "params": {
          "type": "object",
          "description": "By trigger: buyer_watch {buyers: [names]}, competitor_win {competitors: [Companies House numbers]}, renewal_window {months: 1-24}, new_match {max_age_days: 0-30}."
         }
        },
        "required": [
         "name",
         "trigger"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/rules/{rule_id}": {
   "patch": {
    "operationId": "update_radar_rule",
    "summary": "Change or switch off a rule",
    "description": "Change any part of a rule (its threshold, cadence, channel, parameters or name) or switch it off or on with active. Send only what changes.",
    "tags": [
     "radar"
    ],
    "parameters": [
     {
      "name": "rule_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f-]{36}$",
       "description": "The rule's id (from get_radar)."
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "name": {
          "type": "string",
          "maxLength": 60,
          "description": "A short name for the rule."
         },
         "trigger": {
          "enum": [
           "new_match",
           "renewal_window",
           "buyer_watch",
           "competitor_win"
          ],
          "description": "new_match (a new tender fits), renewal_window (a contract is ending), buyer_watch (a named buyer publishes), competitor_win (a named competitor wins)."
         },
         "threshold": {
          "type": [
           "number",
           "null"
          ],
          "minimum": 0,
          "maximum": 100,
          "description": "Lowest fit score that alerts, 0 to 100. null uses the radar's own threshold."
         },
         "cadence": {
          "enum": [
           "immediate",
           "daily",
           "weekly"
          ],
          "description": "immediate, or batched into a daily or weekly delivery."
         },
         "channel": {
          "enum": [
           "email",
           "feed",
           "webhook"
          ],
          "description": "email, feed (read with get_radar_alerts) or webhook (sent to the account's registered endpoints)."
         },
         "params": {
          "type": "object",
          "description": "By trigger: buyer_watch {buyers: [names]}, competitor_win {competitors: [Companies House numbers]}, renewal_window {months: 1-24}, new_match {max_age_days: 0-30}."
         },
         "active": {
          "type": "boolean",
          "description": "false switches the rule off (its alert history stays); true switches it on."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/alerts": {
   "get": {
    "operationId": "get_radar_alerts",
    "summary": "Read the waiting alerts",
    "description": "The alerts waiting to be taken (at most 50, from the last 30 days), each with its rule_id, tender id, trigger and score. Acknowledge the ones you have handled with ack_radar_alerts, or they are returned again.",
    "tags": [
     "radar"
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/alerts/ack": {
   "post": {
    "operationId": "ack_radar_alerts",
    "summary": "Mark alerts as taken",
    "description": "Say which alerts have been taken (up to 50 at a time, as returned by get_radar_alerts), so get_radar_alerts stops returning them.",
    "tags": [
     "radar"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "alerts": {
          "type": "array",
          "maxItems": 50,
          "items": {
           "type": "object",
           "required": [
            "rule_id",
            "opportunity_id",
            "trigger"
           ],
           "additionalProperties": false,
           "properties": {
            "rule_id": {
             "type": "string",
             "maxLength": 40,
             "description": "The rule's id."
            },
            "opportunity_id": {
             "type": "string",
             "maxLength": 100,
             "description": "The tender id."
            },
            "trigger": {
             "enum": [
              "new_match",
              "renewal_window",
              "buyer_watch",
              "competitor_win",
              "score_crossing"
             ]
            }
           }
          },
          "description": "The alerts taken, as returned by get_radar_alerts."
         }
        },
        "required": [
         "alerts"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/radar/feedback": {
   "post": {
    "operationId": "give_radar_feedback",
    "summary": "Tell the radar what a tender was worth",
    "description": "Record what the person did with a tender (marked, dismissed, bid, won, lost). The radar learns from this.",
    "tags": [
     "radar"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "opportunity_id": {
          "type": "string",
          "maxLength": 80,
          "description": "The tender id.",
          "pattern": "^[A-Za-z0-9._:-]{3,80}$"
         },
         "label": {
          "enum": [
           "shown",
           "marked",
           "dismissed",
           "bid",
           "won",
           "lost"
          ],
          "description": "What happened to it."
         },
         "score": {
          "type": "number",
          "description": "The score the radar gave it, if known."
         }
        },
        "required": [
         "opportunity_id",
         "label"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/webhooks": {
   "get": {
    "operationId": "list_webhooks",
    "summary": "List webhooks",
    "description": "The account's webhooks with their endpoints, whether each is on, and how the last delivery went. Radar rules with the channel webhook deliver to every active webhook.",
    "tags": [
     "webhooks"
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   },
   "post": {
    "operationId": "create_webhook",
    "summary": "Register a webhook",
    "description": "Register an endpoint to receive events (radar alerts) as signed JSON POSTs. The reply holds the signing secret ONCE: store it, it is not shown again (rotate_webhook_secret makes a new one). At most 5 webhooks. The signature scheme is in the API docs.",
    "tags": [
     "webhooks"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "endpoint": {
          "type": "string",
          "maxLength": 500,
          "description": "Where to send events: an https address on the standard port with a public host name."
         },
         "label": {
          "type": "string",
          "maxLength": 80,
          "description": "A name for this webhook."
         }
        },
        "required": [
         "endpoint"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/webhooks/{webhook_id}": {
   "get": {
    "operationId": "get_webhook",
    "summary": "Read a webhook",
    "description": "One webhook: endpoint, whether it is on, consecutive failures, why it was stopped (if it was), and its last delivery.",
    "tags": [
     "webhooks"
    ],
    "parameters": [
     {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^wh-[0-9a-f]{10}$",
       "description": "The webhook's id (from list_webhooks)."
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   },
   "patch": {
    "operationId": "update_webhook",
    "summary": "Change, switch off or switch on a webhook",
    "description": "Change the endpoint or label, or switch a webhook off or back on. A webhook that failed ten deliveries in a row, or answered 410, is switched off and stays off until active is set to true.",
    "tags": [
     "webhooks"
    ],
    "parameters": [
     {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^wh-[0-9a-f]{10}$",
       "description": "The webhook's id (from list_webhooks)."
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "endpoint": {
          "type": "string",
          "maxLength": 500,
          "description": "Where to send events: an https address on the standard port with a public host name."
         },
         "label": {
          "type": "string",
          "maxLength": 80,
          "description": "A name for this webhook."
         },
         "active": {
          "type": "boolean",
          "description": "false stops deliveries; true starts them again after they were stopped (the failure count restarts)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   },
   "delete": {
    "operationId": "delete_webhook",
    "summary": "Delete a webhook",
    "description": "Delete a webhook. Events stop going to it immediately; its signing secret stops being valid. Registering the same address again makes a new webhook with a new secret.",
    "tags": [
     "webhooks"
    ],
    "parameters": [
     {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^wh-[0-9a-f]{10}$",
       "description": "The webhook's id (from list_webhooks)."
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Done; no content."
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/webhooks/{webhook_id}/secret": {
   "post": {
    "operationId": "rotate_webhook_secret",
    "summary": "Make a new signing secret",
    "description": "Make a new signing secret for a webhook (the old one stops working at once) and return it ONCE.",
    "tags": [
     "webhooks"
    ],
    "parameters": [
     {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^wh-[0-9a-f]{10}$",
       "description": "The webhook's id (from list_webhooks)."
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/webhooks/{webhook_id}/test": {
   "post": {
    "operationId": "test_webhook",
    "summary": "Send a test event",
    "description": "Send a signed test event to the endpoint now and report whether it was received (its HTTP status, or why not). Ten a day per account; a test never counts toward switching the webhook off.",
    "tags": [
     "webhooks"
    ],
    "parameters": [
     {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^wh-[0-9a-f]{10}$",
       "description": "The webhook's id (from list_webhooks)."
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "event": {
          "enum": [
           "webhook.test",
           "radar.alert"
          ],
          "description": "webhook.test (the default) is a short message; radar.alert is a sample alert, marked sample: true, with every field a real one carries, so a no-code tool can learn the fields."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "402": {
      "$ref": "#/components/responses/PaidTierRequired"
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/opportunities/{opportunity_id}": {
   "get": {
    "operationId": "get_opportunity",
    "summary": "Look up a tender by any id it has had",
    "description": "The permanent record of a tender: its permanent id (the first we ever served, which never changes), whether it is still open, when it was first and last seen and closed, a revision number that rises when its title, buyer, value, closing day, code, sector, region or procedure changes, and every id it has had. Use it to resolve an id you stored earlier. Public data only.",
    "tags": [
     "opportunities"
    ],
    "parameters": [
     {
      "name": "opportunity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._:-]{1,100}$",
       "description": "Any id this tender has been served under, including an older id of the same tender or one from after it closed."
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  },
  "/v1/feedback": {
   "post": {
    "operationId": "send_feedback",
    "summary": "Tell BidCount what is wrong, missing or could be better",
    "description": "Report a problem or an idea to the people who run BidCount: a wrong field on a tender, a tender that is missing, a bug in the API or tools, or something that would make them work better. It is read by a person and by an assistant that triages it; there is no reply, and you are not told what was done. Be specific (what you asked, what you got, what you expected) and never include personal data. At most 20 a day per key.",
    "tags": [
     "feedback"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "topic": {
          "enum": [
           "bug",
           "wrong_data",
           "missing_tender",
           "idea",
           "other"
          ],
          "description": "wrong_data (a field of a tender is wrong), missing_tender (a tender that should be here is not), bug (something broke), idea (a feature that would help) or other."
         },
         "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "What is wrong or wanted, in plain words. For wrong data: what we show, what the official notice says, and where you saw it. For a missing tender: its title, buyer and where it is published. No personal data.",
          "minLength": 10
         },
         "tender_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,100}$",
          "description": "The id of the tender this is about, when there is one."
         }
        },
        "required": [
         "topic",
         "message"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": false,
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/InvalidRequest"
     },
     "401": {
      "description": "No valid API key."
     },
     "403": {
      "$ref": "#/components/responses/AccountKeyRequired"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Source": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "licence"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "licence": {
      "type": "string"
     }
    },
    "description": "A service the data is read from, as listed in coverage."
   },
   "Licence": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name",
     "link",
     "attribution"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "link": {
      "type": "string"
     },
     "attribution": {
      "type": "string"
     }
    }
   },
   "Meta": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "as_of",
     "api_version",
     "status",
     "sources",
     "licence",
     "caveats"
    ],
    "properties": {
     "as_of": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}.*)?$",
      "description": "When the data behind this response was built. The site is rebuilt once a day."
     },
     "api_version": {
      "type": "string",
      "enum": [
       "1"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "preview"
      ],
      "description": "preview: the shape may still change with 30 days' notice until the label is dropped."
     },
     "sources": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Source"
      }
     },
     "licence": {
      "$ref": "#/components/schemas/Licence"
     },
     "caveats": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Keep these when you show the numbers."
     },
     "tier": {
      "type": "string",
      "enum": [
       "pro"
      ],
      "description": "Present on Pro data: the answer is private to the key."
     }
    }
   },
   "ListMeta": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "as_of",
     "api_version",
     "status",
     "sources",
     "licence",
     "caveats",
     "total",
     "limit",
     "count"
    ],
    "properties": {
     "as_of": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}.*)?$"
     },
     "api_version": {
      "type": "string",
      "enum": [
       "1"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "preview"
      ]
     },
     "sources": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Source"
      }
     },
     "licence": {
      "$ref": "#/components/schemas/Licence"
     },
     "caveats": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Rows matching the filters, across all pages."
     },
     "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200
     },
     "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Rows in this page."
     },
     "cursor_from_older_build": {
      "type": "boolean",
      "description": "Present and true when the cursor was issued before the latest daily build: paging continues best effort and may skip or repeat rows."
     },
     "note": {
      "type": "string"
     },
     "tier": {
      "type": "string",
      "enum": [
       "pro"
      ],
      "description": "Present on Pro data: the answer is private to the key."
     }
    }
   },
   "Links": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "self"
    ],
    "properties": {
     "self": {
      "type": "string"
     },
     "next": {
      "type": "string",
      "description": "Present when there is another page. Follow it as given."
     },
     "buyer": {
      "type": "string"
     },
     "sector": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "tenders": {
      "type": "string"
     },
     "coverage": {
      "type": "string"
     },
     "notice": {
      "type": "string",
      "description": "The notice this record comes from, at its source."
     },
     "tender": {
      "type": "string",
      "description": "The tender this record is about."
     },
     "public": {
      "type": "string",
      "description": "The same buyer's public page in this API."
     },
     "buyer_intel": {
      "type": "string",
      "description": "The buyer's profile on /v1/buyer-intel, when it has one."
     },
     "companies_house": {
      "type": "string",
      "description": "The company's page on Companies House."
     }
    },
    "description": "Paths relative to https://bidcount.co.uk."
   },
   "ProblemError": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "parameter",
     "reason"
    ],
    "properties": {
     "parameter": {
      "type": "string"
     },
     "reason": {
      "type": "string"
     }
    }
   },
   "Problem": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "type",
     "title",
     "status",
     "detail",
     "instance"
    ],
    "properties": {
     "type": {
      "type": "string",
      "description": "A path to the problem's explanation in the docs."
     },
     "title": {
      "type": "string"
     },
     "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599
     },
     "detail": {
      "type": "string"
     },
     "instance": {
      "type": "string"
     },
     "errors": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ProblemError"
      }
     },
     "request_id": {
      "type": "string"
     }
    },
    "description": "RFC 9457 problem details. Served as application/problem+json."
   },
   "BuyerRef": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name",
     "id"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "id": {
      "type": [
       "string",
       "null"
      ],
      "description": "The buyer's id in this API, or null when BidCount has no page for it."
     }
    }
   },
   "Money": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "amount_gbp",
     "is_ceiling"
    ],
    "properties": {
     "amount_gbp": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0,
      "description": "As the notice states it, in pounds; null when it states none."
     },
     "is_ceiling": {
      "type": "boolean",
      "description": "True for a framework or other ceiling figure, which is not what will be spent."
     }
    }
   },
   "SectorRef": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     }
    }
   },
   "RegionRef": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "inferred"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "inferred": {
      "type": "boolean",
      "description": "True when the notice gives no place and BidCount inferred it (about 95% right on its own check)."
     }
    }
   },
   "BuyerHistory": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "rating",
     "usual_bids",
     "based_on_lots"
    ],
    "properties": {
     "rating": {
      "type": "string",
      "enum": [
       "thin",
       "typical",
       "contested",
       "unrated"
      ],
      "description": "Schema name of the rating. The site shows it as a label: see x-presentation-labels. It describes the buyer's history of bids, not a forecast for this tender."
     },
     "usual_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0,
      "description": "Median bids on the buyer's earlier open tenders; null when unrated."
     },
     "based_on_lots": {
      "type": "integer",
      "minimum": 0,
      "description": "Earlier lots behind the median."
     }
    }
   },
   "SmallFirmSignals": {
    "type": [
     "object",
     "null"
    ],
    "additionalProperties": false,
    "required": [
     "sme_suitable",
     "vcse_suitable",
     "reserved_for_sme_vcse"
    ],
    "description": "What the notice states about small suppliers; null when it states nothing. Never an inference.",
    "properties": {
     "sme_suitable": {
      "type": "boolean"
     },
     "vcse_suitable": {
      "type": "boolean"
     },
     "reserved_for_sme_vcse": {
      "type": "boolean"
     }
    }
   },
   "TenderLinks": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "self"
    ],
    "properties": {
     "self": {
      "type": "string"
     },
     "buyer": {
      "type": "string"
     },
     "sector": {
      "type": "string"
     },
     "region": {
      "type": "string"
     }
    }
   },
   "Tender": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "title",
     "buyer",
     "closes",
     "value",
     "sector",
     "region",
     "cpv",
     "notice_kind",
     "procedure",
     "procedure_type",
     "small_firm_signals",
     "price_weight_pct",
     "buyer_history",
     "notices",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string",
      "pattern": "^[a-z0-9-]{6,80}$"
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "closes": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Closing date from the notice (UK calendar date)."
     },
     "value": {
      "$ref": "#/components/schemas/Money"
     },
     "sector": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "region": {
      "$ref": "#/components/schemas/RegionRef"
     },
     "cpv": {
      "type": [
       "string",
       "null"
      ],
      "description": "Eight-digit CPV code."
     },
     "notice_kind": {
      "type": "string",
      "enum": [
       "contract",
       "list"
      ],
      "description": "list: a supplier list or framework rather than a single contract."
     },
     "procedure": {
      "type": [
       "string",
       "null"
      ],
      "description": "The procedure as the notice words it."
     },
     "procedure_type": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "open",
       "competitive_flexible",
       "selective",
       "framework_call_off",
       "direct_award",
       null
      ],
      "description": "Our reading of the notice's procedure; null when it names none we can place."
     },
     "small_firm_signals": {
      "$ref": "#/components/schemas/SmallFirmSignals"
     },
     "price_weight_pct": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0,
      "maximum": 100,
      "description": "Price share of the award criteria, only where the notice gives plain percentage weights that add to 100."
     },
     "buyer_history": {
      "$ref": "#/components/schemas/BuyerHistory"
     },
     "notices": {
      "type": "integer",
      "minimum": 1,
      "description": "Notices merged into this record."
     },
     "links": {
      "$ref": "#/components/schemas/TenderLinks"
     }
    },
    "description": "An open tender. Public facts only: no description, requirements, documents, notice link or incumbent (those are for signed-in site users)."
   },
   "ComingSoon": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "title",
     "buyer",
     "stage",
     "expected_date",
     "expected_date_is_estimate",
     "respond_by",
     "value",
     "sector",
     "region",
     "cpv",
     "notice_kind",
     "procedure",
     "buyer_history",
     "notice_lead_days",
     "notices",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string",
      "pattern": "^[a-z0-9-]{6,80}$"
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "stage": {
      "type": "string",
      "enum": [
       "planned",
       "engagement"
      ],
      "description": "planned: a planned procurement notice. engagement: a request for the market's views before a tender is written."
     },
     "expected_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The date the buyer expects to publish the tender (for an engagement with none, its response date)."
     },
     "expected_date_is_estimate": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "Always true: the date is the buyer's own estimate."
     },
     "respond_by": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "value": {
      "$ref": "#/components/schemas/Money"
     },
     "sector": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "region": {
      "$ref": "#/components/schemas/RegionRef"
     },
     "cpv": {
      "type": [
       "string",
       "null"
      ]
     },
     "notice_kind": {
      "type": "string",
      "enum": [
       "contract",
       "list"
      ]
     },
     "procedure": {
      "type": [
       "string",
       "null"
      ]
     },
     "buyer_history": {
      "$ref": "#/components/schemas/BuyerHistory"
     },
     "notice_lead_days": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Days between the notice's publication and the expected date."
     },
     "notices": {
      "type": "integer",
      "minimum": 1
     },
     "links": {
      "$ref": "#/components/schemas/TenderLinks"
     }
    }
   },
   "BuyerIndexRow": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "contracts_awarded",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "contracts_awarded": {
      "type": "integer",
      "minimum": 0,
      "description": "Contracts awarded since October 2023."
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self"
      ],
      "properties": {
       "self": {
        "type": "string"
       }
      }
     }
    }
   },
   "HubIndexRow": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "open_tenders",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0,
      "description": "Open tenders in the same build: the total /v1/tenders returns with the same filter. (The website's own pages count only tenders open for at least 3 more days, so they can be lower.)"
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self"
      ],
      "properties": {
       "self": {
        "type": "string"
       }
      }
     }
    }
   },
   "SectorLink": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "open_tenders",
     "link"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0,
      "description": "Open tenders in the same build: the total /v1/tenders returns with the same filter. (The website's own pages count only tenders open for at least 3 more days, so they can be lower.)"
     },
     "link": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Buyer": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "contracts_awarded_since_2023_10",
     "usual_contract",
     "usual_bids",
     "rating",
     "percent_of_rated_buyers_drawing_more_bids",
     "rated_buyers",
     "open_tenders",
     "coming_soon",
     "contracts_ending_within_12_months",
     "main_sectors",
     "updated",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "contracts_awarded_since_2023_10": {
      "type": "integer",
      "minimum": 0
     },
     "usual_contract": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "value_gbp",
       "term_months"
      ],
      "properties": {
       "value_gbp": {
        "type": [
         "number",
         "null"
        ],
        "minimum": 0
       },
       "term_months": {
        "type": [
         "number",
         "null"
        ],
        "minimum": 0
       }
      }
     },
     "usual_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0,
      "description": "Median bids on the buyer's earlier open tenders."
     },
     "rating": {
      "type": "string",
      "enum": [
       "thin",
       "typical",
       "contested",
       "unrated"
      ],
      "description": "Schema name of the rating. The site shows it as a label: see x-presentation-labels. It describes the buyer's history of bids, not a forecast for this tender."
     },
     "percent_of_rated_buyers_drawing_more_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0,
      "maximum": 100,
      "description": "Of the rated UK public buyers, the share that draw more bids than this one."
     },
     "rated_buyers": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0,
      "description": "Open tenders in the same build: the total /v1/tenders returns with the same filter. (The website's own pages count only tenders open for at least 3 more days, so they can be lower.)"
     },
     "coming_soon": {
      "type": "integer",
      "minimum": 0
     },
     "contracts_ending_within_12_months": {
      "type": "integer",
      "minimum": 0,
      "description": "A count only. Which contracts, and their suppliers, are for signed-in site users."
     },
     "main_sectors": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/SectorLink"
      }
     },
     "updated": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self",
       "tenders"
      ],
      "properties": {
       "self": {
        "type": "string"
       },
       "tenders": {
        "type": "string"
       }
      }
     }
    },
    "description": "A buyer's public facts. Its suppliers and its ending contracts are not in the API."
   },
   "TenderRow": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "title",
     "buyer_name",
     "closes",
     "value_gbp",
     "rating",
     "link"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "buyer_name": {
      "type": "string"
     },
     "closes": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "value_gbp": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0
     },
     "rating": {
      "type": "string",
      "enum": [
       "thin",
       "typical",
       "contested",
       "unrated"
      ],
      "description": "Schema name of the rating. The site shows it as a label: see x-presentation-labels. It describes the buyer's history of bids, not a forecast for this tender."
     },
     "link": {
      "type": "string"
     }
    }
   },
   "RatingMix": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "rating",
     "open_tenders"
    ],
    "properties": {
     "rating": {
      "type": "string",
      "enum": [
       "thin",
       "typical",
       "contested",
       "unrated"
      ],
      "description": "Schema name of the rating. The site shows it as a label: see x-presentation-labels. It describes the buyer's history of bids, not a forecast for this tender."
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "BuyerCount": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "buyer",
     "open_tenders"
    ],
    "properties": {
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0,
      "description": "Open tenders in the same build: the total /v1/tenders returns with the same filter. (The website's own pages count only tenders open for at least 3 more days, so they can be lower.)"
     }
    }
   },
   "BuyerBids": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "buyer",
     "usual_bids",
     "open_tenders"
    ],
    "properties": {
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "usual_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "Hub": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "open_tenders",
     "closing_within_7_days",
     "coming_soon",
     "contracts_ending_within_12_months",
     "median_usual_bids",
     "rating_mix",
     "split",
     "main_buyers",
     "buyers_with_fewest_bids",
     "closing_first",
     "largest",
     "updated",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0,
      "description": "Open tenders in the same build: the total /v1/tenders returns with the same filter. (The website's own pages count only tenders open for at least 3 more days, so they can be lower.)"
     },
     "closing_within_7_days": {
      "type": "integer",
      "minimum": 0
     },
     "coming_soon": {
      "type": "integer",
      "minimum": 0
     },
     "contracts_ending_within_12_months": {
      "type": "integer",
      "minimum": 0,
      "description": "A count only."
     },
     "median_usual_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0,
      "description": "Median of the usual bids of the buyers here."
     },
     "rating_mix": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/RatingMix"
      }
     },
     "split": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/SectorLink"
      },
      "description": "The other dimension: regions for a sector, sectors for a region."
     },
     "main_buyers": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BuyerCount"
      }
     },
     "buyers_with_fewest_bids": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BuyerBids"
      }
     },
     "closing_first": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/TenderRow"
      }
     },
     "largest": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/TenderRow"
      }
     },
     "updated": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self",
       "tenders"
      ],
      "properties": {
       "self": {
        "type": "string"
       },
       "tenders": {
        "type": "string"
       }
      }
     }
    }
   },
   "BuyerBidsRank": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "buyer",
     "usual_bids",
     "earlier_tenders"
    ],
    "properties": {
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "usual_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0
     },
     "earlier_tenders": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "MedianRow": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "median_usual_bids",
     "open_tenders",
     "link"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "median_usual_bids": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0
     },
     "link": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Rankings": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "ranked_buyers",
     "method",
     "fewest_bids",
     "most_bids",
     "sectors",
     "regions",
     "updated",
     "links"
    ],
    "properties": {
     "ranked_buyers": {
      "type": "integer",
      "minimum": 0
     },
     "method": {
      "type": "string"
     },
     "fewest_bids": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BuyerBidsRank"
      }
     },
     "most_bids": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BuyerBidsRank"
      }
     },
     "sectors": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MedianRow"
      }
     },
     "regions": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MedianRow"
      }
     },
     "updated": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self"
      ],
      "properties": {
       "self": {
        "type": "string"
       }
      }
     }
    }
   },
   "Status": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data_as_of",
     "open_tenders",
     "coming_soon",
     "upstream"
    ],
    "properties": {
     "data_as_of": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}.*)?$"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0
     },
     "coming_soon": {
      "type": "integer",
      "minimum": 0
     },
     "upstream": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "bulk_file_date",
       "bulk_content_date",
       "live_check"
      ],
      "properties": {
       "bulk_file_date": {
        "type": [
         "string",
         "null"
        ]
       },
       "bulk_content_date": {
        "type": [
         "string",
         "null"
        ]
       },
       "live_check": {
        "type": [
         "string",
         "null"
        ]
       }
      },
      "description": "How fresh the upstream files are."
     }
    }
   },
   "CoverageSource": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "included",
     "open_tenders",
     "licence",
     "note"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "included": {
      "type": "boolean"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0
     },
     "licence": {
      "type": "string"
     },
     "note": {
      "type": "string"
     }
    }
   },
   "Coverage": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "generated",
     "open_tenders",
     "sources",
     "unknown_source",
     "buyer_identity"
    ],
    "properties": {
     "generated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}.*)?$"
     },
     "open_tenders": {
      "type": "integer",
      "minimum": 0
     },
     "sources": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/CoverageSource"
      }
     },
     "unknown_source": {
      "type": "integer",
      "minimum": 0
     },
     "buyer_identity": {
      "type": "object",
      "description": "Award rows by source: how many carry a durable buyer id, inherit one by exact name, are ambiguous or unknown. Counts only."
     }
    },
    "description": "What BidCount reads and what it does not. Generated from the build, never from a promise."
   },
   "Change": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "type",
     "at",
     "id",
     "title",
     "buyer",
     "closes",
     "value",
     "sector",
     "region",
     "links"
    ],
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "tender.published"
      ]
     },
     "at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}.*)?$"
     },
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "closes": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self"
      ],
      "properties": {
       "self": {
        "type": "string"
       }
      }
     },
     "value": {
      "$ref": "#/components/schemas/Money"
     },
     "sector": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "region": {
      "$ref": "#/components/schemas/RegionRef"
     }
    }
   },
   "SearchHit": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "type",
     "id",
     "title",
     "buyer",
     "date",
     "score",
     "links"
    ],
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "tender",
       "coming-soon",
       "buyer"
      ]
     },
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "type": [
       "string",
       "null"
      ]
     },
     "date": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "score": {
      "type": "number",
      "minimum": 0
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self"
      ],
      "properties": {
       "self": {
        "type": "string"
       }
      }
     }
    }
   },
   "RatingScaleEntry": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "rating",
     "page_label",
     "meaning"
    ],
    "properties": {
     "rating": {
      "type": "string",
      "enum": [
       "thin",
       "typical",
       "contested",
       "unrated"
      ],
      "description": "Schema name of the rating. The site shows it as a label: see x-presentation-labels. It describes the buyer's history of bids, not a forecast for this tender."
     },
     "page_label": {
      "type": "string",
      "description": "The words the website uses for this rating."
     },
     "meaning": {
      "type": "string"
     }
    }
   },
   "ApiIndex": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name",
     "version",
     "status",
     "documentation",
     "openapi",
     "resources",
     "rating_scale"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "version": {
      "type": "string",
      "enum": [
       "1"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "preview"
      ]
     },
     "documentation": {
      "type": "string"
     },
     "openapi": {
      "type": "string"
     },
     "resources": {
      "type": "object",
      "description": "Name to path of each top-level resource."
     },
     "rating_scale": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/RatingScaleEntry"
      }
     }
    }
   },
   "TenderResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Tender"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "ComingSoonResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ComingSoon"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "BuyerResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Buyer"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "HubResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Hub"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "RankingsResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Rankings"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "StatusResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Status"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "CoverageResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Coverage"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "IndexResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ApiIndex"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "TenderList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Tender"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "ComingSoonList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ComingSoon"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "BuyerList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BuyerIndexRow"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "HubList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/HubIndexRow"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "ChangeList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Change"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "SearchList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/SearchHit"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "Every success carries data, meta (as_of, sources, licence, caveats) and links."
   },
   "WatchFilters": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "sectors",
     "regions",
     "cpv_prefixes"
    ],
    "properties": {
     "sectors": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "type": "string"
      },
      "description": "Sector ids (any of). Empty: any sector."
     },
     "regions": {
      "type": "array",
      "maxItems": 12,
      "items": {
       "type": "string"
      },
      "description": "Region ids (any of). Empty: any region."
     },
     "cpv_prefixes": {
      "type": "array",
      "maxItems": 8,
      "items": {
       "type": "string"
      },
      "description": "CPV code prefixes (any of)."
     },
     "q": {
      "type": "string",
      "maxLength": 200,
      "description": "Words to find in the title or buyer name."
     },
     "value_min": {
      "type": "number",
      "minimum": 0
     },
     "value_max": {
      "type": "number",
      "minimum": 0
     },
     "sme_or_vcse": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "Only tenders flagged suitable for small firms or voluntary organisations."
     },
     "exclude_cpv_prefixes": {
      "type": "array",
      "maxItems": 8,
      "items": {
       "type": "string"
      },
      "description": "CPV prefixes to leave out; never makes a watch wider."
     }
    }
   },
   "Watch": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "created",
     "filters",
     "links",
     "summary"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string",
      "maxLength": 60
     },
     "created": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "filters": {
      "$ref": "#/components/schemas/WatchFilters"
     },
     "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "self",
       "new",
       "open"
      ],
      "properties": {
       "self": {
        "type": "string"
       },
       "new": {
        "type": "string"
       },
       "open": {
        "type": "string"
       }
      }
     },
     "summary": {
      "type": "string",
      "description": "The filters in plain English: lists mean any of, different filters must all pass."
     }
    },
    "description": "A saved search of the key's owner: a name and filters, nothing else."
   },
   "WatchInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "sectors": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "type": "string"
      },
      "description": "Sector ids (any of)."
     },
     "regions": {
      "type": "array",
      "maxItems": 12,
      "items": {
       "type": "string"
      },
      "description": "Region ids (any of)."
     },
     "cpv_prefixes": {
      "type": "array",
      "maxItems": 8,
      "items": {
       "type": "string"
      },
      "description": "CPV code prefixes (any of)."
     },
     "q": {
      "type": "string",
      "maxLength": 200
     },
     "value_min": {
      "type": "number",
      "minimum": 0
     },
     "value_max": {
      "type": "number",
      "minimum": 0
     },
     "sme_or_vcse": {
      "type": "boolean",
      "enum": [
       true
      ]
     },
     "exclude_cpv_prefixes": {
      "type": "array",
      "maxItems": 8,
      "items": {
       "type": "string"
      },
      "description": "CPV prefixes to leave out; never makes a watch wider."
     }
    },
    "description": "Give a name and at least one filter. Lists mean any of; different filters must all pass."
   },
   "WatchOne": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/Watch"
     }
    }
   },
   "WatchList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Watch"
      }
     },
     "meta": {
      "type": "object"
     }
    }
   },
   "WatchTenders": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "type": "object"
      },
      "description": "Rows of the public tender list (see Tender); /new rows add first_seen."
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "WatchMark": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "tender_id",
     "mark",
     "open"
    ],
    "properties": {
     "tender_id": {
      "type": "string"
     },
     "mark": {
      "type": "string",
      "enum": [
       "seen",
       "ignored",
       "pursuing"
      ]
     },
     "open": {
      "type": "boolean",
      "description": "false once the tender has closed; the mark is dropped the next time a mark is made."
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "type": "string"
     },
     "closes": {
      "type": "string"
     }
    }
   },
   "ProContract": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "title",
     "buyer",
     "incumbents",
     "value",
     "ends",
     "ends_horizon",
     "may_run_on_to",
     "term_months",
     "sector",
     "region",
     "cpv",
     "possibly_one_off",
     "last_competition",
     "source",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Stable between builds while the record is unchanged."
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "incumbents": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Who holds the contract today, as the award notice or register names them. Empty when the source names no organisation."
     },
     "value": {
      "$ref": "#/components/schemas/Money"
     },
     "ends": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The end date on the award notice. Contracts are often extended or re-tendered early or late."
     },
     "ends_horizon": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "within_6_months",
       "within_12_months",
       null
      ]
     },
     "may_run_on_to": {
      "type": [
       "string",
       "null"
      ],
      "description": "YYYY-MM when the notice allows it to run on."
     },
     "term_months": {
      "type": [
       "number",
       "null"
      ]
     },
     "sector": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "region": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "cpv": {
      "type": [
       "string",
       "null"
      ]
     },
     "possibly_one_off": {
      "type": "boolean",
      "description": "Tagged when it may be a one-off project that will not be re-tendered."
     },
     "last_competition": {
      "$ref": "#/components/schemas/ProLastCompetition"
     },
     "source": {
      "type": "string",
      "enum": [
       "notice",
       "council_register"
      ]
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProFramework": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "title",
     "buyer",
     "suppliers",
     "supplier_count",
     "value",
     "ends",
     "may_run_on_to",
     "sector",
     "region",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "suppliers": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "The suppliers on the agreement."
     },
     "supplier_count": {
      "type": "integer"
     },
     "value": {
      "$ref": "#/components/schemas/Money"
     },
     "ends": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The end date on the notice."
     },
     "may_run_on_to": {
      "type": [
       "string",
       "null"
      ]
     },
     "sector": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "region": {
      "$ref": "#/components/schemas/SectorRef"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProIncumbent": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "tender_id",
     "incumbent",
     "links"
    ],
    "properties": {
     "tender_id": {
      "type": "string"
     },
     "incumbent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "name",
       "contract_title",
       "contract_ends",
       "contract_value_gbp",
       "similarity"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "contract_title": {
        "type": [
         "string",
         "null"
        ]
       },
       "contract_ends": {
        "type": [
         "string",
         "null"
        ]
       },
       "contract_value_gbp": {
        "type": [
         "number",
         "null"
        ]
       },
       "similarity": {
        "type": [
         "number",
         "null"
        ],
        "description": "0 to 1: how closely the earlier contract matches this tender's title."
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "The supplier BidCount names as the probable holder of the contract this tender replaces. A match on titles and buyer, not a statement from the buyer."
   },
   "ProBuyerIntel": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "name",
     "public_id",
     "awards_since_2023_10",
     "usual_value_gbp",
     "usual_term_months",
     "usual_bids",
     "top_suppliers",
     "procurement_mailbox",
     "sme_bid_share",
     "single_bid_share",
     "direct_award_share",
     "recent_competitions",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "public_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "The buyer's id on /v1/buyers, when BidCount has a public page for it."
     },
     "awards_since_2023_10": {
      "type": [
       "integer",
       "null"
      ]
     },
     "usual_value_gbp": {
      "type": [
       "number",
       "null"
      ]
     },
     "usual_term_months": {
      "type": [
       "number",
       "null"
      ]
     },
     "usual_bids": {
      "type": [
       "number",
       "null"
      ]
     },
     "top_suppliers": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": false,
       "required": [
        "name",
        "awards",
        "value_gbp"
       ],
       "properties": {
        "name": {
         "type": "string"
        },
        "awards": {
         "type": [
          "integer",
          "null"
         ]
        },
        "value_gbp": {
         "type": [
          "number",
          "null"
         ]
        }
       }
      }
     },
     "procurement_mailbox": {
      "type": [
       "string",
       "null"
      ],
      "description": "The role mailbox the buyer's notices give as the procurement contact. Never a named person."
     },
     "sme_bid_share": {
      "$ref": "#/components/schemas/ProShare"
     },
     "single_bid_share": {
      "$ref": "#/components/schemas/ProShare"
     },
     "direct_award_share": {
      "$ref": "#/components/schemas/ProShare"
     },
     "recent_competitions": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": false,
       "required": [
        "title",
        "bids",
        "month"
       ],
       "properties": {
        "title": {
         "type": "string"
        },
        "bids": {
         "type": [
          "number",
          "null"
         ]
        },
        "month": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProContractList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ProContract"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProContractResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ProContract"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProFrameworkList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ProFramework"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProFrameworkResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ProFramework"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProIncumbentList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ProIncumbent"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProIncumbentResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ProIncumbent"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProBuyerIntelList": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ProBuyerIntel"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/ListMeta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProBuyerIntelResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ProBuyerIntel"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProShare": {
    "type": [
     "object",
     "null"
    ],
    "additionalProperties": false,
    "required": [
     "share",
     "based_on"
    ],
    "properties": {
     "share": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
     },
     "based_on": {
      "type": [
       "integer",
       "null"
      ],
      "description": "How many procurements the share rests on."
     }
    },
    "description": "null when the buyer has too few procurements to say."
   },
   "ProLastCompetition": {
    "type": [
     "object",
     "null"
    ],
    "additionalProperties": false,
    "required": [
     "bids",
     "sme_bids"
    ],
    "properties": {
     "bids": {
      "type": "integer"
     },
     "sme_bids": {
      "type": [
       "integer",
       "null"
      ]
     }
    },
    "description": "How many bids the last competition for this contract drew; null when not known."
   },
   "ProSupplierContract": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "id",
     "title",
     "buyer",
     "value_gbp",
     "start",
     "end",
     "source",
     "suppliers_on_notice",
     "links"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "buyer": {
      "$ref": "#/components/schemas/BuyerRef"
     },
     "value_gbp": {
      "type": [
       "number",
       "null"
      ],
      "description": "null when no value is stated. With more than one supplier on the notice, the notice's whole value, not this company's share."
     },
     "start": {
      "type": [
       "string",
       "null"
      ]
     },
     "end": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": "string",
      "enum": [
       "cf",
       "fts",
       "council"
      ],
      "description": "cf: Contracts Finder; fts: Find a Tender; council: a council's own contracts register."
     },
     "suppliers_on_notice": {
      "type": [
       "integer",
       "null"
      ]
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   },
   "ProSupplier": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "company_number",
     "total",
     "shown",
     "contracts",
     "links"
    ],
    "properties": {
     "company_number": {
      "type": "string"
     },
     "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Contracts the index holds for the company."
     },
     "shown": {
      "type": "integer",
      "minimum": 0,
      "description": "How many are returned: the newest, at most 40."
     },
     "contracts": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ProSupplierContract"
      }
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    },
    "description": "The public contracts a limited company has won, newest first. Found by Companies House number only: there is no search by name, and sole traders are not in the index."
   },
   "ProSupplierResponse": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "data",
     "meta",
     "links"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/ProSupplier"
     },
     "meta": {
      "$ref": "#/components/schemas/Meta"
     },
     "links": {
      "$ref": "#/components/schemas/Links"
     }
    }
   }
  },
  "parameters": {
   "q": {
    "name": "q",
    "in": "query",
    "required": false,
    "description": "Search words. Same language as the site's search box: words (all must match), OR, -word or NOT word, \"exact phrase\", and filters buyer:, sector:, region:, kind:, cpv:. The held: filter (supplier names) is refused.",
    "schema": {
     "type": "string",
     "maxLength": 200
    }
   },
   "sector": {
    "name": "sector",
    "in": "query",
    "required": false,
    "description": "Sector id, as in /v1/sectors. Ids only: the MCP tools and /ask also take a sector name, resolve it to this same id, and then filter identically. Up to 6 ids separated by commas mean any of them.",
    "schema": {
     "type": "string",
     "pattern": "^[a-z0-9-]{1,80}(,[a-z0-9-]{1,80}){0,5}$"
    }
   },
   "region": {
    "name": "region",
    "in": "query",
    "required": false,
    "description": "Region id, as in /v1/regions. Ids only (the MCP tools also take a name and resolve it to this id first; the rows kept are the same). Up to 12 ids separated by commas mean any of them.",
    "schema": {
     "type": "string",
     "pattern": "^[a-z0-9-]{1,80}(,[a-z0-9-]{1,80}){0,11}$"
    }
   },
   "buyer": {
    "name": "buyer",
    "in": "query",
    "required": false,
    "description": "Buyer id, as in /v1/buyers. Ids only: the MCP tools also take a name and resolve it to the same id. A buyer with no page of its own has no id; find its tenders with q=buyer:name.",
    "schema": {
     "type": "string",
     "pattern": "^[a-z0-9-]{1,80}$"
    }
   },
   "cpv": {
    "name": "cpv",
    "in": "query",
    "required": false,
    "description": "CPV code prefix: a row matches when its code starts with these digits (cpv=4530 matches 45300000; cpv=3000 does not). Up to 8 prefixes separated by commas mean any of them.",
    "schema": {
     "type": "string",
     "pattern": "^[0-9]{1,8}(,[0-9]{1,8}){0,7}$"
    }
   },
   "value_min": {
    "name": "value_min",
    "in": "query",
    "required": false,
    "description": "Lowest stated value in pounds, inclusive. Only a real stated value counts: a ceiling (the most a framework may be worth) and a row with no stated value are left out. The MCP tools' min_value_gbp is the same rule.",
    "schema": {
     "type": "number",
     "minimum": 0
    }
   },
   "value_max": {
    "name": "value_max",
    "in": "query",
    "required": false,
    "description": "Highest value in pounds, inclusive. A ceiling at or under the figure is kept (the value cannot exceed it); a row with no stated value is left out. The MCP tools' max_value_gbp is the same rule.",
    "schema": {
     "type": "number",
     "minimum": 0
    }
   },
   "closes_from": {
    "name": "closes_from",
    "in": "query",
    "required": false,
    "description": "Closing date on or after this day (inclusive). The MCP tools' closing_within_days is the range from today to today plus that many days, with the same inclusive ends.",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "closes_to": {
    "name": "closes_to",
    "in": "query",
    "required": false,
    "description": "Closing date on or before this day (inclusive).",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "expected_from": {
    "name": "expected_from",
    "in": "query",
    "required": false,
    "description": "Expected date on or after this day.",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "expected_to": {
    "name": "expected_to",
    "in": "query",
    "required": false,
    "description": "Expected date on or before this day.",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "rating": {
    "name": "rating",
    "in": "query",
    "required": false,
    "description": "The buyer's rating (schema name).",
    "schema": {
     "type": "string",
     "enum": [
      "thin",
      "typical",
      "contested",
      "unrated"
     ]
    }
   },
   "kind": {
    "name": "kind",
    "in": "query",
    "required": false,
    "description": "Notice kind.",
    "schema": {
     "type": "string",
     "enum": [
      "contract",
      "list"
     ]
    }
   },
   "stage": {
    "name": "stage",
    "in": "query",
    "required": false,
    "description": "Coming-soon stage.",
    "schema": {
     "type": "string",
     "enum": [
      "planned",
      "engagement"
     ]
    }
   },
   "sme_suitable": {
    "name": "sme_suitable",
    "in": "query",
    "required": false,
    "description": "Keep tenders whose notice sets the SME-suitable flag, and drop the rest (a notice with no flags is dropped). The voluntary-sector (VCSE) flag is not counted: use sme_or_vcse_suitable for either.",
    "schema": {
     "type": "string",
     "enum": [
      "true"
     ]
    }
   },
   "sme_or_vcse_suitable": {
    "name": "sme_or_vcse_suitable",
    "in": "query",
    "required": false,
    "description": "Keep tenders whose notice sets the SME-suitable flag or the voluntary-sector (VCSE) flag, and drop the rest. This is what the MCP tools' sme_or_vcse_per_notice=true asks for.",
    "schema": {
     "type": "string",
     "enum": [
      "true"
     ]
    }
   },
   "exclude_ceiling": {
    "name": "exclude_ceiling",
    "in": "query",
    "required": false,
    "description": "Leave out frameworks and other ceiling values.",
    "schema": {
     "type": "string",
     "enum": [
      "true"
     ]
    }
   },
   "tender_sort": {
    "name": "sort",
    "in": "query",
    "required": false,
    "description": "Order. Default closes (soonest first), or relevance when q is given. Rows with no value sort last either way. relevance needs q.",
    "schema": {
     "type": "string",
     "enum": [
      "closes",
      "-closes",
      "value",
      "-value",
      "relevance"
     ]
    }
   },
   "soon_sort": {
    "name": "sort",
    "in": "query",
    "required": false,
    "description": "Order. Default expected (soonest first), or relevance when q is given.",
    "schema": {
     "type": "string",
     "enum": [
      "expected",
      "-expected",
      "value",
      "-value",
      "relevance"
     ]
    }
   },
   "limit": {
    "name": "limit",
    "in": "query",
    "required": false,
    "description": "Page size, 1 to 200.",
    "schema": {
     "type": "integer",
     "minimum": 1,
     "maximum": 200,
     "default": 50
    }
   },
   "cursor": {
    "name": "cursor",
    "in": "query",
    "required": false,
    "description": "The cursor from links.next. It only works with the parameters it was issued for.",
    "schema": {
     "type": "string",
     "maxLength": 400
    }
   },
   "type": {
    "name": "type",
    "in": "query",
    "required": false,
    "description": "Only this kind of hit.",
    "schema": {
     "type": "string",
     "enum": [
      "tender",
      "coming-soon",
      "buyer"
     ]
    }
   },
   "since": {
    "name": "since",
    "in": "query",
    "required": false,
    "description": "Lists every open tender first seen after this day (first-seen days start on the day tracking began; the note in meta gives the earliest), newest first. Without it, only tenders first seen in the latest build.",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "q_search": {
    "name": "q",
    "in": "query",
    "required": true,
    "description": "Search words. Same language as the site's search box: words (all must match), OR, -word or NOT word, \"exact phrase\", and filters buyer:, sector:, region:, kind:, cpv:. The held: filter (supplier names) is refused.",
    "schema": {
     "type": "string",
     "maxLength": 200
    }
   },
   "q_names": {
    "name": "q",
    "in": "query",
    "required": false,
    "description": "Words that must all appear in the name.",
    "schema": {
     "type": "string",
     "maxLength": 200
    }
   },
   "Id": {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
     "type": "string",
     "pattern": "^[A-Za-z0-9._-]{1,100}$"
    },
    "description": "The resource's id as given in a list."
   },
   "hide_seen": {
    "name": "hide_seen",
    "in": "query",
    "required": false,
    "description": "true: leave out tenders marked seen or ignored in this watch (pursuing stays); false or absent: leave nothing out.",
    "schema": {
     "type": "boolean"
    }
   },
   "until": {
    "name": "until",
    "in": "query",
    "required": false,
    "description": "Only tenders first seen on or before this day (with since, one week's tenders).",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "pro_q": {
    "name": "q",
    "in": "query",
    "required": false,
    "description": "Words that must all appear in the title, buyer or supplier names. Case and punctuation are ignored.",
    "schema": {
     "type": "string",
     "maxLength": 120
    }
   },
   "holder": {
    "name": "holder",
    "in": "query",
    "required": false,
    "description": "Words that must all appear in a supplier name: the supplier holding the contract, or on the framework.",
    "schema": {
     "type": "string",
     "maxLength": 120
    }
   },
   "ends_from": {
    "name": "ends_from",
    "in": "query",
    "required": false,
    "description": "Keep contracts that end on or after this day (YYYY-MM-DD).",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "ends_to": {
    "name": "ends_to",
    "in": "query",
    "required": false,
    "description": "Keep contracts that end on or before this day (YYYY-MM-DD).",
    "schema": {
     "type": "string",
     "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
   },
   "contract_source": {
    "name": "source",
    "in": "query",
    "required": false,
    "description": "Where the record came from: a contract award notice, or a council's own contracts register.",
    "schema": {
     "type": "string",
     "enum": [
      "notice",
      "council_register"
     ]
    }
   },
   "pro_sort": {
    "name": "sort",
    "in": "query",
    "required": false,
    "description": "Sort order. A minus sign reverses it. Ties break by id.",
    "schema": {
     "type": "string",
     "enum": [
      "ends",
      "-ends",
      "value",
      "-value"
     ],
     "default": "ends"
    }
   },
   "buyer_q": {
    "name": "buyer_q",
    "in": "query",
    "required": false,
    "description": "Words that must all appear in the buyer's name.",
    "schema": {
     "type": "string",
     "maxLength": 120
    }
   }
  },
  "responses": {
   "NotModified": {
    "description": "Not modified: the ETag you sent is still current. No body."
   },
   "Invalid": {
    "description": "An unknown or malformed parameter.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "NotFound": {
    "description": "No such resource or id.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "NotAcceptable": {
    "description": "The Accept header excludes JSON.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "RateLimited": {
    "description": "Too many requests from one address in a minute. Retry-After says when.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "Unavailable": {
    "description": "The data could not be read. Retry-After says when to try again.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "InvalidRequest": {
    "description": "A parameter or the body is not valid; errors names each.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "PaidTierRequired": {
    "description": "The account behind the key is not on Pro, or the key was issued without Pro access.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "AccountKeyRequired": {
    "description": "The key belongs to no account (it was issued by hand).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "Conflict": {
    "description": "The request clashes with what is there: a limit, already set up, nothing to change.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   }
  },
  "headers": {
   "ETag": {
    "description": "Send it back as If-None-Match to get a 304 when nothing changed.",
    "schema": {
     "type": "string"
    }
   },
   "Link": {
    "description": "rel=next when there is another page.",
    "schema": {
     "type": "string"
    }
   }
  },
  "securitySchemes": {
   "ApiKey": {
    "type": "http",
    "scheme": "bearer",
    "description": "An API key made in Settings by an account on Pro (or issued by BidCount by hand), also accepted as the X-API-Key header."
   }
  }
 },
 "x-presentation-labels": {
  "description": "The rating values in the API are the schema names. The website words them differently; these are the website's labels, for display only. The API never returns the labels as values.",
  "thin": "few bidders (a median of 4 or fewer)",
  "typical": "a typical contest (more than 4 and fewer than 8)",
  "contested": "crowded (8 or more)",
  "unrated": "not enough history to rate"
 },
 "security": [
  {
   "ApiKey": []
  }
 ]
}
