openapi: "3.0.1" info: version: "0.2" title: "Address Credential Issuer Private API" paths: /address: put: parameters: - in: header name: "session_id" schema: type: string format: uuid required: true requestBody: content: application/json: schema: $ref: "#/components/schemas/Address" required: true responses: 200: description: "No addresses provided" 204: description: "Address saved successfully" 403: description: "Session not found or expired" content: application/json: schema: type: object properties: error: type: string error_description: type: string 500: description: "Internal server error" content: application/json: schema: $ref: "#/components/schemas/Error" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: httpMethod: "POST" uri: Fn::Sub: - arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${FunctionArn}:live/invocations - FunctionArn: Fn::If: - IsDevEnvironment - Fn::GetAtt: - SaveAddressTsFunction - Arn - Fn::GetAtt: - AddressFunction - Arn responses: default: statusCode: "200" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" /address-java: put: parameters: - in: header name: "session_id" schema: type: string format: uuid required: true requestBody: content: application/json: schema: $ref: "#/components/schemas/Address" required: true responses: 200: description: "No addresses provided" 204: description: "Address saved successfully" 403: description: "Session not found or expired" content: application/json: schema: type: object properties: error: type: string error_description: type: string 500: description: "Internal server error" content: application/json: schema: $ref: "#/components/schemas/Error" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: httpMethod: "POST" uri: Fn::Sub: - arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${FunctionArn}:live/invocations - FunctionArn: Fn::GetAtt: - AddressFunction - Arn responses: default: statusCode: "200" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" /postcode-lookup: post: parameters: - in: header name: "session_id" schema: type: string format: uuid required: true - $ref: '#/components/parameters/AuditHeader' requestBody: content: application/json: schema: $ref: "#/components/schemas/Postcode" required: true responses: "200": description: "200 response" content: application/json: schema: $ref: "#/components/schemas/PostcodeLookupResponse" "400": description: "400 response" content: application/json: schema: type: "string" "401": description: "401 response" content: application/json: schema: type: "string" "403": description: "403 response" content: application/json: schema: type: "object" properties: error: type: "string" error_description: type: "string" "404": description: "404 response" content: application/json: schema: type: "string" "408": description: "408 response" content: application/json: schema: type: "string" "500": description: "500 response" content: application/json: schema: $ref: "#/components/schemas/Error" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: httpMethod: "POST" uri: Fn::Sub: - arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${FunctionArn}:live/invocations - FunctionArn: Fn::GetAtt: - PostcodeLookupTsFunction - Arn responses: default: statusCode: "200" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" /postcode-lookup-java: post: parameters: - in: header name: "session_id" schema: type: string format: uuid required: true - $ref: '#/components/parameters/AuditHeader' requestBody: content: application/json: schema: $ref: "#/components/schemas/Postcode" required: true responses: "200": description: "200 response" content: application/json: schema: $ref: "#/components/schemas/PostcodeLookupResponse" "400": description: "400 response" content: application/json: schema: type: string "401": description: "401 response" content: application/json: schema: type: string "403": description: "403 response" content: application/json: schema: type: "object" properties: error: type: "string" error_description: type: "string" "404": description: "404 response" content: application/json: schema: type: string "408": description: "408 response" content: application/json: schema: type: string "500": description: "500 response" content: application/json: schema: $ref: "#/components/schemas/Error" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: httpMethod: "POST" uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${PostcodeLookupFunction.Arn}:live/invocations responses: default: statusCode: "200" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" /session: post: parameters: - in: header name: "X-Forwarded-For" description: "IP address of the client" schema: type: string format: string required: false - $ref: "#/components/parameters/AuditHeader" requestBody: content: application/json: schema: $ref: "#/components/schemas/Authorization" required: true responses: "400": description: "400 response" content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: "500 response" content: application/json: schema: $ref: "#/components/schemas/Error" "201": description: "201 response" content: application/json: schema: $ref: "#/components/schemas/Session" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: httpMethod: "POST" uri: Fn::Sub: - arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:${FunctionName}:live/invocations - FunctionName: Fn::If: - UseOAuthCommonLambdas - Fn::Sub: ${OAuth.Outputs.LambdaSessionFunctionName} - Fn::Sub: ${CommonStackName}-SessionFunctionTS responses: default: statusCode: "200" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" /authorization: get: parameters: - $ref: "#/components/parameters/SessionIdHeaderWithDash" - $ref: "#/components/parameters/RedirectUri" - $ref: "#/components/parameters/ClientId" - $ref: "#/components/parameters/ResponseType" - $ref: "#/components/parameters/Scope" - $ref: "#/components/parameters/State" responses: "200": description: "200 response" content: application/json: schema: $ref: "#/components/schemas/AuthorizationResponse" "400": description: "400 response" content: application/json: schema: $ref: "#/components/schemas/Error" "403": description: "403 response" content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: "500 response" content: application/json: schema: $ref: "#/components/schemas/Error" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: type: "aws_proxy" httpMethod: "POST" uri: Fn::Sub: - arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:${FunctionName}:live/invocations - FunctionName: Fn::If: - UseOAuthCommonLambdas - Fn::Sub: ${OAuth.Outputs.LambdaAuthorizationFunctionName} - Fn::Sub: ${CommonStackName}-AuthorizationFunctionTS passthroughBehavior: "when_no_match" /addresses/v2: get: parameters: - $ref: "#/components/parameters/SessionIdHeaderWithUnderscore" responses: "400": $ref: "#/components/responses/Error400" "500": $ref: "#/components/responses/Error500" "200": description: "200 response" content: application/json: schema: $ref: "#/components/schemas/AddressesLookupResponse" x-amazon-apigateway-request-validator: "Validate both" x-amazon-apigateway-integration: httpMethod: "POST" uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetAddressesFunction.Arn}:live/invocations responses: default: statusCode: "200" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" components: parameters: SessionIdHeaderWithUnderscore: name: "session_id" in: header description: A UUID generated by the Session API to act as a primary key for the AddressTable in DynamoDB required: true schema: type: string SessionIdHeaderWithDash: name: session-id in: header description: A UUID generated by the Session API to act as a primary key for the SessionTable in DynamoDB required: true schema: type: string AuditHeader: name: txma-audit-encoded in: header description: An encoded header sent by the FE containing info about request origin required: false schema: type: string RedirectUri: name: redirect_uri in: query required: true schema: format: "uri" type: string ClientId: name: client_id in: query required: true schema: type: string ResponseType: name: response_type in: query required: true schema: type: string Scope: name: scope in: query required: true schema: type: string State: name: state in: query required: true schema: type: string schemas: Authorization: required: - "client_id" - "request" type: "object" properties: client_id: type: "string" minLength: 1 example: "ipv-core-stub" request: type: "string" AuthorizationResponse: required: - "redirect_uri" - "code" - "state" type: "object" properties: code: type: "string" example: "981bb74c-3b5e-462e-ba3a-abf868e5da68" state: type: "string" example: "state" minLength: 1 redirect_uri: type: "string" format: "uri" example: "https://di-ipv-core-stub.london.cloudapps.digital/callback" Error: title: "Error Schema" type: "object" properties: message: type: "string" Session: required: - "session_id" type: "object" properties: session_id: type: "string" AddressesLookupResponse: title: "/addresses Response" type: "object" properties: context: type: "string" addresses: type: "array" items: $ref: "#/components/schemas/CanonicalAddress" PostcodeLookupResponse: title: "Postcode Lookup Response" type: "array" minItems: 1 items: $ref: "#/components/schemas/CanonicalAddress" Postcode: title: "Postcode" type: "object" properties: postcode: type: "string" example: "SW1A 1AA" Address: title: "Address Update Request" type: "array" items: $ref: "#/components/schemas/CanonicalAddress" CanonicalAddress: title: "Canonical Address" type: "object" properties: uprn: type: "number" example: 1234567890 description: "Unique Property Reference Number" organisationName: type: "string" example: "Some Organisation" departmentName: type: "string" example: "Some Department" subBuildingName: type: "string" example: "Some Sub Building" buildingNumber: type: "string" example: "1" dependentStreetName: type: "string" example: "Some Street" doubleDependentAddressLocality: type: "string" example: "Some Town" dependentAddressLocality: type: "string" example: "Some Area" buildingName: type: "string" example: "Some Building" streetName: type: "string" example: "Some Street" addressLocality: type: "string" example: "Some Town" postalCode: type: "string" example: "SW1A 1AA" addressCountry: type: "string" example: "GB" description: "ISO 2-Letter Country Code" addressRegion: type: "string" example: "IL" description: "The state, district, county, parish or province" validFrom: description: "Date in ISO 8601 format, year must not be 0000" type: "string" pattern: "^(?!0000)\\d{4}-\\d{2}-\\d{2}$" example: "2020-01-01" validUntil: description: "Date in ISO 8601 format, year must not be 0000" type: "string" pattern: "^(?!0000)\\d{4}-\\d{2}-\\d{2}$" example: "2020-01-01" responses: Error400: description: "400 response" content: application/json: schema: $ref: "#/components/schemas/Error" Error500: description: "500 response" content: application/json: schema: $ref: "#/components/schemas/Error" x-amazon-apigateway-request-validators: Validate both: validateRequestBody: true validateRequestParameters: true