openapi: 3.0.1 info: description: Publicauth API title: Publicauth API version: v1.0.0 paths: /healthcheck: get: operationId: healthCheck responses: "200": content: application/json: schema: type: string example: postgres: healthy: true message: Healthy deadlocks: healthy: true message: Healthy description: OK "503": description: Service unavailable. If any healthchecks fail summary: "Healthcheck endpoint for webhooks. Check database, and deadlocks" tags: - Other /v1/api/auth: get: operationId: authenticate responses: "200": content: application/json: schema: $ref: "#/components/schemas/AuthResponse" description: OK "401": description: Unauthorized security: - BearerAuth: [] summary: Look up the account ID for a token. tags: - Auth /v1/frontend/auth: post: operationId: createTokenForAccount requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateTokenRequest" required: true responses: "200": content: application/json: schema: type: string example: token: api_live_6vra8l8mdtsikncr00etcg4ks3lktu88r8fa7k2re3f211cj8t3m1aeug5 description: OK "422": description: Invalid or missing required parameters summary: Generate and return a new token for the given gateway account ID. tags: - Auth put: operationId: updateTokenDescription requestBody: content: application/json: schema: type: string example: token_link: 550e8400-e29b-41d4-a716-446655440000 description: Description of the token responses: "200": content: application/json: schema: $ref: "#/components/schemas/TokenResponse" description: OK "404": description: Token not found "422": description: Invalid or missing missing parameters summary: Updates the description of an existing dev token. tags: - Auth /v1/frontend/auth/service/{serviceExternalId}/mode/{serviceMode}: delete: operationId: revokeSingleTokenByServiceAndMode parameters: - example: 7d19aff33f8948deb97ed16b2912dcd3 in: path name: serviceExternalId required: true schema: type: string - in: path name: serviceMode required: true schema: type: string enum: - LIVE - TEST requestBody: content: application/json: schema: type: string example: token_link: 74813ca7-1829-4cad-bc0e-684a0288a308 responses: "200": content: application/json: schema: type: string example: revoked: 4 Apr 2022 description: OK "404": description: Token not found summary: Revokes the supplied token for this service and mode tags: - Auth get: operationId: getIssuedTokensForServiceAndMode parameters: - example: 7d19aff33f8948deb97ed16b2912dcd3 in: path name: serviceExternalId required: true schema: type: string - in: path name: serviceMode required: true schema: type: string enum: - LIVE - TEST - example: REVOKED in: query name: state schema: type: string enum: - REVOKED - ACTIVE - example: API in: query name: type schema: type: string enum: - API - PRODUCTS responses: "200": content: application/json: schema: type: object properties: tokens: type: array items: $ref: "#/components/schemas/TokenResponse" description: OK "422": description: Invalid or missing required parameters summary: Retrieves generated tokens for service and mode. tags: - Auth /v1/frontend/auth/service/{serviceExternalId}/mode/{serviceMode}/revoke-all: delete: operationId: revokeTokensForServiceAndMode parameters: - example: 7d19aff33f8948deb97ed16b2912dcd3 in: path name: serviceExternalId required: true schema: type: string - in: path name: serviceMode required: true schema: type: string enum: - LIVE - TEST responses: default: content: '*/*': {} description: default response summary: "Revokes all tokens associated with a service and mode. It is not possible\ \ to tell whether the service actually exists (in connector), so this method\ \ currently does not return a 404." tags: - Auth '/v1/frontend/auth/service/{serviceExternalId}/mode/{serviceMode}/{tokenLink} ': get: operationId: getTokenByServiceAndTokenLink parameters: - example: 7d19aff33f8948deb97ed16b2912dcd3 in: path name: serviceExternalId required: true schema: type: string - in: path name: serviceMode required: true schema: type: string enum: - LIVE - TEST - example: a-token-link in: path name: tokenLink required: true schema: type: string responses: "200": content: application/json: schema: $ref: "#/components/schemas/TokenResponse" description: OK "404": description: Token not found summary: "Get a token by service, mode and token link." tags: - Auth /v1/frontend/auth/{accountId}: delete: operationId: revokeSingleToken parameters: - example: 1 in: path name: accountId required: true schema: type: string requestBody: content: application/json: schema: type: string example: token_link: 74813ca7-1829-4cad-bc0e-684a0288a308 responses: "200": content: application/json: schema: type: string example: revoked: 4 Apr 2022 description: OK "404": description: Token not found summary: Revokes the supplied token for this account tags: - Auth get: operationId: getIssuedTokensForAccount parameters: - example: 1 in: path name: accountId required: true schema: type: string - example: REVOKED in: query name: state schema: type: string enum: - REVOKED - ACTIVE - example: API in: query name: type schema: type: string enum: - API - PRODUCTS responses: "200": content: application/json: schema: type: object properties: tokens: type: array items: $ref: "#/components/schemas/TokenResponse" description: OK "422": description: Invalid or missing required parameters summary: Retrieves generated tokens for gateway account. tags: - Auth /v1/frontend/auth/{accountId}/revoke-all: delete: operationId: revokeTokensForAccount parameters: - example: 1 in: path name: accountId required: true schema: type: string responses: default: content: '*/*': {} description: default response summary: "Revokes all tokens associated with a gateway account. It is not possible\ \ to tell whether the gateway account actually exists (in connector), so this\ \ method currently does not return a 404." tags: - Auth /v1/frontend/auth/{accountId}/{tokenLink}: get: operationId: getTokenByTokenLink parameters: - example: 1 in: path name: accountId required: true schema: type: string - example: a-token-link in: path name: tokenLink required: true schema: type: string responses: "200": content: application/json: schema: $ref: "#/components/schemas/TokenResponse" description: OK "404": description: Token not found summary: Get a token by gateway account id and token link. tags: - Auth components: schemas: AuthResponse: type: object properties: account_id: type: string example: "1234" service_external_id: type: string example: cd1b871207a94a7fa157dee678146acd service_mode: type: string enum: - LIVE - TEST example: LIVE token_link: type: string example: 550e8400-e29b-41d4-a716-446655440000 token_type: type: string enum: - CARD - DIRECT_DEBIT example: CARD CreateTokenRequest: type: object properties: account_id: type: string description: Gateway account to associate the new token to example: "1" writeOnly: true created_by: type: string example: test@example.org writeOnly: true description: type: string description: Description of the new token example: Token description service_external_id: type: string example: cd1b871207a94a7fa157dee678146acd writeOnly: true service_mode: type: string enum: - LIVE - TEST example: LIVE writeOnly: true token_account_type: type: string default: LIVE enum: - LIVE - TEST example: LIVE writeOnly: true token_type: type: string default: CARD enum: - CARD - DIRECT_DEBIT example: CARD writeOnly: true type: type: string default: API enum: - API - PRODUCTS example: API writeOnly: true required: - account_id - created_by - description - service_external_id - service_mode JsonNode: type: object TokenResponse: type: object properties: created_by: type: string example: test@example.org description: type: string example: Description of the token issued_date: type: string example: 04 Apr 2022 - 19:02 last_used: type: string example: 05 Apr 2022 - 19:02 revoked: type: string example: 05 Apr 2022 - 20:02 service_external_id: type: string example: cd1b871207a94a7fa157dee678146acd service_mode: type: string enum: - LIVE - TEST example: live token_link: type: string example: 550e8400-e29b-41d4-a716-446655440000 token_type: type: string enum: - CARD - DIRECT_DEBIT example: CARD type: type: string enum: - API - PRODUCTS example: API securitySchemes: BearerAuth: description: "The Authorisation token needs to be specified in the 'Authorization'\ \ header as `Authorization: Bearer YOUR_API_KEY_HERE`" scheme: bearer type: http