{"openapi":"3.1.0","info":{"title":"Spatial Planning Platform API","version":"0.1.0","description":"The JSON interface of the platform. Map layers for GIS software are published separately as WMS, WFS and OGC API Features at https://planning.getayoweb.com/geoserver."},"servers":[{"url":"https://planning.getayoweb.com"}],"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"authjs.session-token","description":"The session cookie set by signing in through the platform's OpenID Connect sign in."}}},"paths":{"/api/districts":{"get":{"summary":"Districts and boroughs","description":"Codes, names, areas and outlines of the districts, with their projections.","x-access":"Anyone","responses":{"200":{"description":"A list of districts.","content":{"application/json":{}}}}}},"/api/tiles/{layer}/{z}/{x}/{y}":{"get":{"summary":"Map tile","description":"A Mapbox Vector Tile of one dataset at its current version, in Web Mercator, layer name \"layer\".","x-access":"Anyone","parameters":[{"name":"layer","in":"path","description":"Dataset id from the catalogue, such as green-belt.","schema":{"type":"string"},"required":true},{"name":"z","in":"path","description":"Zoom, 0 to 18.","schema":{"type":"integer"},"required":true},{"name":"x","in":"path","description":"Tile column.","schema":{"type":"integer"},"required":true},{"name":"y","in":"path","description":"Tile row.","schema":{"type":"integer"},"required":true}],"responses":{"200":{"description":"The tile.","content":{"application/vnd.mapbox-vector-tile":{}}},"404":{"description":"Not found."}}}},"/api/site-check":{"post":{"summary":"Check a site","description":"Constraints, nearest stations, brownfield sites nearby and an indicative score for an outline given in longitude and latitude.","x-access":"Anyone","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ring":{"minItems":3,"maxItems":400,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["ring"]}}}},"responses":{"200":{"description":"The site report.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/scenarios":{"get":{"summary":"List scenarios","x-access":"Anyone","responses":{"200":{"description":"Scenarios with their homes and sites.","content":{"application/json":{}}}}},"post":{"summary":"Create a scenario","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"default":"","type":"string","maxLength":400}},"required":["name"]}}}},"responses":{"201":{"description":"The new scenario id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}}},"/api/scenarios/{id}":{"get":{"summary":"A scenario with its measures and sites","x-access":"Anyone","parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true},{"name":"format","in":"query","description":"geojson for the sites as a FeatureCollection for GIS, csv for a table.","schema":{"type":"string","enum":["geojson","csv"]},"required":false}],"responses":{"200":{"description":"The scenario.","content":{"application/json":{}}},"404":{"description":"Not found."}}},"delete":{"summary":"Delete a scenario","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/scenarios/{id}/sites":{"post":{"summary":"Add sites","description":"Brownfield register sites by reference, all sites in a district, all sites near stations, or a new growth location.","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"brownfield"},"sourceRefs":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","maxLength":40}}},"required":["kind","sourceRefs"]},{"type":"object","properties":{"kind":{"type":"string","const":"brownfield-district"},"districtCode":{"type":"string","pattern":"^E\\d{8}$"}},"required":["kind","districtCode"]},{"type":"object","properties":{"kind":{"type":"string","const":"brownfield-near-station"},"metres":{"type":"integer","minimum":100,"maximum":5000}},"required":["kind","metres"]},{"type":"object","properties":{"kind":{"type":"string","const":"new"},"name":{"type":"string","minLength":1,"maxLength":80},"lng":{"type":"number","minimum":-180,"maximum":180},"lat":{"type":"number","minimum":-90,"maximum":90},"areaHa":{"type":"number","minimum":0.1,"maximum":2000},"homes":{"type":"integer","minimum":1,"maximum":50000},"jobs":{"default":0,"type":"integer","minimum":0,"maximum":100000}},"required":["kind","name","lng","lat","areaHa","homes"]}]}}}},"responses":{"200":{"description":"How many sites were added.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}},"delete":{"summary":"Remove every site","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/scenarios/{id}/sites/{siteId}":{"patch":{"summary":"Change a site's homes or jobs","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true},{"name":"siteId","in":"path","description":"Site id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"homes":{"type":"integer","minimum":0,"maximum":50000},"jobs":{"type":"integer","minimum":0,"maximum":100000}}}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}},"delete":{"summary":"Remove a site","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true},{"name":"siteId","in":"path","description":"Site id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/scenarios/{id}/comments":{"get":{"summary":"Comments on a scenario","x-access":"Signed in with the scenarios.view permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true}],"responses":{"200":{"description":"Comments, oldest first.","content":{"application/json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}},"post":{"summary":"Add a comment","description":"On the whole scenario, or on one of its sites.","x-access":"Signed in with the comments.write permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2000},"siteId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["body","siteId"]}}}},"responses":{"201":{"description":"The new comment id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/scenarios/{id}/comments/{commentId}":{"patch":{"summary":"Resolve a comment","description":"By its author, or by someone who may edit scenarios.","x-access":"Signed in with the comments.write permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Scenario id.","schema":{"type":"integer"},"required":true},{"name":"commentId","in":"path","description":"Comment id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"const":true}},"required":["resolved"]}}}},"responses":{"200":{"description":"Resolved.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/uploads":{"post":{"summary":"Check a file","description":"GeoJSON or a zipped Shapefile, field \"file\", up to 50 MB. Returns the checks; nothing is published.","x-access":"Signed in with the datasets.upload permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"201":{"description":"The upload with its report.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/uploads/{id}/preview":{"get":{"summary":"Checked shapes","description":"GeoJSON in longitude and latitude, for a preview.","x-access":"Signed in with the datasets.upload permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Upload id.","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"A FeatureCollection.","content":{"application/geo+json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/uploads/{id}/publish":{"post":{"summary":"Publish a checked file","description":"As a new dataset, or as the next version of a dataset the team added.","x-access":"Signed in with the datasets.upload permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Upload id.","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":120},"summary":{"type":"string","minLength":3,"maxLength":500},"owner":{"type":"string","minLength":2,"maxLength":120},"licence":{"type":"string","minLength":2,"maxLength":120},"nameField":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"target":{"type":"string","maxLength":80}},"required":["title","summary","owner","licence","nameField","target"]}}}},"responses":{"201":{"description":"The dataset id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/trajectories":{"get":{"summary":"Housing trajectories in use","description":"One per district that has loaded one: the five years, homes per year and who loaded it.","x-access":"Anyone","responses":{"200":{"description":"A list of trajectories.","content":{"application/json":{}}}}},"post":{"summary":"Check or load a housing trajectory","description":"CSV with site_reference, site_name, category and year_1 to year_5 (template at /trajectory-template.csv), plus district (ONS code) and startYear. Without confirm=1 the file is only checked. With it, a file that passes replaces the district's trajectory in use.","x-access":"Signed in with the datasets.upload permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"200":{"description":"The checks. 201 with the id when loaded.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/trajectories/{district}":{"delete":{"summary":"Stop using a district's trajectory","description":"The land supply goes back to the open data floor; the trajectory stays on record.","x-access":"Signed in with the datasets.upload permission","security":[{"session":[]}],"parameters":[{"name":"district","in":"path","description":"ONS code of the district, such as E07000209.","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Stopped."},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/projects":{"get":{"summary":"Infrastructure projects","description":"Every project with its cost, money secured, stage and reach. With scenario, each project also lists that scenario's locations within its reach, which is what the investment ranking is built on.","x-access":"Anyone","parameters":[{"name":"scenario","in":"query","description":"Scenario id to measure the projects against.","schema":{"type":"integer"},"required":false}],"responses":{"200":{"description":"A list of projects.","content":{"application/json":{}}},"400":{"description":"The request is not valid."}}},"post":{"summary":"Add an infrastructure project","description":"Cost and money secured are whole pounds; reachM is in metres. Refused with 422 when the place is outside the county.","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["transport","education","health","utilities","flood","green"]},"stage":{"type":"string","enum":["idea","planned","committed","underway"]},"description":{"default":"","type":"string","maxLength":400},"cost":{"type":"integer","minimum":1000,"maximum":50000000000},"funded":{"default":0,"type":"integer","minimum":0,"maximum":50000000000},"year":{"default":null,"anyOf":[{"type":"integer","minimum":2020,"maximum":2100},{"type":"null"}]},"reachM":{"type":"integer","minimum":100,"maximum":50000},"lng":{"type":"number","minimum":-180,"maximum":180},"lat":{"type":"number","minimum":-90,"maximum":90}},"required":["name","kind","stage","cost","reachM","lng","lat"]}}}},"responses":{"201":{"description":"The new project's id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/projects/{id}":{"put":{"summary":"Change an infrastructure project","description":"The place is kept unless lng and lat are given.","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Project id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["transport","education","health","utilities","flood","green"]},"stage":{"type":"string","enum":["idea","planned","committed","underway"]},"description":{"default":"","type":"string","maxLength":400},"cost":{"type":"integer","minimum":1000,"maximum":50000000000},"funded":{"default":0,"type":"integer","minimum":0,"maximum":50000000000},"year":{"default":null,"anyOf":[{"type":"integer","minimum":2020,"maximum":2100},{"type":"null"}]},"reachM":{"type":"integer","minimum":100,"maximum":50000},"lng":{"type":"number","minimum":-180,"maximum":180},"lat":{"type":"number","minimum":-90,"maximum":90}},"required":["name","kind","stage","cost","reachM"]}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."}}},"delete":{"summary":"Remove an infrastructure project","x-access":"Signed in with the scenarios.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Project id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/assistant":{"post":{"summary":"Ask the evidence assistant","description":"Answers with the datasets and policy paragraphs it used. Every exchange is logged.","x-access":"Signed in with the assistant.use permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"question":{"type":"string","minLength":3,"maxLength":500},"locale":{"default":"en-GB","type":"string","maxLength":10}},"required":["question"]}}}},"responses":{"200":{"description":"The answer, citations and references.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"503":{"description":"Switched off on this installation."}}}},"/api/strategy":{"get":{"summary":"The strategy in one read","description":"Its title, its policies, the timetable in effect and what the key diagram still lacks.","x-access":"Anyone","responses":{"200":{"description":"The strategy.","content":{"application/json":{}}}}},"put":{"summary":"Change the strategy's title or adoption day","description":"The title must include the words spatial development strategy.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"adoptedOn":{"default":null,"type":["string","null"]}},"required":["title"]}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}}},"/api/strategy/policies":{"get":{"summary":"List policies","x-access":"Anyone","responses":{"200":{"description":"The policies, in order of reference.","content":{"application/json":{}}}}},"post":{"summary":"Add a policy","description":"Refused with 422 when the reference is already in use.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":12,"pattern":"^[A-Za-z0-9. ]+$"},"title":{"type":"string","minLength":1,"maxLength":120},"theme":{"type":"string","enum":["strategy","housing","economy","transport","environment","climate","infrastructure"]},"summary":{"default":"","type":"string","maxLength":1200},"wholeArea":{"default":false,"type":"boolean"},"indicators":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}},"required":["ref","title","theme"]}}}},"responses":{"201":{"description":"The new policy id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/strategy/policies/{id}":{"put":{"summary":"Change a policy","description":"Refused with 422 when the reference is already in use.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Policy id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":12,"pattern":"^[A-Za-z0-9. ]+$"},"title":{"type":"string","minLength":1,"maxLength":120},"theme":{"type":"string","enum":["strategy","housing","economy","transport","environment","climate","infrastructure"]},"summary":{"default":"","type":"string","maxLength":1200},"wholeArea":{"default":false,"type":"boolean"},"indicators":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}},"required":["ref","title","theme"]}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."}}},"delete":{"summary":"Remove a policy","description":"Also removes what illustrates it on the key diagram.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Policy id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/strategy/timetable":{"get":{"summary":"The timetable and its earlier versions","description":"Every version, the one in effect first. With format=csv: the one in effect as a table, one line per stage.","x-access":"Anyone","parameters":[{"name":"format","in":"query","description":"csv for a table of the timetable in effect.","schema":{"type":"string","enum":["csv"]},"required":false}],"responses":{"200":{"description":"A list of versions, or text/csv with format=csv.","content":{"application/json":{}}}}},"post":{"summary":"Revise the timetable","description":"Brings a new version into effect, with the reason for it. Refused with 422 and the list of problems when the dates are out of order, a stage is marked done on a day yet to come, or there are fewer than twelve weeks between publishing the draft and submitting it.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dates":{"type":"object","properties":{"commencement":{"type":"object","properties":{"planned":{"type":"string"},"actual":{"default":null,"type":["string","null"]}},"required":["planned"]},"draft":{"type":"object","properties":{"planned":{"type":"string"},"actual":{"default":null,"type":["string","null"]}},"required":["planned"]},"submission":{"type":"object","properties":{"planned":{"type":"string"},"actual":{"default":null,"type":["string","null"]}},"required":["planned"]},"final":{"type":"object","properties":{"planned":{"type":"string"},"actual":{"default":null,"type":["string","null"]}},"required":["planned"]},"adoption":{"type":"object","properties":{"planned":{"type":"string"},"actual":{"default":null,"type":["string","null"]}},"required":["planned"]}},"required":["commencement","draft","submission","final","adoption"]},"reason":{"type":"string","minLength":1,"maxLength":600}},"required":["dates","reason"]}}}},"responses":{"201":{"description":"The new version.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/strategy/diagram":{"get":{"summary":"The key diagram","description":"Its elements and the check against regulation 5. With format=geojson: the placed elements as a FeatureCollection, for GIS.","x-access":"Anyone","parameters":[{"name":"format","in":"query","description":"geojson for the placed elements as a FeatureCollection.","schema":{"type":"string","enum":["geojson"]},"required":false}],"responses":{"200":{"description":"The elements and the check, or application/geo+json with format=geojson.","content":{"application/json":{}}}}},"post":{"summary":"Add an element to the key diagram","description":"A dataset layer, or a shape in longitude and latitude, that illustrates one policy. The shape must match the kind of element.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"policyId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["growth","centre","infrastructure","corridor","green","area","layer"]},"label":{"default":"","type":"string","maxLength":60},"datasetId":{"default":null,"anyOf":[{"type":"string","enum":["green-belt","area-of-outstanding-natural-beauty","flood-risk-zone","site-of-special-scientific-interest","special-protection-area","special-area-of-conservation","ancient-woodland","scheduled-monument","park-and-garden"]},{"type":"null"}]},"geometry":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"Point"},"coordinates":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}},"required":["type","coordinates"]},{"type":"object","properties":{"type":{"type":"string","const":"LineString"},"coordinates":{"minItems":2,"maxItems":200,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}},"required":["type","coordinates"]},{"type":"object","properties":{"type":{"type":"string","const":"Polygon"},"coordinates":{"minItems":1,"maxItems":1,"type":"array","items":{"minItems":4,"maxItems":400,"type":"array","items":{"type":"array","prefixItems":[{"type":"number","minimum":-180,"maximum":180},{"type":"number","minimum":-90,"maximum":90}],"items":false,"minItems":2,"maxItems":2}}}},"required":["type","coordinates"]}]},{"type":"null"}]}},"required":["policyId","kind"]}}}},"responses":{"201":{"description":"The new element id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/strategy/diagram/{id}":{"delete":{"summary":"Remove an element from the key diagram","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Element id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/strategy/monitoring-report":{"get":{"summary":"Annual monitoring report","description":"The figures as they stand today: every indicator, each policy set against its own, and the case for altering or replacing the strategy.","x-access":"Anyone","parameters":[{"name":"year","in":"query","description":"Report year, four digits. The current year when left out.","schema":{"type":"integer"},"required":false}],"responses":{"200":{"description":"The report's figures.","content":{"application/json":{}}}}},"put":{"summary":"Save the case for altering or replacing the strategy","description":"For one report year.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"year":{"type":"integer","minimum":2020,"maximum":2100},"justification":{"type":"string","maxLength":4000}},"required":["year","justification"]}}}},"responses":{"200":{"description":"Saved.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}}},"/api/strategy/engagement":{"get":{"summary":"Engagement with the consultation bodies","x-access":"Anyone","responses":{"200":{"description":"Engagement records, newest first.","content":{"application/json":{}}}}},"post":{"summary":"Record an engagement","description":"With which body, on what day and what came of it.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","enum":["active_travel","telecoms","canal_river","civil_aviation","sport_england","environment_agency","forestry","highways_authority","historic_england","homes_england","integrated_care","electricity","gas","sewerage","water","coal","marine","transport_authority","flood_authority","national_highways","natural_england","neighbourhood_forum","network_rail","nhs_england","nuclear","rail_road","parish","other"]},"organisation":{"default":"","type":"string","maxLength":120},"happenedOn":{"type":"string"},"summary":{"type":"string","minLength":1,"maxLength":1000}},"required":["body","happenedOn","summary"]}}}},"responses":{"201":{"description":"The new record id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}}},"/api/strategy/engagement/{id}":{"delete":{"summary":"Remove an engagement record","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Record id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/strategy/links":{"post":{"summary":"Link a policy to its justification","description":"Ties a policy to a piece of evidence, a policy of the Framework, or an alternative that was considered. An alternative needs an outcome; other links have none.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"policyId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["evidence","framework","alternative"]},"target":{"default":"","type":"string","maxLength":60},"label":{"default":"","type":"string","maxLength":120},"outcome":{"default":null,"anyOf":[{"type":"string","enum":["preferred","rejected","open"]},{"type":"null"}]},"note":{"default":"","type":"string","maxLength":800}},"required":["policyId","kind"]}}}},"responses":{"201":{"description":"The new link id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/strategy/links/{id}":{"delete":{"summary":"Remove a link","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Link id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/strategy/soundness":{"get":{"summary":"The soundness trail","description":"For each policy, what the record holds against the four tests of Framework policy PM14 and what is missing, and the content policy PM1(2) asks of a strategy set against what is in place.","x-access":"Anyone","responses":{"200":{"description":"The policies with their tests, and the content check.","content":{"application/json":{}}}}}},"/api/strategy/plan-data":{"get":{"summary":"The strategy as open data","description":"CSV in the shape of the approved data standard for plans. The address stays the same as the data changes.","x-access":"Anyone","parameters":[{"name":"dataset","in":"query","description":"plan (the default) or timetable.","schema":{"type":"string","enum":["plan","timetable"]},"required":false}],"responses":{"200":{"description":"The dataset.","content":{"text/csv":{}}},"400":{"description":"The request is not valid."},"404":{"description":"Not found."}}}},"/api/apportionment":{"get":{"summary":"Split housing need between the districts","description":"Returns the settings used, the arithmetic for each district and the options kept so far.","x-access":"Anyone","parameters":[{"name":"years","in":"query","description":"Length of the plan period in years.","schema":{"type":"integer"},"required":false},{"name":"uplift","in":"query","description":"Uplift on the need, 0 to 1.","schema":{"type":"number"},"required":false},{"name":"constraintWeight","in":"query","description":"Weight given to constraints, 0 to 1.","schema":{"type":"number"},"required":false},{"name":"scenarioWeight","in":"query","description":"Weight given to the scenario's locations, 0 to 1.","schema":{"type":"number"},"required":false},{"name":"scenario","in":"query","description":"Scenario id to weight the split by.","schema":{"type":"integer"},"required":false}],"responses":{"200":{"description":"The settings, the split and the options.","content":{"application/json":{}}},"400":{"description":"The request is not valid."}}},"post":{"summary":"Keep an apportionment option","description":"Keeps the settings as a named option, with the reason for it.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"years":{"type":"integer","minimum":1,"maximum":50},"uplift":{"type":"number","minimum":0,"maximum":1},"constraintWeight":{"type":"number","minimum":0,"maximum":1},"scenarioWeight":{"type":"number","minimum":0,"maximum":1},"scenarioId":{"default":null,"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"reason":{"default":"","type":"string","maxLength":800}},"required":["name","years","uplift","constraintWeight","scenarioWeight"]}}}},"responses":{"201":{"description":"The new option id.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}}},"/api/apportionment/{id}":{"patch":{"summary":"Mark an option as preferred","description":"Takes the mark off any other option. With preferred false the option is unmarked. The reason can be changed with it.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Option id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"preferred":{"type":"boolean"},"reason":{"type":"string","maxLength":800}},"required":["preferred"]}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}},"delete":{"summary":"Remove an option","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Option id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/consultation":{"get":{"summary":"The consultation in hand","description":"With the published representations (names only where the person agreed, never contact details) and the summary of the main issues once a planner has approved it.","x-access":"Anyone","responses":{"200":{"description":"The consultation, representations and summary.","content":{"application/json":{}}}}},"put":{"summary":"Set up or change the consultation","description":"A change applies to the consultation in hand; add id \"new\" to start another one. Refused with 422 when the period is shorter than regulation 16 allows.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"kind":{"type":"string","enum":["draft","minor","non_material"]},"opensOn":{"type":"string"},"closesOn":{"type":"string"},"address":{"default":"","type":"string","maxLength":300}},"required":["title","kind","opensOn","closesOn"]}}}},"responses":{"200":{"description":"Changed. 201 with the id when a consultation is started.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"422":{"description":"Understood but refused; the body says why."}}}},"/api/consultation/representations":{"get":{"summary":"Every representation in full","description":"For the planning team: the copy that goes to the Secretary of State (regulation 17(1)(b)), with contact details.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"format","in":"query","description":"csv for a table.","schema":{"type":"string","enum":["csv"]},"required":false}],"responses":{"200":{"description":"A list of representations, or text/csv with format=csv.","content":{"application/json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}},"post":{"summary":"Make a representation","description":"Open to anyone while the consultation is open; a planner may add one that arrived by post or email at any time. Refused with 422 when the consultation is closed or the place is outside the county.","x-access":"Anyone","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"policyId":{"default":null,"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"stance":{"type":"string","enum":["support","object","comment"]},"body":{"type":"string","minLength":20,"maxLength":6000},"name":{"type":"string","minLength":2,"maxLength":120},"organisation":{"default":"","type":"string","maxLength":120},"email":{"default":"","anyOf":[{"type":"string","const":""},{"type":"string","maxLength":200,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}]},"kind":{"type":"string","enum":["resident","community","business","landowner","public_body","other"]},"namePublic":{"default":false,"type":"boolean"},"noAi":{"default":false,"type":"boolean"},"lng":{"type":"number","minimum":-180,"maximum":180},"lat":{"type":"number","minimum":-90,"maximum":90}},"required":["stance","body","name","kind"]}}}},"responses":{"201":{"description":"The representation's reference.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."},"429":{"description":"Too many requests from this address; try again later."}}}},"/api/consultation/representations/{id}":{"patch":{"summary":"Review a representation","description":"Sets the text to publish, publishes or takes out of view, or files the representation under a policy.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Representation id.","schema":{"type":"integer"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"publishedBody":{"anyOf":[{"type":"string","maxLength":6000},{"type":"null"}]},"published":{"type":"boolean"},"policyId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}},"delete":{"summary":"Remove a representation","description":"Takes it off the record when the person withdraws it.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","description":"Representation id.","schema":{"type":"integer"},"required":true}],"responses":{"204":{"description":"Removed."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/consultation/notices":{"get":{"summary":"Notices to the consultation bodies","description":"The day each body of regulation 15(2) was told the draft is published.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"responses":{"200":{"description":"The day notified, by body.","content":{"application/json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}},"put":{"summary":"Record a notice","description":"The day a body was notified; a null day takes the record away.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","enum":["active_travel","telecoms","canal_river","civil_aviation","sport_england","environment_agency","forestry","highways_authority","historic_england","homes_england","integrated_care","electricity","gas","sewerage","water","coal","marine","transport_authority","flood_authority","national_highways","natural_england","neighbourhood_forum","network_rail","nhs_england","nuclear","rail_road","parish"]},"notifiedOn":{"type":["string","null"]}},"required":["body","notifiedOn"]}}}},"responses":{"200":{"description":"Recorded.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}},"/api/consultation/summary":{"get":{"summary":"Summary of the main issues","description":"The latest summary, approved or not, for the planning team.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"responses":{"200":{"description":"The summary, or null when there is none.","content":{"application/json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."}}},"post":{"summary":"Draft a summary of the main issues","description":"Asks the assistant for a draft, which is then checked against the representations. Refused with 422 when there is nothing to read.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"responses":{"201":{"description":"The draft summary.","content":{"application/json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."},"502":{"description":"The assistant did not give a usable answer."},"503":{"description":"Switched off on this installation."}}},"put":{"summary":"Store a written or edited summary","description":"It goes through the same check as a draft from the assistant: each issue must rest on representations that exist. Refused with 422 when no issue stands.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","minItems":1,"maxItems":60,"items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"summary":{"type":"string","minLength":1,"maxLength":2000},"policy":{"type":"string","maxLength":20},"representations":{"type":"array","maxItems":2000,"items":{"type":"string","maxLength":12}}},"required":["title","summary","policy","representations"]}}},"required":["issues"]}}}},"responses":{"201":{"description":"The summary id, and any references that were not known.","content":{"application/json":{}}},"400":{"description":"The request is not valid."},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."},"422":{"description":"Understood but refused; the body says why."}}},"patch":{"summary":"Approve the summary","description":"The latest summary is then the one that is published and submitted.","x-access":"Signed in with the strategy.edit permission","security":[{"session":[]}],"responses":{"200":{"description":"Approved.","content":{"application/json":{}}},"401":{"description":"Not signed in."},"403":{"description":"Signed in, but the role does not allow it."},"404":{"description":"Not found."}}}}}}