openapi: 3.0.1
info:
  title: Bank of England RTGS Notifications API
  version: 1.5.0
  description: >-
    Notifications are messages generated for the Participant organisation to
    inform that an event has occurred.

     The Bank of England RTGS Notifications API enables an organisation to:
    - Retrieve a list of notifications
  contact:
    email: APITeam@bankofengland.co.uk
    name: RTGS API team
  license:
    url: https://www.bankofengland.co.uk/payment-and-settlement
    name: >-
      Please refer to the API Annex under the "Requirements for use of RTGS
      accounts" section
servers:
  - url: >-
      https://api-test.swiftnet.sipn.swift.com/boe-rtgs-api-pilot-i1/notification-mgmt/np4/v1
    description: NP4 Environment (Non-Prod)
    variables:
      apiPath:
        default: /boe-rtgs-api-pilot-i1/notification-mgmt/np4
      taskApiPath:
        default: /boe-rtgs-api-pilot-i1/task-mgmt/np4
  - url: >-
      https://api-test.swiftnet.sipn.swift.com/boe-rtgs-api-pilot-i1/notification-mgmt/np5/v1
    description: NP5 Environment (Non-Prod)
    variables:
      apiPath:
        default: /boe-rtgs-api-pilot-i1/notification-mgmt/np5
      taskApiPath:
        default: /boe-rtgs-api-pilot-i1/task-mgmt/np5
  - url: >-
      https://api-test.swiftnet.sipn.swift.com/boe-rtgs-api-pilot-i2/notification-mgmt/pp2/v1
    description: PP2 Environment (Dress-Rehearsals)
    variables:
      apiPath:
        default: /boe-rtgs-api-pilot-i2/notification-mgmt/pp2
      taskApiPath:
        default: /boe-rtgs-api-pilot-i2/task-mgmt/pp2
  - url: >-
      https://api-test.swiftnet.sipn.swift.com/boe-rtgs-api-pilot-i3/notification-mgmt/pp2/v1
    description: PP2 Environment (Pre-Prod)
    variables:
      apiPath:
        default: /boe-rtgs-api-pilot-i3/notification-mgmt/pp2
      taskApiPath:
        default: /boe-rtgs-api-pilot-i3/task-mgmt/pp2
  - url: https://api.swiftnet.sipn.swift.com/boe-rtgs-api//notification-mgmt/v1
    description: Live Environment (Prod)
    variables:
      apiPath:
        default: /boe-rtgs-api/notification-mgmt
      taskApiPath:
        default: /boe-rtgs-api/task-mgmt
