openapi: 3.0.1
info:
  title: Email Channel Service API Specification
  description: The Email REST Service provides API endpoints to send emails
  version: 1.0.116
servers:
- description: ''
  url: https://api.uat.btx.fr.banqup.com/core/email
- description: ''
  url: https://api.uat.btx.eu.banqup.com/core/email
paths:
  /v1/emails:
    post:
      tags:
      - Email channel
      summary: Sends email
      description: 'Sends email <br/> Scope: email_send<br/> This Endpoint is part
        of: email-service'
      operationId: sendEmail
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailNotification'
        required: true
      responses:
        '500':
          description: Internal Server Error
          content:
            '*/*':
              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.
        '202':
          description: Email sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailNotificationResponse'
        '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.
      security:
      - oauth2:
        - email_send
components:
  schemas:
    Attachments:
      required:
      - content
      - disposition
      - filename
      - id
      type: object
      properties:
        content:
          type: string
        id:
          type: string
        disposition:
          type: string
        filename:
          type: string
      description: List of email attachments
    Content:
      required:
      - type
      - value
      type: object
      properties:
        type:
          type: string
        value:
          type: string
      description: Email content
    EmailNotification:
      required:
      - reference
      - subject
      - to
      type: object
      properties:
        reference:
          type: string
        to:
          type: array
          description: Recipient email address
          example:
          - Foo Bar <foo@bar.be>
          items:
            type: string
            description: Recipient email address
            example: '["Foo Bar <foo@bar.be>"]'
        from:
          type: array
          description: Sender email address
          example:
          - Foo Bar <foo@bar.be>
          items:
            type: string
            description: Sender email address
            example: '["Foo Bar <foo@bar.be>"]'
        replyTo:
          type: array
          description: Reply-to email address
          example:
          - Foo Bar <foo@bar.be>
          items:
            type: string
            description: Reply-to email address
            example: '["Foo Bar <foo@bar.be>"]'
        cc:
          type: array
          description: Carbon copy email address
          example:
          - Foo Bar <foo@bar.be>
          items:
            type: string
            description: Carbon copy email address
            example: '["Foo Bar <foo@bar.be>"]'
        bcc:
          type: array
          description: Blind carbon copy email address
          example:
          - Foo Bar <foo@bar.be>
          items:
            type: string
            description: Blind carbon copy email address
            example: '["Foo Bar <foo@bar.be>"]'
        subject:
          type: string
          description: Email subject
        content:
          type: array
          description: Email content
          items:
            $ref: '#/components/schemas/Content'
        attachments:
          type: array
          description: List of email attachments
          items:
            $ref: '#/components/schemas/Attachments'
    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
    EmailNotificationResponse:
      required:
      - notificationId
      type: object
      properties:
        notificationId:
          type: string
  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.
