openapi: "3.1.0" info: title: LPA Store version: "1.0" license: name: MIT url: https://opensource.org/licenses/MIT servers: - url: https://lpa-store.api.opg.service.justice.gov.uk description: Production - url: https://preproduction.lpa-store.api.opg.service.justice.gov.uk description: Preproduction - url: https://development.lpa-store.api.opg.service.justice.gov.uk description: Development security: - {} x-json-schema-faker: alwaysFakeOptionals: false optionalsProbability: 0.5 paths: /lpas: post: operationId: getList summary: Retrieve multiple LPAs parameters: - name: presign-images in: query required: false allowEmptyValue: true description: Replace image path property with a presign URL schema: {} requestBody: content: application/json: schema: $ref: "#/components/schemas/GetList" responses: "200": description: Cases retrieved content: application/json: schema: $ref: "#/components/schemas/GetListResponse" "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/BadRequestError" x-amazon-apigateway-auth: type: "AWS_IAM" x-amazon-apigateway-integration: uri: ${lambda_getlist_invoke_arn} httpMethod: "POST" type: "aws_proxy" contentHandling: "CONVERT_TO_TEXT" /lpas/{uid}: parameters: - name: uid in: path required: true description: The UID of the case schema: type: string pattern: "M(-[0-9]{4}){3}" example: M-7890-0400-4000 - name: presign-images in: query required: false allowEmptyValue: true description: Replace image path property with a presign URL schema: {} put: operationId: putLpa summary: Store an LPA requestBody: content: application/json: schema: $ref: "#/components/schemas/DonorDetails" responses: "201": description: Case created "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/BadRequestError" x-amazon-apigateway-auth: type: "AWS_IAM" x-amazon-apigateway-integration: uri: ${lambda_create_invoke_arn} httpMethod: "POST" type: "aws_proxy" contentHandling: "CONVERT_TO_TEXT" get: operationId: getLpa summary: Retrieve an LPA responses: "200": description: Case found content: application/json: schema: $ref: "#/components/schemas/Lpa" "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/BadRequestError" "404": description: Case not found. content: application/json: schema: $ref: "#/components/schemas/NotFoundError" x-amazon-apigateway-auth: type: "AWS_IAM" x-amazon-apigateway-integration: uri: ${lambda_get_invoke_arn} httpMethod: "POST" type: "aws_proxy" contentHandling: "CONVERT_TO_TEXT" /lpas/{uid}/updates: parameters: - name: uid in: path required: true description: The UID of the case schema: type: string pattern: "M(-[0-9]{4}){3}" example: M-7890-0400-4000 post: operationId: createUpdate summary: Update an LPA requestBody: content: application/json: schema: $ref: "#/components/schemas/Update" responses: "201": description: Update created content: application/json: schema: type: object "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/BadRequestError" x-amazon-apigateway-auth: type: "AWS_IAM" x-amazon-apigateway-integration: uri: ${lambda_update_invoke_arn} httpMethod: "POST" type: "aws_proxy" contentHandling: "CONVERT_TO_TEXT" get: operationId: getUpdates summary: Get list of updates on an LPA responses: "200": description: Updates found content: application/json: schema: allOf: - $ref: "#/components/schemas/Update" - type: object properties: applied: type: string format: date-time author: type: string "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/BadRequestError" "404": description: Updates for LPA not found content: application/json: schema: $ref: "#/components/schemas/NotFoundError" x-amazon-apigateway-auth: type: "AWS_IAM" x-amazon-apigateway-integration: uri: ${lambda_getupdates_invoke_arn} httpMethod: "POST" type: "aws_proxy" contentHandling: "CONVERT_TO_TEXT" /lpas/{uid}/static: parameters: - name: uid in: path required: true description: The UID of the case schema: type: string pattern: "M(-[0-9]{4}){3}" example: M-7890-0400-4000 get: operationId: getStaticLpa summary: Retrieve a static LPA responses: "200": description: Static LPA found content: application/json: schema: $ref: "#/components/schemas/Lpa" "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/BadRequestError" "404": description: Static LPA not found content: application/json: schema: $ref: "#/components/schemas/NotFoundError" x-amazon-apigateway-auth: type: "AWS_IAM" x-amazon-apigateway-integration: uri: ${lambda_getstatic_invoke_arn} httpMethod: "POST" type: "aws_proxy" contentHandling: "CONVERT_TO_TEXT" /health-check: get: operationId: healthCheck summary: Health check endpoint for external services to consume responses: "200": description: Healthy content: application/json: schema: type: object properties: status: type: string example: OK additionalProperties: false "503": description: Service unavailable content: application/json: schema: type: object properties: status: type: string example: Unhealthy additionalProperties: false x-amazon-apigateway-auth: type: "NONE" x-amazon-apigateway-integration: type: "mock" responses: default: statusCode: 200 responseTemplates: application/json: '{"status":"ok", "statusCode":200}' requestTemplates: application/json: '{"statusCode": 200}' passthroughBehavior: "when_no_templates" components: schemas: AbstractError: type: object required: - code - detail properties: code: type: string detail: type: string BadRequestError: allOf: - $ref: "#/components/schemas/AbstractError" - type: object properties: code: enum: ["INVALID_REQUEST"] errors: type: array items: type: object required: - source - detail properties: source: type: string format: jsonpointer detail: type: string example: - source: "/uid" detail: "invalid uid format" NotFoundError: allOf: - $ref: "#/components/schemas/AbstractError" - type: object properties: code: enum: ["NOT_FOUND"] GetList: type: object required: - uids properties: uids: type: array items: type: string pattern: "M(-[0-9]{4}){3}" example: M-7890-0400-4000 GetListResponse: type: object required: - lpas properties: lpas: type: array items: $ref: "#/components/schemas/Lpa" Lpa: $ref: "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/lpa.json" DonorDetails: $ref: "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/donor-details.json" Update: type: object required: - type - changes properties: type: enum: - ATTORNEY_DECISIONS - ATTORNEY_OPT_OUT - ATTORNEY_SIGN - CERTIFICATE_PROVIDER_CONFIRM_IDENTITY - CERTIFICATE_PROVIDER_OPT_OUT - CERTIFICATE_PROVIDER_SIGN - CHANGE_ATTORNEYS - CORRECTION - DONOR_CONFIRM_IDENTITY - DONOR_WITHDRAW_LPA - OPG_STATUS_CHANGE - PAPER_ATTORNEY_ACCESS_ONLINE - PAPER_CERTIFICATE_PROVIDER_ACCESS_ONLINE - PERFECT - REGISTER - SEVER_RESTRICTIONS_AND_CONDITIONS - STATUTORY_WAITING_PERIOD - TRUST_CORPORATION_OPT_OUT - TRUST_CORPORATION_SIGN changes: type: array items: type: object required: - key - old - new properties: key: type: string old: oneOf: - type: string - type: number - type: boolean - type: "null" new: oneOf: - type: string - type: number - type: boolean - type: "null"