{
	"openapi": "3.0.0",
	"components": {
		"examples": {},
		"headers": {},
		"parameters": {},
		"requestBodies": {},
		"responses": {},
		"schemas": {
			"SampleInspectionQuotaResponse": {
				"properties": {
					"quota": {
						"type": "number",
						"format": "double",
						"description": "Maximum number of sample inspections that can be completed in a quarter\nAlways a whole number of at least 1"
					}
				},
				"required": [
					"quota"
				],
				"type": "object",
				"additionalProperties": false
			},
			"GenerateSampleInspectionsRequest": {
				"properties": {
					"sample_inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "Required\nPercentage of each target to generate sample inspections for. Must be a whole number and one of: 33, 66, 100\nSee API specification Resource Guide > Sampling API > Sample inspections for more information"
					}
				},
				"required": [
					"sample_inspection_rate"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetCreateResponse": {
				"properties": {
					"sample_inspection_target_reference_number": {
						"type": "string"
					}
				},
				"required": [
					"sample_inspection_target_reference_number"
				],
				"type": "object",
				"additionalProperties": false
			},
			"AnnualInspectionUnitsSummary": {
				"properties": {
					"financial_year_start_date": {
						"type": "string",
						"format": "date-time",
						"description": "Required when sent in a request\nMust be 1 April (midnight, UK time) of a financial year that has already ended\nMust be unique within the array"
					},
					"annual_inspection_units": {
						"type": "number",
						"format": "double",
						"nullable": true,
						"description": "Required when sent in a request\nMust be a whole number of 0 or more"
					},
					"is_auto_calculated": {
						"type": "boolean",
						"description": "Required when sent in a request\nMust be true or false\nWhen creating or updating a target, the value is not used: new units are always saved as not auto calculated"
					}
				},
				"required": [
					"financial_year_start_date",
					"is_auto_calculated"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetCreateRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 50 characters"
					},
					"inspection_units_baseline": {
						"type": "number",
						"format": "double",
						"nullable": true,
						"description": "Optional, but exactly one of inspection_units_baseline or annual_inspection_units must be provided\nMust be a whole number\nCannot be provided together with annual_inspection_units (an empty array counts as provided)\nUsed as the average number of annual inspection units when annual_inspection_units is not provided"
					},
					"annual_inspection_units": {
						"items": {
							"$ref": "#/components/schemas/AnnualInspectionUnitsSummary"
						},
						"type": "array",
						"nullable": true,
						"description": "Optional, but exactly one of inspection_units_baseline or annual_inspection_units must be provided\nCannot be provided together with inspection_units_baseline\nMust contain exactly 3 items (2 items if the request is made on or before 1 April 2024), each for a different financial year\nAt least one item must have a non-zero annual_inspection_units\nItems with zero annual_inspection_units are left out when the average number of annual inspection units is calculated"
					},
					"inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number between 20 and 100\nSee API specification Resource Guide > Sampling API > Create sample inspection target for the rules on how the rate can change between targets"
					},
					"target_a": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number\nSum of target_a + target_b + target_c must not exceed the quarterly quota and cannot be zero\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_b": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number\nSum of target_a + target_b + target_c must not exceed the quarterly quota and cannot be zero\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_c": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number\nSum of target_a + target_b + target_c must not exceed the quarterly quota and cannot be zero\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"promoter_org_ref": {
						"type": "string",
						"description": "Required\nMax length 4 characters\nMust be the organisation reference of an existing promoter organisation that is not disabled\nYour organisation cannot already have an active target for this promoter"
					}
				},
				"required": [
					"inspection_rate",
					"target_a",
					"target_b",
					"target_c",
					"promoter_org_ref"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetUpdateRequest": {
				"description": "Replaces the inspection units, inspection rate and targets of an existing active target.\nThe promoter, financial year, quarter and start date of the target cannot be changed.\nThe quarterly quota is recalculated from the new inspection units and rate.\nThe new target_a must be at least the passed plus failed category A inspections already recorded for the target.\nThe new target_b and target_c must each be at least the passed plus failed inspections already recorded plus the issued sample inspections already generated for that category.",
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 50 characters"
					},
					"inspection_units_baseline": {
						"type": "number",
						"format": "double",
						"nullable": true,
						"description": "Optional, but exactly one of inspection_units_baseline or annual_inspection_units must be provided\nMust be a whole number\nCannot be provided together with annual_inspection_units (an empty array counts as provided)\nUsed as the average number of annual inspection units when annual_inspection_units is not provided"
					},
					"annual_inspection_units": {
						"items": {
							"$ref": "#/components/schemas/AnnualInspectionUnitsSummary"
						},
						"type": "array",
						"nullable": true,
						"description": "Optional, but exactly one of inspection_units_baseline or annual_inspection_units must be provided\nCannot be provided together with inspection_units_baseline\nMust contain exactly 3 items (2 items if the request is made on or before 1 April 2024), each for a different financial year\nAt least one item must have a non-zero annual_inspection_units\nItems with zero annual_inspection_units are left out when the average number of annual inspection units is calculated"
					},
					"inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number between 20 and 100\nSee API specification Resource Guide > Sampling API > Create sample inspection target for the rules on how the rate can change between targets"
					},
					"target_a": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number\nSum of target_a + target_b + target_c must not exceed the quarterly quota and cannot be zero\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_b": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number\nSum of target_a + target_b + target_c must not exceed the quarterly quota and cannot be zero\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_c": {
						"type": "number",
						"format": "double",
						"description": "Required\nMust be a whole number\nSum of target_a + target_b + target_c must not exceed the quarterly quota and cannot be zero\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					}
				},
				"required": [
					"inspection_rate",
					"target_a",
					"target_b",
					"target_c"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetResponse": {
				"properties": {
					"sample_inspection_target_reference_number": {
						"type": "string",
						"description": "Reference number of the target"
					},
					"org_ref": {
						"type": "string",
						"description": "Organisation reference of the promoter the target is for\nPadded with leading zeros to 4 characters"
					},
					"organisation_name": {
						"type": "string",
						"description": "Name of the promoter organisation"
					},
					"yearly_inspection_units": {
						"type": "number",
						"format": "double",
						"description": "Average yearly inspection units saved on the target"
					},
					"inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "Inspection rate saved on the target"
					},
					"target_a": {
						"type": "number",
						"format": "double",
						"description": "Target for category A inspections"
					},
					"target_b": {
						"type": "number",
						"format": "double",
						"description": "Target for category B inspections"
					},
					"target_c": {
						"type": "number",
						"format": "double",
						"description": "Target for category C inspections"
					},
					"completed_a": {
						"type": "number",
						"format": "double",
						"description": "Category A inspections completed so far\nPassed plus failed inspections; unable-to-complete inspections are not counted"
					},
					"completed_b": {
						"type": "number",
						"format": "double",
						"description": "Category B inspections completed so far\nPassed plus failed inspections; unable-to-complete inspections are not counted"
					},
					"completed_c": {
						"type": "number",
						"format": "double",
						"description": "Category C inspections completed so far\nPassed plus failed inspections; unable-to-complete inspections are not counted"
					},
					"generated_b": {
						"type": "number",
						"format": "double",
						"description": "Number of category B sample inspections generated for the target that are still issued\nCompleted and expired sample inspections are not counted; 0 if there are none"
					},
					"generated_c": {
						"type": "number",
						"format": "double",
						"description": "Number of category C sample inspections generated for the target that are still issued\nCompleted and expired sample inspections are not counted; 0 if there are none"
					}
				},
				"required": [
					"sample_inspection_target_reference_number",
					"org_ref",
					"organisation_name",
					"yearly_inspection_units",
					"inspection_rate",
					"target_a",
					"target_b",
					"target_c",
					"completed_a",
					"completed_b",
					"completed_c",
					"generated_b",
					"generated_c"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionStartQuarterRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 50 characters"
					},
					"start_date": {
						"type": "string",
						"format": "date-time",
						"description": "Required\nMust be the first day of a financial quarter: 1 April, 1 July, 1 October or 1 January\nMust be today or in the past\nInterpreted as a calendar day in UK time"
					}
				},
				"required": [
					"start_date"
				],
				"type": "object",
				"additionalProperties": false
			},
			"AnnualInspectionUnitsResponse": {
				"properties": {
					"annual_inspection_units": {
						"items": {
							"$ref": "#/components/schemas/AnnualInspectionUnitsSummary"
						},
						"type": "array"
					}
				},
				"required": [
					"annual_inspection_units"
				],
				"type": "object",
				"additionalProperties": false
			}
		},
		"securitySchemes": {
			"token": {
				"type": "apiKey",
				"name": "token",
				"in": "header"
			}
		}
	},
	"info": {
		"title": "Street Manager Sampling API",
		"version": "1.0.0",
		"description": "See API specification Resource Guide > Sampling API for more information on endpoints\nNOTE: Swagger Editor/UI does not display all description text for enumerations and child elements, check swagger.json for full description text",
		"license": {
			"name": "MIT"
		},
		"contact": {}
	},
	"paths": {
		"/sample-inspection-quota": {
			"get": {
				"operationId": "GetSampleInspectionQuota",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SampleInspectionQuotaResponse"
								}
							}
						}
					}
				},
				"description": "Calculates the maximum number of sample inspections that can be completed in a quarter, from 1 to 3 years of annual inspection units and an inspection rate. Nothing is stored.\n\nAccess: Admin or Street Works Admin users of a Highway Authority organisation; the caller must be an API user or present a valid front-end token.\nBusiness constraints: only Highway Authority organisations can get a quota (412 Precondition Failed otherwise); the organisation check runs before the field validation (400 Bad Request); the quota is the average of the inspection units (rounded to the nearest whole number) multiplied by the inspection rate percentage and divided by 4, rounded to the nearest whole number, with a minimum of 1.\n\nSee sampling API guide - GET /sample-inspection-quota",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "query",
						"name": "inspection_units",
						"required": true,
						"schema": {
							"type": "array",
							"items": {
								"type": "number",
								"format": "double"
							}
						}
					},
					{
						"in": "query",
						"name": "inspection_rate",
						"required": true,
						"schema": {
							"format": "double",
							"type": "number"
						}
					}
				]
			}
		},
		"/sample-inspections": {
			"post": {
				"operationId": "GenerateSampleInspections",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"description": "Starts a background job that generates sample inspections for the caller's Highway Authority organisation, based on its current quarter targets and the requested percentage of each target. The job is queued and runs asynchronously, so no sample inspections exist when the call returns; the call returns 204 No Content with no body.\n\nAccess: Admin or Street Works Admin users; the caller must be an API user or present a valid front-end token. Only Highway Authority organisations can generate sample inspections (412 Precondition Failed otherwise).\nBusiness constraints: the field validation (400 Bad Request) runs before the organisation checks; the organisation must have a quarter in progress, must have no active target with all three category targets (A, B and C) set to 0, and must not already have a generation job queued or in progress (each 412 Precondition Failed); a queued job is recorded and then a message is sent to start it; if either step fails the call fails with 500 Internal Server Error ('Something went wrong while generating samples'), and a job recorded before a failed send stays queued and counts as a job in progress; no audit record is written by this call.\n\nSee business rules section 4.5.3 - Generating sample inspections",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/GenerateSampleInspectionsRequest"
							}
						}
					}
				}
			}
		},
		"/sample-inspection-targets": {
			"post": {
				"operationId": "CreateSampleInspectionTarget",
				"responses": {
					"201": {
						"description": "Created",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SampleInspectionTargetCreateResponse"
								}
							}
						}
					}
				},
				"description": "Creates a sample inspection target for a promoter organisation on behalf of your Highway Authority organisation, returning the new target's reference number.\n\nAccess: requires the Admin or StreetWorksAdmin role. The caller must be an API user or supply the front-end token. Your organisation must be a Highway Authority, otherwise the request is rejected with 412.\nBusiness constraints: the promoter organisation must exist and not be disabled (404). The request is validated (400) before any business rule is checked (412). Your organisation can only have one active target per promoter. The initial target for a promoter must have an inspection rate of 30 or 50. For later targets, a rate that differs from the previous target's rate must be a multiple of 5, and the rate must be 30 if the previous target ended more than 3 years ago. Annual inspection units, if supplied, cannot all be zero. Targets A, B and C must each meet the minimum target (5% of the average inspection units divided by four, applied only when the average is 80 or more; target C is exempt for a new promoter), cannot all be zero, and must not sum to more than the quarterly quota (the average inspection units, using only non-zero years, multiplied by the inspection rate and divided by four, minimum 1). During the fourth financial quarter, a target cannot be created if your organisation has already closed its Q4 targets for the current financial year. If your organisation has a started quarter with active targets, the new target joins that quarter and takes its start date; otherwise it is created without a quarter or start date. Annual inspection units supplied for previous years are saved (or overwrite existing totals) as manually entered. Everything is saved in one transaction with an audit record, so nothing is saved if any step fails.\n\nSee API specification Resource Guide > Sampling API > Create sample inspection target",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SampleInspectionTargetCreateRequest"
							}
						}
					}
				}
			}
		},
		"/sample-inspection-targets/{sampleInspectionTargetReferenceNumber}": {
			"delete": {
				"operationId": "DeleteSampleInspectionTarget",
				"responses": {
					"204": {
						"description": "No Content"
					}
				},
				"description": "Permanently deletes (removes) a sample inspection target belonging to your Highway Authority organisation, returning no content on success.\n\nAccess: requires the Admin or StreetWorksAdmin role. The caller must be an API user or supply the front-end token. The target must belong to your organisation: if the reference number does not exist or belongs to another organisation the request is rejected with 401, not 404. There is no organisation type check.\nParameters: sampleInspectionTargetReferenceNumber is the reference number of the target to delete (for example 1234-5678-SIT-01); it has no format check, only an existing target of your organisation is accepted. There is no request body.\nBusiness constraints (each failure is rejected with 412): a target that has ended cannot be deleted; a target that is not active cannot be deleted. If the target's quarter has not been started (it has no start date) it can be deleted. If the quarter has been started, the target can only be deleted when it has no recorded passed, failed or unable-to-complete inspections in any category and no sample inspections have been generated for it. The delete is permanent (the target record is removed, not marked inactive) and no other records are updated: sample inspections, financial quarters, other targets and performance statistics are not touched by this action. An audit record is saved with the delete in one transaction, so nothing is saved if any step fails.\n\nSee API specification Resource Guide > Sampling API > Delete sample inspection target",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "path",
						"name": "sampleInspectionTargetReferenceNumber",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"put": {
				"operationId": "UpdateSampleInspectionTarget",
				"responses": {
					"204": {
						"description": "No Content"
					}
				},
				"description": "Updates the inspection units, inspection rate and targets A, B and C of an existing active sample inspection target belonging to your Highway Authority organisation, returning no content on success.\n\nAccess: requires the Admin or StreetWorksAdmin role. The caller must be an API user or supply the front-end token. The target must belong to your organisation: if the reference number does not exist or belongs to another organisation the request is rejected with 401, not 404. Your organisation must be a Highway Authority, otherwise the request is rejected with 412.\nParameters: sampleInspectionTargetReferenceNumber is the reference number of the target to update (for example 1234-5678-SIT-01); it has no format check, only an existing target of your organisation is accepted.\nBusiness constraints: the request is validated (400) before any business rule is checked (412). A target that has ended or is no longer active cannot be updated. Only the inspection units, inspection rate, quarterly quota and targets A, B and C change: the promoter, reference number, financial year, quarter and start date are never changed, and the target can be updated whether or not its quarter has been started. The quarterly quota is recalculated from the new inspection units and rate (the average inspection units, using only non-zero years, multiplied by the inspection rate and divided by four, minimum 1). The new target A must be at least the passed plus failed category A inspections already recorded; the new targets B and C must each be at least the passed plus failed inspections already recorded plus the issued sample inspections already generated for that category. Annual inspection units, if supplied, cannot all be zero. The inspection rate rules are the same as when creating a target: an initial target for a promoter must have a rate of 30 or 50; for later targets a rate that differs from the previous ended target's rate must be a multiple of 5, and the rate must be 30 if the previous target ended more than 3 years ago. During the fourth financial quarter, the update is rejected if your organisation has already closed its Q4 targets for the current financial year. Targets A, B and C must each meet the minimum target (5% of the average inspection units divided by four, applied only when the average is 80 or more; target C is exempt for a new promoter), cannot all be zero, and must not sum to more than the quarterly quota. Annual inspection units supplied for previous years are saved as new records marked as manually entered, or overwrite the total of an existing record for that year (whose auto calculated marker is left unchanged). Everything is saved in one transaction with an audit record, so nothing is saved if any step fails.\n\nSee API specification Resource Guide > Sampling API > Update sample inspection target",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "path",
						"name": "sampleInspectionTargetReferenceNumber",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SampleInspectionTargetUpdateRequest"
							}
						}
					}
				}
			},
			"get": {
				"operationId": "GetSampleInspectionTarget",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SampleInspectionTargetResponse"
								}
							}
						}
					}
				},
				"description": "Returns the details and progress of a single sample inspection target belonging to your Highway Authority organisation, identified by its reference number.\n\nAccess: requires the Admin or StreetWorksAdmin role. The caller must be an API user or supply the front-end token. If the reference number does not exist the request is rejected with 404; if it belongs to another organisation it is rejected with 401. There is no organisation type check.\nParameters: sampleInspectionTargetReferenceNumber is the reference number of the target to return (for example 1234-5678-SIT-01); it has no format check, only an existing target of your organisation is accepted. There is no request body.\nBusiness constraints: this is a read-only lookup with no audit record, notifications or changes. The target is returned whether or not it is active, has ended, or its quarter has been started. The response shows the promoter's organisation reference (padded with leading zeros to 4 characters) and name, the average yearly inspection units, the inspection rate, targets A, B and C, the completed inspections for each category (passed plus failed; unable-to-complete inspections are not counted) and, for categories B and C, the number of issued (not completed or expired) sample inspections generated for the target, which is 0 if there are none.\n\nSee API specification Resource Guide > Sampling API > Get sample inspection target",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "path",
						"name": "sampleInspectionTargetReferenceNumber",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/sample-inspections/start-quarter": {
			"post": {
				"operationId": "StartQuarter",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"description": "Starts the sample inspection quarter for your Highway Authority organisation, activating all of its not-yet-started sample inspection targets from the given start date.\n\nAccess: Admin or StreetWorksAdmin users only, who must be API users or present the Street Manager front-end token; users of suspended or disabled organisations are rejected.\nBusiness constraints: only Highway Authority organisations can start a quarter; a quarter must not already be in progress; no target of your organisation may already have been started on the given start date; the not-yet-started targets must all belong to the current financial year; the total of their category B and category C targets must not exceed 4000.\n\nSee API specification Resource Guide > Sampling API",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SampleInspectionStartQuarterRequest"
							}
						}
					}
				}
			}
		},
		"/sample-inspections/end-quarter": {
			"post": {
				"operationId": "EndQuarter",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"description": "Ends the sample inspection quarter in progress for your Highway Authority organisation: all of its started targets are closed, any issued sample inspections for them are expired, and, unless the ending quarter is the last of the financial year, a new not-yet-started target is created for each closed target.\n\nAccess: Admin or StreetWorksAdmin users only, who must be API users or present the Street Manager front-end token; users of suspended or disabled organisations are rejected. The request has no body or parameters.\nBusiness constraints: only Highway Authority organisations can end a quarter; your organisation must have a started quarter to end; sample inspections must not currently be being generated for your organisation (a queued or in-progress generation job blocks the request). All changes are saved together or not at all.\n\nSee API specification Resource Guide > Sampling API",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": []
			}
		},
		"/sample-inspections/revert-end-quarter": {
			"post": {
				"operationId": "RevertEndQuarter",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"description": "Reverts the end of the most recently ended sample inspection quarter for your Highway Authority organisation: any not-yet-started targets are deleted and the targets of the ended quarter are made active again with their end date cleared. It does not restore sample inspections that were expired, nor remove performance statistics created, when the quarter was ended.\n\nAccess: Admin or StreetWorksAdmin users only, who must be API users or present the Street Manager front-end token; users of suspended or disabled organisations are rejected. The request has no body or parameters.\nBusiness constraints: only Highway Authority organisations can revert the end of a quarter; no quarter may currently be in progress for your organisation; the most recently ended target must belong to the current financial quarter. All changes are saved together or not at all.\n\nSee API specification Resource Guide > Sampling API",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": []
			}
		},
		"/previous-annual-inspection-units": {
			"get": {
				"operationId": "GetPreviousAnnualInspectionUnits",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/AnnualInspectionUnitsResponse"
								}
							}
						}
					}
				},
				"description": "Retrieves the annual inspection units recorded for a promoter organisation across three consecutive financial years, ending with the requested (or default) financial year.\n\nAccess: Admin and Street Works Admin users of a Highway Authority organisation only. The V7 API also requires the user to be an API user or to supply the front-end token; the V6 API requires an API user.\nBusiness constraints: Only Highway Authority organisations can use this endpoint (otherwise 412); the promoter organisation reference must match an existing organisation (leading zeros are ignored, otherwise 404); when no financial year start date is supplied the latest completed financial year is used, and the date must be a previous completed financial year; only years with recorded units for the calling Highway Authority and the promoter are returned, ordered oldest first, so fewer than three years may be returned.\n\nParameters: promoter_org_ref is required, with a maximum length of 4 characters; financial_year_start_date is optional, see the client request interface for its rules.\n\nSee Sampling API Resource Guide - GET /previous-annual-inspection-units",
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "query",
						"name": "promoter_org_ref",
						"required": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"in": "query",
						"name": "financial_year_start_date",
						"required": false,
						"schema": {
							"format": "date-time",
							"type": "string"
						}
					}
				]
			}
		}
	},
	"servers": [
		{
			"url": "/"
		}
	]
}