{ "openapi": "3.1.0", "info": { "title": "OpenAPI definition", "version": "v0" }, "servers": [ { "url": "http://localhost:8080", "description": "Generated server url" } ], "tags": [ { "name": "Prior Authority", "description": "Submit prior-authority requests to the Legal Aid Agency, and save/resume in-progress drafts" } ], "paths": { "/prior-authority/drafts/{draftId}": { "get": { "tags": [ "Prior Authority" ], "summary": "Retrieve an existing prior-authority draft", "operationId": "getDraft", "parameters": [ { "name": "draftId", "in": "path", "description": "ID of the draft to return.", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Draft returned.", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/PriorAuthorityDraftSummary" } } } }, "404": { "description": "Draft not found." } } }, "put": { "tags": [ "Prior Authority" ], "summary": "Update an existing prior-authority draft", "operationId": "updateDraft", "parameters": [ { "name": "draftId", "in": "path", "description": "ID of the draft to update.", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriorAuthorityDraft" } } }, "required": true }, "responses": { "200": { "description": "Draft updated." }, "404": { "description": "Draft not found." } } }, "delete": { "tags": [ "Prior Authority" ], "summary": "Delete a prior-authority draft", "description": "Permanently removes the draft", "operationId": "deleteDraft", "parameters": [ { "name": "draftId", "in": "path", "description": "ID of the draft to delete.", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "204": { "description": "Draft deleted (or did not exist)." } } } }, "/prior-authority": { "post": { "tags": [ "Prior Authority" ], "summary": "Submit a prior-authority request", "description": "Accepts a prior-authority request from the LAA Civil Manage frontend and forwards it to the Access Data Store.", "operationId": "submit", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriorAuthority" } } }, "required": true }, "responses": { "201": { "description": "Request accepted. Location header contains the submission URL.", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/PriorAuthorityApplicationResponse" } } } }, "400": { "description": "Validation failed" } } } }, "/prior-authority/drafts": { "get": { "tags": [ "Prior Authority" ], "summary": "List prior-authority drafts for an Application", "description": "Returns all of the current user\u0027s prior-authority drafts. Use applicationId to narrow the list to a specific application.", "operationId": "listDrafts", "parameters": [ { "name": "applicationId", "in": "query", "description": "Optional parent application ID filter.", "required": false, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/PriorAuthorityDraftSummary" } } } } } } }, "post": { "tags": [ "Prior Authority" ], "summary": "Create a prior-authority draft", "description": "Saves the supplied form as a new draft.", "operationId": "createDraft", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriorAuthorityDraft" } } }, "required": true }, "responses": { "201": { "description": "Draft created. Location header contains the draft URL.", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/DraftIdResponse" } } } }, "400": { "description": "applicationId missing." } } } }, "/prior-authority/documents": { "post": { "tags": [ "Prior Authority" ], "summary": "Upload a supporting document", "description": "Accepts a multipart/form-data file upload from the frontend and returns the uploaded filename.", "operationId": "uploadDocument", "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary", "description": "File to upload." } }, "required": [ "file" ] } } } }, "responses": { "200": { "description": "File accepted.", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/UploadedDocument" } } } }, "400": { "description": "No file supplied or file is empty." }, "413": { "description": "File exceeds the configured maximum size." }, "415": { "description": "Unsupported file type." } } } }, "/expertTypes": { "get": { "tags": [ "expert-controller" ], "operationId": "getExpertTypes", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "array", "items": { "type": "string" } } } } } } } }, "/client/{applicationId}": { "get": { "tags": [ "client-controller" ], "operationId": "getClientByApplicationId", "parameters": [ { "name": "applicationId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "string" } } } } } } }, "/applications": { "get": { "tags": [ "applications-controller" ], "operationId": "getApplications", "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32", "default": 1 } }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32", "default": 10 } }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "default": "APPLICATION_SUBMITTED", "description": "The status of an application", "enum": [ "APPLICATION_SUBMITTED", "READY", "APPLICATION_IN_PROGRESS", "GRANTED", "REFUSED" ] } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/ApplicationSummaryResponse" } } } } } } }, "/applications/{applicationId}": { "get": { "tags": [ "applications-controller" ], "operationId": "getApplicationById", "parameters": [ { "name": "applicationId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/ApplicationSummary" } } } } } } } }, "components": { "schemas": { "PriorAuthorityDraft": { "type": "object", "description": "An in-progress prior-authority form saved as a draft.", "properties": { "applicationId": { "type": "string", "format": "uuid", "description": "ID of the application this draft is associated with.", "example": "2a28f60d-fe15-43fe-92c3-5530595d5f51" }, "priorAuthorityType": { "type": [ "string", "null" ], "description": "The type of prior authority being requested.", "enum": [ "EXPERT", "DISBURSEMENT", "COUNSEL" ], "example": "EXPERT" }, "counselType": { "type": [ "string", "null" ], "description": "The counsel type requested.", "enum": [ "KINGS_COUNSEL_ALONE", "TWO_JUNIOR_COUNSEL", "KINGS_COUNSEL_AND_JUNIOR_COUNSEL", "KINGS_COUNSEL_AND_TWO_JUNIOR_COUNSEL" ], "example": "KINGS_COUNSEL_ALONE" }, "expertType": { "type": [ "string", "null" ], "description": "The expert type.", "example": "Child psychologist" }, "expertFullName": { "type": [ "string", "null" ], "description": "Full name of the expert the prior authority is for.", "example": "Dr Joe Bloggs" }, "expertPostcode": { "type": [ "string", "null" ], "description": "Primary business postcode of the expert.", "example": "SW1H 9AJ" }, "expertBasedInLondon": { "type": [ "boolean", "null" ], "description": "Boolean flag to indicate whether the expert is based inside (true) or outside (false) London", "example": true }, "uploadedDocuments": { "type": [ "array", "null" ], "description": "Supporting documents uploaded so far.", "items": { "$ref": "#/components/schemas/UploadedDocument" } }, "billingType": { "type": [ "string", "null" ], "description": "How the work will be billed.", "enum": [ "HOURLY", "FIXED_RATE" ], "example": "HOURLY" }, "hourlyRate": { "type": [ "number", "null" ], "description": "Hourly rate in GBP.", "example": 45.0 }, "timeHours": { "type": [ "integer", "null" ], "format": "int32", "description": "Estimated whole hours.", "example": 2 }, "timeMinutes": { "type": [ "integer", "null" ], "format": "int32", "description": "Estimated additional minutes.", "example": 30, "maximum": 59, "minimum": 0 }, "totalAmount": { "type": [ "number", "null" ], "description": "Total amount in GBP.", "example": 135.0 }, "justification": { "type": [ "string", "null" ], "description": "Detailed rationale explaining why funding is necessary.", "example": "Expert evidence is needed to establish causation." } }, "required": [ "applicationId" ] }, "UploadedDocument": { "type": "object", "description": "A document uploaded as supporting evidence for a prior-authority request.", "properties": { "fileName": { "type": "string", "description": "Filename of the uploaded document.", "example": "abc123.pdf", "minLength": 1 }, "hostedUrl": { "type": "string" } }, "required": [ "fileName" ] }, "PriorAuthority": { "type": "object", "description": "A prior-authority request submitted by a legal aid provider against an existing application.", "properties": { "applicationId": { "type": "string", "format": "uuid", "description": "ID of the application this prior-authority request is associated with.", "example": "5f1b2c3d-1111-2222-3333-444455556666" }, "priorAuthorityType": { "type": "string", "description": "The category of prior authority being requested.", "enum": [ "EXPERT", "DISBURSEMENT", "COUNSEL" ], "example": "EXPERT" }, "expertType": { "type": "string", "description": "The expert type.", "example": "Psychologist" }, "expertFullName": { "type": "string", "description": "Full name of the expert the prior authority is for.", "example": "John Doe" }, "expertPostcode": { "type": "string", "description": "Primary business postcode of the expert.", "example": "SW1H 9AJ" }, "expertBasedInLondon": { "type": "boolean", "description": "Boolean flag to indicate whether the expert is based inside (true) or outside (false) London", "example": true }, "uploadedDocuments": { "type": "array", "description": "Supporting documents uploaded with the request.", "items": { "$ref": "#/components/schemas/UploadedDocument" } }, "billingType": { "type": "string", "description": "How the work will be billed. Required unless priorAuthorityType is COUNSEL.", "enum": [ "HOURLY", "FIXED_RATE" ], "example": "HOURLY" }, "hourlyRate": { "type": "number", "description": "Hourly rate in GBP. Required when billingType is HOURLY.", "example": 50.0 }, "timeHours": { "type": "integer", "format": "int32", "description": "Estimated whole hours. Required when billingType is HOURLY.", "example": 2 }, "timeMinutes": { "type": "integer", "format": "int32", "description": "Estimated additional minutes. Required when billingType is HOURLY.", "example": 30, "maximum": 59, "minimum": 0 }, "totalAmount": { "type": "number", "description": "Total amount in GBP. Required unless priorAuthorityType is COUNSEL.", "example": 125.0 }, "justification": { "type": "string", "description": "Detailed rationale explaining why funding is necessary.", "example": "The case requires specialist expert evidence to proceed.", "minLength": 1 }, "counselType": { "type": "string", "description": "Type of Counsel being applied for. Required when priorAuthorityType is COUNSEL.", "enum": [ "KINGS_COUNSEL_ALONE", "TWO_JUNIOR_COUNSEL", "KINGS_COUNSEL_AND_JUNIOR_COUNSEL", "KINGS_COUNSEL_AND_TWO_JUNIOR_COUNSEL" ], "example": "KINGS_COUNSEL_ALONE." } }, "required": [ "applicationId", "justification", "priorAuthorityType" ] }, "PriorAuthorityApplicationResponse": { "type": "object", "description": "Confirmation returned after a prior-authority application has been submitted.", "properties": { "submissionId": { "type": "string", "format": "uuid", "description": "Identifier assigned to the prior-authority application by the Access Data Store.", "example": "11111111-2222-3333-4444-555555555555" }, "status": { "type": "string", "description": "Outcome of the submission.", "enum": [ "ACCEPTED", "REJECTED" ], "example": "ACCEPTED" }, "submittedAt": { "type": "string", "format": "date-time", "description": "Timestamp the application was accepted by the Access Data Store.", "example": "2026-05-22T10:00:00Z" } } }, "DraftIdResponse": { "type": "object", "properties": { "draftId": { "type": "string", "format": "uuid" } } }, "PriorAuthorityDraftSummary": { "type": "object", "description": "A prior-authority draft returned in a list lookup.", "properties": { "draftId": { "type": "string", "format": "uuid", "description": "Identifier of the draft, assigned when it was created.", "example": "c3b07e24-d92b-410a-9d95-88f117a12b43" }, "timestamp": { "type": "string", "format": "date-time", "description": "Timestamp the draft was last updated.", "example": "2026-05-19T12:00:00Z" }, "draft": { "$ref": "#/components/schemas/PriorAuthorityDraft", "description": "The saved prior-authority form." } } }, "ApplicationSummary": { "type": "object", "description": "Summary of a civil application containing key details.", "properties": { "applicationId": { "type": "string", "format": "uuid", "description": "The unique reference used to identify the application.", "example": "11111111-2222-3333-4444-555555555555" }, "laaReference": { "type": "string", "description": "The LAA reference number of the application.", "example": "LAA-123456" }, "status": { "type": "string", "description": "The current overall status of the application decision.", "example": "APPLICATION_SUBMITTED" }, "submittedAt": { "type": "string", "format": "date-time", "description": "The date and time the application was submitted (in UTC).", "example": "2026-07-22T10:00:00Z" }, "clientFirstName": { "type": "string", "description": "The client first name.", "example": "John" }, "clientLastName": { "type": "string", "description": "The client last name.", "example": "Doe" }, "matterType": { "type": "string", "description": "The matter type of the application.", "example": "SPECIAL_CHILDREN_ACT" } } }, "ApplicationSummaryResponse": { "type": "object", "description": "Response containing a list of application summaries.", "properties": { "paging": { "$ref": "#/components/schemas/Paging", "description": "Pagination metadata for the response." }, "applications": { "type": "array", "description": "List of application summaries matching the requested criteria.", "items": { "$ref": "#/components/schemas/ApplicationSummary" } } } }, "Paging": { "type": "object", "description": "Pagination metadata for a paginated response.", "properties": { "page": { "type": "integer", "format": "int32", "description": "The current page number (0-based).", "example": 0 }, "pageSize": { "type": "integer", "format": "int32", "description": "The number of items per page.", "example": 10 }, "itemsReturned": { "type": "integer", "format": "int32", "description": "The number of items returned in this page.", "example": 10 }, "totalRecords": { "type": "integer", "format": "int32", "description": "The total number of records available.", "example": 100 } } } } } }