{ "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 requests for prior-authority to the Legal Aid Agency. Requests are forwarded to the Access Data Store" } ], "paths": { "/prior-authority-requests": { "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. The applicationId in the payload identifies which application the request relates to. Returns the submission ID assigned by 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 (missing required field, billing-type / field mismatch, etc.)." } } } }, "/expertTypes": { "get": { "tags": [ "expert-controller" ], "operationId": "getExpertTypes", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "array", "items": { "type": "string" } } } } } } } }, "/applications": { "get": { "tags": [ "application-controller" ], "operationId": "getApplications", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Application" } } } } } } } }, "/applications/{id}": { "get": { "tags": [ "application-controller" ], "operationId": "getApplicationById", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/Application" } } } } } } } }, "components": { "schemas": { "EstimatedTime": { "type": "object", "description": "Estimated time required to carry out the work, in hours and minutes.", "properties": { "hours": { "type": "integer", "format": "int32", "description": "Estimated whole hours.", "example": 2, "minimum": 0 }, "minutes": { "type": "integer", "format": "int32", "description": "Additional minutes (0–59).", "example": 30, "maximum": 59, "minimum": 0 } }, "required": [ "hours", "minutes" ] }, "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" }, "type": { "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", "minLength": 1 }, "uploadedDocuments": { "type": "array", "description": "Supporting documents uploaded with the request.", "items": { "$ref": "#/components/schemas/UploadedDocument" } }, "guidelineRatesExceeded": { "type": "boolean", "description": "True if the requested rates exceed the published LAA guideline rates.", "example": false }, "billingType": { "type": "string", "description": "How the work will be billed.", "enum": [ "HOURLY", "FLAT_RATE" ], "example": "HOURLY" }, "hourlyRate": { "type": "number", "description": "Hourly rate in GBP. Required when billingType is HOURLY.", "example": 50.0 }, "estimatedTime": { "$ref": "#/components/schemas/EstimatedTime", "description": "Estimated time the work will take. Required when billingType is HOURLY." }, "totalAmount": { "type": "number", "description": "Total amount in GBP for hourly billing (hourlyRate * estimatedTime). Required when billingType is HOURLY.", "example": 125.0 }, "flatRateTotalAmount": { "type": "number", "description": "Total flat-rate amount in GBP. Required when billingType is FLAT_RATE.", "example": 249.99 } }, "required": [ "applicationId", "billingType", "expertFullName", "type" ] }, "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 } }, "required": [ "fileName" ] }, "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" } } }, "Application": { "type": "object", "properties": { "applicationId": { "type": "string" }, "status": { "type": "string" }, "submittedAt": { "type": "string", "format": "date-time" }, "lastUpdated": { "type": "string", "format": "date-time" }, "usedDelegatedFunctions": { "type": "boolean" }, "categoryOfLaw": { "type": "string" }, "matterType": { "type": "string" }, "assignedTo": { "type": "string", "format": "uuid" }, "autoGrant": { "type": "boolean" }, "clientFirstName": { "type": "string" }, "clientLastName": { "type": "string" }, "clientDateOfBirth": { "type": "string", "format": "date" }, "laaReference": { "type": "string" }, "officeCode": { "type": "string" }, "applicationType": { "type": "string" }, "lead": { "type": "boolean" } } } } } }