openapi: 3.0.1
info:
  title: Notification Service API Specification
  description: The Notification REST Service provides API endpoints to send notifications
  version: 1.0.120
servers:
- description: ''
  url: https://api.uat.btx.fr.banqup.com/core/notification
- description: ''
  url: https://api.uat.btx.eu.banqup.com/core/notification
paths:
  /v1/notifications:
    post:
      tags:
      - Notification Acceptor
      summary: Sends notification
      description: 'Sends notifications through defined channels based on specified
        templates <br/> Scope: notification_send<br/> This Endpoint is part of: notification-service'
      operationId: sendNotification
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notification'
        required: true
      responses:
        '202':
          description: Notification sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationResponse'
        '401':
          description: Unauthorized Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 500
                error: INTERNAL
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Internal Server Error
                detail: The server encountered an unexpected error.
      security:
      - oauth2:
        - notification_send
components:
  schemas:
    AppName:
      type: string
      description: App name
      example: Banqup
      enum:
      - Banqup
    ChannelType:
      type: string
      description: Channel type
      example: '["email","sms","push-notification"]'
      enum:
      - email
      - sms
      - push-notification
    DeviceType:
      type: string
      description: Device type
      example: PHONE
      enum:
      - PHONE
      - TABLET
      - WEB
    Notification:
      required:
      - asset
      - channels
      type: object
      properties:
        reference:
          type: string
          description: Custom notification reference. Feedback events will reference
            this.
          example: 00000001-0000-0000-0000-000000000000
        asset:
          type: string
          description: Asset name to be used for notification. Path will be built
            as /template/{template}?type={relevant type for channel}&l={locale}
          example: asset/iam/onboarding/welcome?type=text/plain&l=en
        locale:
          type: string
          description: Locale for notification
          example: en-GB
        data:
          type: object
          additionalProperties:
            type: object
            description: Data specific to the notification
            example:
              invoiceNumber: INV-2025-0042
              paymentStatus: Paid
          description: Data specific to the notification
          example:
            invoiceNumber: INV-2025-0042
            paymentStatus: Paid
        space:
          type: string
          description: The space identifier. Used to retrieve brand, space-specific
            communication settings and access checks.
          format: uuid
          example: e0178e47-b067-452f-9e98-3f16f0085b7e
        subject:
          type: string
          description: Used to retrieve recipient user details from the user store.
          example: 8c66dc06-424d-480e-a827-fb72101d9ea6
        appName:
          $ref: '#/components/schemas/AppName'
        deviceType:
          $ref: '#/components/schemas/DeviceType'
        recipient:
          $ref: '#/components/schemas/Recipient'
        channels:
          $ref: '#/components/schemas/ChannelType'
      description: A notification request body.
      example:
        asset: asset/iam/onboarding/welcome?type=text/plain&l=en
        locale: en
        data:
          invoiceNumber: INV-2025-0042
          paymentStatus: Paid
        space: e0178e47-b067-452f-9e98-3f16f0085b7e
        subject: 8c66dc06-424d-480e-a827-fb72101d9ea6
        recipient:
          firstName: John
          lastName: Smith
          language: en
          email: john.smith@unifiedpost.com
          mobile: 324568785445
          brand: banqup
        channels:
        - email
        - sms
    Recipient:
      required:
      - brand
      - firstName
      - language
      - lastName
      type: object
      properties:
        firstName:
          type: string
          description: The recipient's first name.
          example: John
        lastName:
          type: string
          description: The recipient's last name.
          example: Smith
        language:
          type: string
          description: The preferred language of the recipient.
          example: en-GB
        email:
          pattern: "^(.*<([a-zA-Z0-9_!#$%&’*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+)>)$|^([a-zA-Z0-9_!#$%&’*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+)$"
          type: string
          description: The recipient's email address.
          example: john.smith@example.com
        mobile:
          pattern: \+\d{1,3}\d{4,14}
          type: string
          description: The recipient's mobile number.
          example: 324568785445
        brand:
          type: string
          description: The brand associated with the recipient.
          example: Banqup
      description: Represents the recipient of the asset.
      example:
        id: 8c66dc06-424d-480e-a827-fb72101d9ea6
        firstName: John
        lastName: Smith
        language: en-GB
        email: john.smith@example.com
        mobile: 324568785445
        brand: BTX
    NotificationResponse:
      required:
      - notificationId
      type: object
      properties:
        notificationId:
          type: string
          description: This ID is used as reference ID
          example: 8ffebea7-427c-4b5d-b171-5107aa937a3c
    ApiErrorProblemDetail:
      required:
      - error
      - requestId
      - timestamp
      type: object
      properties:
        status:
          type: integer
          format: int32
        error:
          type: string
        requestId:
          type: string
        timestamp:
          type: string
          format: date-time
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
    NestedProblem:
      required:
      - detail
      - error
      - title
      type: object
      properties:
        error:
          type: string
        title:
          type: string
        detail:
          type: string
        type:
          type: string
          format: uri
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.uat.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