paths:
  /notifications:
    get:
      tags:
        - Notifications
      summary: Retrieves a list of Notifications.
      description: >-
        Notifications are triggered when an event occurs in RTGS. Notifications
        are split into two different notification types: <br><ol><li>non-task
        Notifications: These are triggered when a Window is opened or closed in
        RTGS, a transaction queue is blocked or unblocked in RTGS, an Account
        Report fails in RTGS or when a Target Average Balance (TAB) Boundary has
        breached in RTGS. </li><li>Task Notifications: These are triggered when
        a task has changed status in RTGS (e.g. when a Multi Step Review request
        has been approved or rejected).</li></ol> <br> This endpoint allows the
        consumer to retrieve a list of notifications, that the consumer is
        authorised to for up to past 30 days. By default, the data is sorted by
        the inserted at field in a descending order.
      operationId: getNotifications
      parameters:
        - name: participantId
          in: query
          description: >-
            Used to filter notifications based on participant id. A unique ID
            for the participant in the RTGS. Accepts multiple values. Only
            supports Equal(eq). Possible values can be fetched from "GET
            /filterValues?resourceName=participants" endpoint.
          required: true
          schema:
            pattern: ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$
            type: string
          example: a4faa192-ddd7-11ed-b5ea-0242ac120002
        - name: team
          in: query
          description: >-
            Used to filter notifications based on the team. The team the
            notifications are for. This is important for task notifications
            which stay within teams (except for PSC who need to be able to view
            all notifications). For example, CMC should only be able to see task
            notifications for their team, whilst PSO should only be able to see
            task notifications for their team. Note: this field is not
            applicable to participants. Only supports Equal(eq). Possible values
            can be fetched from "GET /teams" endpoint.
          required: false
          schema:
            pattern: ^[A-Za-z\s]{1,50}$
            type: string
        - name: insertedAt
          in: query
          description: >-
            Used to filter notifications based on the creation date. Date at
            which the notification was created / generated. This should follow
            the standard ISO 8601 format with UTC offset. Only supports
            Equal(eq)
          required: true
          schema:
            type: string
            format: date
          example: '2022-03-01'
        - name: notificationTypeCode
          in: query
          description: >-
            Used to filter notifications based on the notification code. Unique
            code for the type of notification to which the notification
            preference is associated to in RTGS. Only supports Equal(eq).
            Possible values can be fetched from "GET
            /filterValues?resourceName=notificationDescriptions" endpoint.
          required: false
          schema:
            pattern: ^([A-Z0-9]{1,11}|Task0001)$
            type: string
          example: NCSEINF0001
        - name: limit
          in: query
          description: >-
            Number of items to return in a page. Must be greater than or equal
            to 1  (Default 20)
          required: false
          schema:
            maximum: 500
            minimum: 1
            type: integer
            format: int32
          example: 20
        - name: offset
          in: query
          description: >-
            The number of the record to start the page from. Must be greater
            than 0 and less than 2147483647 (The maximum value for an integer).
            The default value is 0.
          required: false
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int64
          example: 0
        - name: sort
          in: query
          description: >-
            Order to sort results in [direction][field] where direction is
            +(ascending) or -(descending)
          required: false
          schema:
            type: string
          example: +id
        - name: x-userContext
          in: header
          description: >-
            User context is in base64 format. It will include the institution
            BIC. Participants do not need to send this value. This will be
            populated at Network Level.
          required: false
          schema:
            type: string
            format: byte
          example: >-
            eyJhbGciOiJSUzI1NiIsImtpZCI6ImN1cmwgLXYgbGRhcDovL0RJUkwwMS5zd2lmdG5ldC5zaXBuLnN3aWZ0LmNvbTozODkvY249dHNzY2hhbm5lbCxvPXN3bGliZWIzLG89c3dpZnQ/dXNlckNlcnRpZmljYXRlIiwidHlwIjoiSldUIn0=
        - name: x-journeyId
          in: header
          description: >-
            Used to uniquely identify end to end journey of the API request. If
            header is provided in the request, then the same will be replayed in
            response headers. This will be populated at Network Level.
          required: false
          schema:
            maxLength: 64
            minLength: 64
            type: string
          example: 721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
        - name: X-Forwarded-Host
          in: header
          description: >-
            Identifies the original host and port requested by the client in the
            Host HTTP request header. If no port is included, the default port
            for the service requested is implied. This will be populated at
            Network Level.
          required: false
          schema:
            pattern: ^[-a-zA-Z0-9@:%._+~#]{2,256}(:[0-9]{2,4})*$
            type: string
          example: example.com:8080
        - name: X-Forwarded-Path
          in: header
          description: >-
            Identifies the original URL path requested by the client, including
            any query string. This will be populated at Network Level.
          required: false
          schema:
            type: string
          example: /boe-rtgs-api/resource-mgmt/v1/resources?parentName=eq%3Aparent
      responses:
        '200':
          description: Notifications found
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
            Cache-Control:
              description: >-
                Holds directives (instructions) for caching in responses. No
                caching done from API gateway side.
              style: simple
              schema:
                type: string
                example: no-cache, no-store, no-transform
            Content-Language:
              description: >-
                Describes the language(s) intended for the audience. Allowed
                values: "en-GB".
              style: simple
              schema:
                type: string
                example: en-GB
          content:
            application/json;charset=utf-8:
              schema:
                $ref: >-
                  #/components/schemas/NotificationResponseList_OperatorListEndpoints
        '400':
          description: Bad request
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
            Cache-Control:
              description: >-
                Holds directives (instructions) for caching in responses. No
                caching done from API gateway side.
              style: simple
              schema:
                type: string
                example: no-cache, no-store, no-transform
            Content-Language:
              description: >-
                Describes the language(s) intended for the audience. Allowed
                values: "en-GB".
              style: simple
              schema:
                type: string
                example: en-GB
          content:
            application/json;charset=utf-8:
              schema:
                $ref: >-
                  #/components/schemas/APIErrorResponseWrapperDTO_OperatorListEndpoints
              example:
                error:
                  status: '400'
                  id: a1aa1111-1a11-1111-11a1-1aa1aa111a12
                  detail: Invalid parameters
                  errors:
                    - errorCode: EAPIGTW2002
                      detail: Limit parameter is less than 1
        '401':
          description: Unauthorized
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
        '403':
          description: Forbidden
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
        '404':
          description: Record not found
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
            Cache-Control:
              description: >-
                Holds directives (instructions) for caching in responses. No
                caching done from API gateway side.
              style: simple
              schema:
                type: string
                example: no-cache, no-store, no-transform
            Content-Language:
              description: >-
                Describes the language(s) intended for the audience. Allowed
                values: "en-GB".
              style: simple
              schema:
                type: string
                example: en-GB
          content:
            application/json;charset=utf-8:
              schema:
                $ref: >-
                  #/components/schemas/APIErrorResponseWrapperDTO_OperatorListEndpoints
              example:
                error:
                  status: '404'
                  id: a1aa1111-1a11-1111-11a1-1aa1aa111a15
                  detail: Record not found
                  errors:
                    - errorCode: EAPIGTW2017
                      detail: 'Record does not exist for given ID : 88'
        '405':
          description: Method not allowed
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
        '406':
          description: Not acceptable
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
        '429':
          description: Too many request
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
        '500':
          description: Internal server error
          headers:
            x-journeyId:
              description: Used to identify end to end journey of the API request.
              style: simple
              schema:
                type: string
                example: >-
                  721C04F0B91A53908E4233D56E07E35D7C62AE63B881DD50B24FF19315CB4F92
      path: /notifications
      method: GET
components:
  schemas:
    NotificationResponseList_OperatorListEndpoints:
      title: NotificationResponseList
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/OffsetPaginatedListResponseNotification_OperatorListEndpoints
        links:
          $ref: '#/components/schemas/OffsetResponseLinksSchema_OperatorListEndpoints'
    Notification_OperatorListEndpoints:
      title: Notification
      required:
        - insertedAt
        - notificationMessage
        - notificationTypeCode
        - participantId
      type: object
      properties:
        notificationTypeCode:
          pattern: ^([A-Z0-9]{1,11}|Task0001)$
          type: string
          description: >-
            Unique code for the type of notification to which the notification
            preference is associated to in RTGS. Possible values can be fetched
            from "GET /filterValues?resourceName=notificationDescriptions"
            endpoint.
          example: NCSEINF0001
        notificationTypeName:
          pattern: ^[A-Za-z\s\/]{1,100}$
          type: string
          description: >-
            Identifier of the type of notification to which the notification
            preference is associated to. Possible values can be fetched from
            "GET /filterValues?resourceName=notificationDescriptions" endpoint.
          nullable: true
          example: Window Open
        notificationMessage:
          pattern: ^[A-Za-z\s0-9:/.,]{1,200}$
          type: string
          description: >-
            The message contained in the body of the notification generated in
            RTGS.
          example: CHAPS Window Open
        team:
          pattern: ^[A-Za-z\s]{1,50}$
          type: string
          description: >-
            The team the notifications are for. This is important for task
            notifications which stay within teams (except for PSC who need to be
            able to view all notifications). For example, CMC should only be
            able to see task notifications for their team, whilst PSO should
            only be able to see task notifications for their team. Note: this
            field is not applicable to participants.
          nullable: true
          example: ''
        participantId:
          pattern: ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$
          type: string
          description: 'A unique ID for the participant in the RTGS. '
          example: a4faa192-ddd7-11ed-b5ea-0242ac120002
        participantFullName:
          pattern: >-
            ^[\\0-9a-zA-Z\/\-\?\:\(\)\.\,\'\+\s\!\#\$\%\&\*\=\^\_\`\{\|\}~"\;\<\>\@\[\]]{1,100}$
          type: string
          description: 'Full Name of the organisations / participants in the RTGS. '
          nullable: true
          example: Barclays Bank
        insertedAt:
          type: string
          description: >-
            Date and time at which the notification was created. This should
            follow the standard ISO 8601 format with UTC offset.
          format: date-time
          example: '2021-02-22T12:00:00.123456Z'
    OffsetPaginatedListResponseNotification_OperatorListEndpoints:
      title: OffsetPaginatedListResponse
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Notification_OperatorListEndpoints'
        sort:
          type: string
          description: The sort direction and the field name used to sort the resources by.
          example: +id
        totalRecordCount:
          type: integer
          description: The total number of records for a given resource.
          format: int64
          example: 100
        offset:
          type: integer
          description: Current record count offset for this page.
          format: int64
          example: 0
        limit:
          type: integer
          description: The total number of records retrieved per page.
          format: int64
          example: 20
    OffsetResponseLinksSchema_OperatorListEndpoints:
      title: Links
      required:
        - first
        - last
        - self
      type: object
      properties:
        self:
          type: string
          description: A URL to reproduce the current request.
          example: '{apiPath}/v1/resource?offset=60&limit=20'
        first:
          type: string
          description: A URL to retrieve the first page of resources.
          example: '{apiPath}/v1/resource?offset=0&limit=20'
        last:
          type: string
          description: A URL to retrieve the last page of resources
          example: '{apiPath}/v1/resource?offset=300000&limit=20'
        next:
          type: string
          description: A URL to retrieve the next page of resources.
          example: '{apiPath}/v1/resource?offset=80&limit=20'
        previous:
          type: string
          description: A URL to retrieve the previous page of resources
          example: '{apiPath}/v1/resource?offset=40&limit=20'
        taskUrl:
          $ref: '#/components/schemas/TaskUrlSchema_OperatorListEndpoints'
    TaskUrlSchema_OperatorListEndpoints:
      title: TaskLinks
      type: object
      properties:
        Task for Resource 1:
          type: string
          description: A URL to retrieve task information associated to a resource.
          example: '{taskApiPath}/v1/tasks/581ddd74-5151-4c74-ad2f-b2196752bbad'
        Task for Resource 2:
          type: string
          description: A URL to retrieve task information associated to a resource.
          example: '{taskApiPath}/v1/tasks/3d9397d1-e394-4863-be26-0686684bc510'
    APIErrorResponseDTO_OperatorListEndpoints:
      title: APIErrorResponse
      required:
        - detail
        - errors
        - id
        - status
      type: object
      properties:
        status:
          pattern: ^\d{3}$
          type: string
          description: >-
            Standard HTTP Status code defined in <a
            href=https://datatracker.ietf.org/doc/html/rfc7231>RFC 7231</a>
        id:
          maxLength: 36
          minLength: 36
          type: string
          description: >-
            A unique reference (GUID) for the error instance, for audit purposes
            and traceability.
          format: uuid
          example: fb06dbc9-da8d-4927-b0f8-0eec823aaaa7
        detail:
          type: string
          description: Brief error message explaining the error
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsFragment_OperatorListEndpoints'
    APIErrorResponseWrapperDTO_OperatorListEndpoints:
      title: APIErrorResponseWrapper
      type: object
      properties:
        error:
          $ref: '#/components/schemas/APIErrorResponseDTO_OperatorListEndpoints'
    ErrorsFragment_OperatorListEndpoints:
      title: ErrorInfo
      required:
        - detail
        - errorCode
      type: object
      properties:
        errorCode:
          maxLength: 11
          minLength: 11
          pattern: E[A-Z0-9]{6}[0-9]{4}
          type: string
          description: |-
            Custom Error Code consists of the following
             <ul><li>1 char type specifier - 'E' for error codes</li><li>6 character base pattern - A concatenation of 'APIGTW'</li><li>4 digit sequence number - 1000<=x<2000 for system errors, 2000<=x<3000 for business errors, 3000<=x<4000 for technical errors</li></ul>
          example: EAPIGTW2039
        detail:
          type: string
          description: Description of the error detail with further granularity
        uri:
          type: string
          description: >-
            URL to help remediate the problem, or provide more information, or
            to API Reference or help etc.
          format: uri
  securitySchemes:
    oauthBearerToken:
      type: http
      scheme: bearer
      bearerFormat: opaque OAuth 2.0
      description: >-

        The access token obtained as a result of OAuth 2.0 flows. SWIFT supports
        two OAuth grant types depending on the API service.

        * JWT-Bearer grant type [RFC 7523](https://tools.ietf.org/html/rfc7523)

        * Password grant type


        This API uses JWT-Bearer grant type.


        Please visit [SWIFT OAuth Token
        API](https://developer.swift.com/swift-oauth-token-api) page for more
        information and examples on how to generate an OAuth token.

        In this declaration only the basic security element to transport the
        bearer token of an OAuth2 process is declared.securitySchemes:
security:
  - oauthBearerToken: [ ]
