{
	"openapi": "3.0.0",
	"components": {
		"examples": {},
		"headers": {},
		"parameters": {},
		"requestBodies": {},
		"responses": {},
		"schemas": {
			"AuditEventType": {
				"enum": [
					"historic_action",
					"inspection_passed",
					"inspection_failed",
					"inspection_unable_to_carry_out",
					"inspection_further_required",
					"inspection_withdraw_defect",
					"inspection_agreed_site_compliance",
					"activity_submitted",
					"activity_edited",
					"activity_cancelled",
					"fpn_submitted",
					"fpn_accepted",
					"fpn_paid",
					"fpn_disputed",
					"fpn_withdrawn",
					"permit_granted",
					"permit_refused",
					"permit_cancelled",
					"permit_revoked",
					"permit_deemed",
					"paa_granted",
					"paa_refused",
					"paa_cancelled",
					"paa_revoked",
					"alteration_submitted",
					"alteration_refused",
					"alteration_granted",
					"alteration_granted_with_duration_challenge",
					"alteration_deemed",
					"alteration_cancelled",
					"lane_rental_assessed",
					"reinstatement_submitted",
					"file_uploaded",
					"comment_submitted",
					"work_start_logged",
					"work_stop_logged",
					"work_start_reverted",
					"work_stop_reverted",
					"forward_plan_submitted",
					"forward_plan_cancelled",
					"user_removed",
					"user_invited",
					"inspection_units_logged",
					"permit_submitted",
					"paa_submitted",
					"forward_plan_edited",
					"permit_discount_updated",
					"paa_discount_updated",
					"paa_deemed",
					"organisation_contract_added",
					"organisation_contract_removed",
					"organisation_updated",
					"workstream_created",
					"workstream_updated",
					"inspection_works_stopped",
					"inspection_works_stopped_apparatus_remaining",
					"inspection_works_in_progress",
					"inspection_works_in_progress_no_carriageway_incursion",
					"inspection_non_compliant_with_conditions",
					"permit_modification_request",
					"scheduled_inspection_cancelled",
					"scheduled_inspection_created",
					"alteration_applied_auto",
					"section_81_submitted",
					"final_reinstatement_updated",
					"section_81_acknowledged",
					"section_81_accepted",
					"section_81_accepted_fixed",
					"section_81_rejected",
					"section_81_resolved_by_ha",
					"section_81_cancelled",
					"user_roles_updated",
					"support_desk_action",
					"user_name_updated",
					"permit_hs2_acknowledged",
					"geographical_area_created",
					"geographical_area_updated",
					"workstream_access_updated",
					"planned_works_record_created",
					"in_progress_works_record_created",
					"historic_works_record_created",
					"non_notifiable_works_record_created",
					"section_81_works_record_created",
					"unattributable_works_record_created",
					"upcoming_event",
					"sample_inspection_target_created",
					"sample_inspection_target_updated",
					"sample_inspection_created",
					"sample_inspection_completed",
					"sample_inspection_removed",
					"sample_inspection_expired",
					"internal_comment_submitted",
					"comment_read",
					"excavation_carried_out_updated",
					"sample_inspection_target_closed",
					"section_81_linked_to_permit",
					"section_81_unlinked_from_permit",
					"section_81_reassigned",
					"permit_granted_with_duration_challenge",
					"inspection_withdrawn",
					"section_74_warning_issued",
					"section_74_warning_acknowledged",
					"section_74_site_visited_and_rectified",
					"section_74_charges_ended",
					"section_74_warning_disputed",
					"section_74_withdrawn",
					"section_74_draft_invoice_issued",
					"section_74_resolved",
					"section_74_draft_invoice_acknowledged",
					"section_74_charge_under_review",
					"section_74_charge_agreed",
					"alteration_duration_challenge_accepted",
					"alteration_duration_challenge_not_accepted",
					"alteration_duration_challenge_non_acceptance_response",
					"permit_duration_challenge_accepted",
					"permit_duration_challenge_not_accepted",
					"permit_duration_challenge_non_acceptance_response",
					"section_58_created",
					"section_58_progressed",
					"section_58_cancelled",
					"section_58_closed",
					"reinstatement_deleted",
					"site_deleted",
					"inspection_deleted",
					"site_subsumed",
					"fpn_deleted",
					"current_traffic_management_type_updated",
					"ancillary_info_added",
					"ancillary_info_removed",
					"sample_inspection_issued",
					"inspection_outcome_accepted",
					"inspection_outcome_disputed",
					"inspection_outcome_promoter_accepts_failed_inspection",
					"sample_inspection_target_deleted",
					"sample_inspection_quarter_started",
					"sample_inspection_quarter_ended",
					"fee_matrix_updated",
					"organisation_fpn_details_updated",
					"inspection_auto_accepted",
					"sample_inspection_quarter_end_reverted",
					"private_street_notice_issued",
					"private_street_notice_cancelled",
					"non_compliance_issued",
					"non_compliance_withdrawn",
					"non_compliance_resolved",
					"inspection_linked_to_non_compliance",
					"permit_linked_to_non_compliance",
					"inspection_outcome_joint_site_meeting_needed",
					"inspection_outcome_reviewing_dispute",
					"inspection_outcome_no_agreement",
					"non_compliance_works_completed_and_passed",
					"non_compliance_joint_site_meeting_suggested",
					"non_compliance_will_attend_joint_site_meeting",
					"non_compliance_works_complete_ready_for_inspection",
					"non_compliance_joint_site_meeting_not_needed",
					"event_subscription_created",
					"event_subscription_removed",
					"material_classification_submitted",
					"non_compliance_accept_suggestion",
					"permit_under_assessment",
					"alteration_revoked",
					"change_request_submitted",
					"change_request_refused",
					"change_request_granted",
					"change_request_granted_with_duration_challenge",
					"change_request_deemed",
					"change_request_cancelled",
					"change_request_applied_auto",
					"change_request_duration_challenge_accepted",
					"change_request_duration_challenge_not_accepted",
					"change_request_duration_challenge_non_acceptance_response",
					"change_request_revoked"
				],
				"type": "string"
			},
			"AuditObjectTypeResponse": {
				"enum": [
					"permit",
					"reinstatement",
					"inspection",
					"fpn",
					"paa",
					"workstream",
					"work",
					"organisation",
					"activity",
					"forward_plan",
					"comment",
					"scheduled_inspection",
					"section_81",
					"user",
					"geographical_area",
					"change_request",
					"application",
					"sample_inspection",
					"section_74",
					"section_58",
					"site",
					"sample_inspection_target",
					"fee_matrix",
					"non_compliance",
					"private_street",
					"event_subscription",
					"material_classification",
					"upcoming_enum"
				],
				"type": "string"
			},
			"WorkUpdateSummaryResponse": {
				"properties": {
					"work_reference_number": {
						"type": "string"
					},
					"update_date_time": {
						"type": "string",
						"format": "date-time"
					},
					"update_id": {
						"type": "number",
						"format": "double"
					},
					"event_type": {
						"$ref": "#/components/schemas/AuditEventType"
					},
					"event_type_string": {
						"type": "string"
					},
					"object_type": {
						"$ref": "#/components/schemas/AuditObjectTypeResponse"
					},
					"object_type_string": {
						"type": "string"
					},
					"parent_object_reference_number": {
						"type": "string",
						"nullable": true
					},
					"object_reference_number": {
						"type": "string",
						"nullable": true
					}
				},
				"required": [
					"work_reference_number",
					"update_date_time",
					"update_id",
					"event_type",
					"event_type_string",
					"object_type",
					"object_type_string"
				],
				"type": "object",
				"additionalProperties": false
			},
			"WorkUpdateResponse": {
				"properties": {
					"rows": {
						"items": {
							"$ref": "#/components/schemas/WorkUpdateSummaryResponse"
						},
						"type": "array"
					},
					"next_update": {
						"type": "number",
						"format": "double",
						"nullable": true
					}
				},
				"required": [
					"rows"
				],
				"type": "object",
				"additionalProperties": false
			},
			"WorkCategoryResponse": {
				"enum": [
					"minor",
					"standard",
					"major",
					"immediate_urgent",
					"immediate_emergency",
					"paa",
					"hs2_highway",
					"upcoming_enum"
				],
				"type": "string"
			},
			"TrafficManagementTypeResponse": {
				"enum": [
					"road_closure",
					"contra_flow",
					"lane_closure",
					"multi_way_signals",
					"two_way_signals",
					"convoy_workings",
					"stop_go_boards",
					"priority_working",
					"give_and_take",
					"some_carriageway_incursion",
					"no_carriageway_incursion",
					"upcoming_enum"
				],
				"type": "string"
			},
			"AssessmentStatusResponse": {
				"enum": [
					"granted",
					"granted_auto",
					"refused",
					"refused_auto",
					"permit_modification_request",
					"revoked",
					"upcoming_enum"
				],
				"type": "string"
			},
			"PermitStatusResponse": {
				"enum": [
					"submitted",
					"granted",
					"permit_modification_request",
					"refused",
					"closed",
					"cancelled",
					"revoked",
					"progressed",
					"upcoming_enum"
				],
				"type": "string"
			},
			"WorkStatusResponse": {
				"enum": [
					"planned",
					"in_progress",
					"completed",
					"cancelled",
					"unattributable",
					"historical",
					"non_notifiable",
					"section_81",
					"upcoming_enum"
				],
				"type": "string"
			},
			"PermitConditionTypeResponse": {
				"enum": [
					"NCT01a",
					"NCT01b",
					"NCT02a",
					"NCT02b",
					"NCT04a",
					"NCT04b",
					"NCT05a",
					"NCT06a",
					"NCT07a",
					"NCT08a",
					"NCT08b",
					"NCT09a",
					"NCT09b",
					"NCT09c",
					"NCT10a",
					"NCT11a",
					"NCT11b",
					"NCT12a",
					"upcoming_enum"
				],
				"type": "string"
			},
			"PermitCondition": {
				"properties": {
					"condition": {
						"$ref": "#/components/schemas/PermitConditionTypeResponse"
					},
					"condition_string": {
						"type": "string"
					},
					"comment": {
						"type": "string",
						"nullable": true
					}
				},
				"required": [
					"condition",
					"condition_string"
				],
				"type": "object",
				"additionalProperties": false
			},
			"LaneRentalAssessmentOutcomeResponse": {
				"enum": [
					"chargeable",
					"potentially_chargeable",
					"charges_waived",
					"exempt",
					"charges_not_applicable",
					"upcoming_enum"
				],
				"type": "string"
			},
			"ActivityTypeResponse": {
				"enum": [
					"highway_improvement_works",
					"highway_repair_and_maintenance_works",
					"utility_asset_works",
					"utility_repair_and_maintenance_works",
					"diversionary_works",
					"disconnection_or_alteration_of_supply",
					"permanent_reinstatement",
					"remedial_works",
					"section_58",
					"section_50",
					"core_sampling",
					"statutory_infrastructure_works",
					"works_for_rail_purposes",
					"works_for_road_purposes",
					"new_service_connection",
					"optional_permit_no_fee",
					"upcoming_enum"
				],
				"type": "string"
			},
			"PermitSummaryResponse": {
				"properties": {
					"work_reference_number": {
						"type": "string"
					},
					"permit_reference_number": {
						"type": "string"
					},
					"promoter_swa_code": {
						"type": "string"
					},
					"promoter_organisation": {
						"type": "string"
					},
					"highway_authority": {
						"type": "string"
					},
					"works_coordinates": {},
					"location_description": {
						"type": "string"
					},
					"street": {
						"type": "string"
					},
					"town": {
						"type": "string"
					},
					"area": {
						"type": "string"
					},
					"work_category": {
						"$ref": "#/components/schemas/WorkCategoryResponse"
					},
					"work_category_string": {
						"type": "string"
					},
					"description_of_work": {
						"type": "string"
					},
					"traffic_management_type": {
						"$ref": "#/components/schemas/TrafficManagementTypeResponse"
					},
					"traffic_management_type_string": {
						"type": "string"
					},
					"assessment_status": {
						"allOf": [
							{
								"$ref": "#/components/schemas/AssessmentStatusResponse"
							}
						],
						"nullable": true
					},
					"assessment_status_string": {
						"type": "string",
						"nullable": true
					},
					"proposed_start_date": {
						"type": "string",
						"format": "date-time"
					},
					"proposed_end_date": {
						"type": "string",
						"format": "date-time"
					},
					"proposed_start_time": {
						"type": "string",
						"format": "date-time",
						"nullable": true
					},
					"proposed_end_time": {
						"type": "string",
						"format": "date-time",
						"nullable": true
					},
					"actual_start_date": {
						"type": "string",
						"format": "date-time",
						"nullable": true
					},
					"actual_end_date": {
						"type": "string",
						"format": "date-time",
						"nullable": true
					},
					"status": {
						"$ref": "#/components/schemas/PermitStatusResponse"
					},
					"status_string": {
						"type": "string"
					},
					"work_status": {
						"$ref": "#/components/schemas/WorkStatusResponse"
					},
					"work_status_string": {
						"type": "string"
					},
					"deadline_date": {
						"type": "string",
						"format": "date-time"
					},
					"date_created": {
						"type": "string",
						"format": "date-time"
					},
					"status_changed_date": {
						"type": "string",
						"format": "date-time"
					},
					"usrn": {
						"type": "number",
						"format": "double"
					},
					"is_active_permit": {
						"type": "boolean"
					},
					"permit_conditions": {
						"items": {
							"$ref": "#/components/schemas/PermitCondition"
						},
						"type": "array",
						"nullable": true
					},
					"road_category": {
						"type": "number",
						"format": "double"
					},
					"is_traffic_sensitive": {
						"type": "boolean"
					},
					"has_no_final_reinstatement": {
						"type": "boolean"
					},
					"is_deemed": {
						"type": "boolean"
					},
					"excavation_carried_out": {
						"type": "boolean"
					},
					"is_early_start": {
						"type": "boolean"
					},
					"is_high_impact_traffic_management": {
						"type": "boolean"
					},
					"is_lane_rental": {
						"type": "boolean"
					},
					"lane_rental_assessment_outcome": {
						"allOf": [
							{
								"$ref": "#/components/schemas/LaneRentalAssessmentOutcomeResponse"
							}
						],
						"nullable": true
					},
					"lane_rental_assessment_outcome_string": {
						"type": "string",
						"nullable": true
					},
					"lane_rental_charges_not_agreed": {
						"type": "boolean"
					},
					"lane_rental_charges_potentially_apply": {
						"type": "boolean"
					},
					"paa_to_pa_deadline_date": {
						"type": "string",
						"format": "date-time",
						"nullable": true
					},
					"activity_type": {
						"$ref": "#/components/schemas/ActivityTypeResponse"
					},
					"activity_type_string": {
						"type": "string"
					}
				},
				"required": [
					"work_reference_number",
					"permit_reference_number",
					"promoter_swa_code",
					"promoter_organisation",
					"highway_authority",
					"works_coordinates",
					"location_description",
					"street",
					"town",
					"area",
					"work_category",
					"work_category_string",
					"description_of_work",
					"traffic_management_type",
					"traffic_management_type_string",
					"proposed_start_date",
					"proposed_end_date",
					"status",
					"status_string",
					"work_status",
					"work_status_string",
					"deadline_date",
					"date_created",
					"status_changed_date",
					"usrn",
					"is_active_permit",
					"road_category",
					"is_traffic_sensitive",
					"has_no_final_reinstatement",
					"is_deemed",
					"excavation_carried_out",
					"is_early_start",
					"is_high_impact_traffic_management",
					"is_lane_rental",
					"lane_rental_charges_not_agreed",
					"lane_rental_charges_potentially_apply",
					"activity_type",
					"activity_type_string"
				],
				"type": "object",
				"additionalProperties": false
			},
			"PermitSearchReportingResponse": {
				"properties": {
					"rows": {
						"items": {
							"$ref": "#/components/schemas/PermitSummaryResponse"
						},
						"type": "array"
					},
					"next_cursor": {
						"type": "number",
						"format": "double"
					}
				},
				"required": [
					"rows",
					"next_cursor"
				],
				"type": "object",
				"additionalProperties": false
			},
			"PermitSearchRequest": {
				"properties": {
					"work_reference_numbers": {
						"items": {
							"type": "string"
						},
						"type": "array",
						"nullable": true,
						"description": "Array values must be unique\nMust not contain null or undefined values\nArray max length 1000\nWork reference numbers have a max length 24 characters"
					},
					"next_cursor": {
						"type": "number",
						"format": "double",
						"nullable": true
					},
					"page_size": {
						"type": "number",
						"format": "double",
						"nullable": true,
						"description": "Minimum value of 100\nMaximum value of 500\nMust be an integer"
					}
				},
				"type": "object",
				"additionalProperties": false
			},
			"SubscriptionCreateResponse": {
				"properties": {
					"subscription_reference_number": {
						"type": "string"
					}
				},
				"required": [
					"subscription_reference_number"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SubscriptionCreateRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"api_endpoint": {
						"type": "string",
						"description": "Max length 2048 characters"
					},
					"subscription_description": {
						"type": "string",
						"description": "Max length 100 characters"
					}
				},
				"required": [
					"api_endpoint"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SubscriptionRemoveRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"subscription_reference_number": {
						"type": "string"
					}
				},
				"type": "object",
				"additionalProperties": false
			},
			"GetSubscriptionsResponse": {
				"properties": {
					"subscription_reference_number": {
						"type": "string"
					},
					"subscription_description": {
						"type": "string"
					},
					"subscription_url": {
						"type": "string"
					}
				},
				"required": [
					"subscription_reference_number",
					"subscription_description",
					"subscription_url"
				],
				"type": "object",
				"additionalProperties": false
			}
		},
		"securitySchemes": {
			"token": {
				"type": "apiKey",
				"name": "token",
				"in": "header"
			}
		}
	},
	"info": {
		"title": "Street Manager Event API",
		"version": "1.0.0",
		"description": "See API specification Resource Guide > Event 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": {
		"/works/updates": {
			"get": {
				"operationId": "GetWorksUpdates",
				"responses": {
					"200": {
						"description": "Available",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/WorkUpdateResponse"
								}
							}
						}
					}
				},
				"description": "See API specification Resource Guide > Event API > Polling for more information\nAuthenticated user must have one of the following roles: Planner, Contractor, HighwayAuthority",
				"security": [
					{
						"token": [
							"Planner",
							"HighwayAuthority",
							"Contractor"
						]
					}
				],
				"parameters": [
					{
						"in": "query",
						"name": "start_date",
						"required": false,
						"schema": {
							"format": "date-time",
							"type": "string"
						}
					},
					{
						"in": "query",
						"name": "end_date",
						"required": false,
						"schema": {
							"format": "date-time",
							"type": "string"
						}
					},
					{
						"in": "query",
						"name": "exclude_events_from",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"in": "query",
						"name": "swa_code",
						"required": false,
						"schema": {
							"type": "string"
						}
					},
					{
						"in": "query",
						"name": "workstream_prefix",
						"required": false,
						"schema": {
							"type": "array",
							"items": {
								"type": "string"
							}
						}
					},
					{
						"in": "query",
						"name": "update_id",
						"required": false,
						"schema": {
							"format": "double",
							"type": "number"
						}
					},
					{
						"in": "query",
						"name": "page_size",
						"required": false,
						"schema": {
							"format": "double",
							"type": "number"
						}
					}
				]
			}
		},
		"/permits/search": {
			"post": {
				"operationId": "GetPermitSummaries",
				"responses": {
					"200": {
						"description": "Available",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/PermitSearchReportingResponse"
								}
							}
						}
					}
				},
				"description": "Authenticated user must have one of the following roles: Planner, Contractor, HighwayAuthority",
				"security": [
					{
						"token": [
							"Planner",
							"Contractor",
							"HighwayAuthority"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/PermitSearchRequest"
							}
						}
					}
				}
			}
		},
		"/api-notifications/subscribe": {
			"post": {
				"operationId": "SubscribeToEvent",
				"responses": {
					"200": {
						"description": "Available",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SubscriptionCreateResponse"
								}
							}
						}
					}
				},
				"description": "Authenticated user must have one of the following roles: Planner, Contractor, HighwayAuthority",
				"security": [
					{
						"token": [
							"Planner",
							"Contractor",
							"HighwayAuthority"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SubscriptionCreateRequest"
							}
						}
					}
				}
			}
		},
		"/api-notifications/unsubscribe": {
			"post": {
				"operationId": "UnsubscribeToEvent",
				"responses": {
					"204": {
						"description": ""
					}
				},
				"description": "Authenticated user must have one of the following roles: Planner, Contractor, HighwayAuthority",
				"security": [
					{
						"token": [
							"Planner",
							"Contractor",
							"HighwayAuthority"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SubscriptionRemoveRequest"
							}
						}
					}
				}
			}
		},
		"/api-notifications/subscriptions": {
			"get": {
				"operationId": "GetEventSubscriptions",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"items": {
										"$ref": "#/components/schemas/GetSubscriptionsResponse"
									},
									"type": "array"
								}
							}
						}
					}
				},
				"description": "Authenticated user must have one of the following roles: Planner, Contractor, HighwayAuthority",
				"security": [
					{
						"token": [
							"Planner",
							"Contractor",
							"HighwayAuthority"
						]
					}
				],
				"parameters": []
			}
		}
	},
	"servers": [
		{
			"url": "/"
		}
	]
}