openapi: 3.0.1
info:
  title: Email Feedback Handler API Specification
  description: The Feedback Handler provides API endpoints to manage feedback from
    email notifications sent to recipient
  version: 2.0.23
servers:
- description: ''
  url: https://api.uat.btx.fr.banqup.com/core/feedback
- description: ''
  url: https://api.uat.btx.eu.banqup.com/core/feedback
paths:
  /v1/feedback/email/mailgun:
    post:
      tags:
      - Feedback Handler
      summary: Handle feedback
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Manage feedback from email notifications sent to recipient <br/> Scope:
        []<br/> This Endpoint is part of: email-feedback"
      operationId: reportFeedback
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailgunFeedbackRequest'
        required: true
      responses:
        '200':
          description: Feedback reported successfully
          content:
            application/json: {}
        '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.
        '406':
          description: Unacceptable feedback parameters
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '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.
components:
  schemas:
    DeliveryStatus:
      type: object
      properties:
        description:
          type: string
        message:
          type: string
    EventData:
      required:
      - event
      - id
      type: object
      properties:
        event:
          minLength: 1
          type: string
        user-variables:
          $ref: '#/components/schemas/UserVariables'
        timestamp:
          type: string
        id:
          minLength: 1
          type: string
        envelope:
          type: object
        message:
          type: object
        recipient:
          type: string
        reject:
          $ref: '#/components/schemas/Rejection'
        delivery-status:
          $ref: '#/components/schemas/DeliveryStatus'
    MailgunFeedbackRequest:
      type: object
      properties:
        signature:
          $ref: '#/components/schemas/Signature'
        event-data:
          $ref: '#/components/schemas/EventData'
    Rejection:
      type: object
      properties:
        reason:
          type: string
        description:
          type: string
    Signature:
      required:
      - signature
      - timestamp
      - token
      type: object
      properties:
        timestamp:
          minLength: 1
          type: string
        token:
          minLength: 1
          type: string
        signature:
          minLength: 1
          type: string
    UserVariables:
      type: object
      properties:
        reference:
          type: string
        jwtSubject:
          type: string
    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.
