openapi: 3.0.1
info:
  title: Elevate Mediation API
  description: >
    ### File mediation management

    Provides read access to mediation file entities


    #### Definitions

    * Mediation File - a representation of a mediation file loaded into the
    Elevate billing system
  version: '1.0'
servers:
  - url: https://rest.elevatebilling.com/v1
tags:
  - name: mediation-files
    description: A representation of a mediation file that Elevate loads and processes
paths:
  /mediation-files:
    get:
      tags:
        - mediation-files
      summary: Retrieve page of mediation files loaded into Elevate
      description: >-
        The call is restricted to a max of one month's worth of data and/or the
        first 100 entries retrieved. Use proper pagination to obtain the
        required data
      operationId: getMediationFiles
      x-si-permissions:
        - VIEW_CDR_FILE
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: fileName
          in: query
          description: Filter by fileName
          required: false
          schema:
            type: string
        - name: fileType
          in: query
          description: Filter by fileType
          required: false
          schema:
            type: string
        - name: supplierId
          in: query
          description: Filter by supplierId
          required: false
          schema:
            type: integer
        - name: status
          in: query
          description: Filter by status (ERROR, SUCCESS, PENDING)
          required: false
          schema:
            $ref: '#/components/schemas/MediationFileStatus'
        - name: dateLoaded
          in: query
          description: Filter by dateLoaded
          required: false
          schema:
            $ref: '#/components/schemas/DateTimeFilterParam'
        - name: dateDetectedFrom
          in: query
          description: Filter by dateDetected from date/time (inclusive)
          required: true
          schema:
            $ref: '#/components/schemas/DateTimeFilterParam'
        - name: dateDetectedTo
          in: query
          description: Filter by dateDetected to date/time (exclusive)
          required: true
          schema:
            $ref: '#/components/schemas/DateTimeFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MediationFile'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
components:
  schemas:
    MediationFile:
      required:
        - fileName
        - fileType
        - supplierId
        - status
        - dateDetected
      type: object
      properties:
        id:
          description: Mediation file identifier
          type: integer
          readOnly: true
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        fileName:
          description: Mediation file name
          type: string
          minLength: 0
          maxLength: 255
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
          example: ABCD_9640856_ABCDEF_010821_000000.DAT
        compressedFileName:
          description: >-
            If the file originated in a compressed file then this is the name of
            that file
          type: string
          minLength: 0
          maxLength: 255
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
          example: ABCD_9640856_ABCDEF_010821_000000.DAT.pgp
        fileType:
          description: Mediation file type
          type: string
          minLength: 0
          maxLength: 50
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
          example: SupplierA SSBS
        supplierId:
          description: Mediation supplier id
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        status:
          $ref: '#/components/schemas/MediationFileStatus'
        dateDetected:
          description: When the mediation file was first detected
          readOnly: true
          type: string
          format: date-time
        dateLoaded:
          description: When the mediation file was loaded
          readOnly: true
          type: string
          format: date-time
        totalRecords:
          description: Number of records in the mediation file
          type: integer
          format: int64
          example: 1000
        ignoredRecords:
          description: Number of records ignored in the mediation file
          type: integer
          format: int64
          example: 3
    MediationFileStatus:
      description: Mediation file status
      type: string
      enum:
        - NEW
        - TO_BE_PROCESSED
        - DELETED
        - BEING_PROCESSED
        - ERROR
        - PENDING_DELETE
        - PENDING_REPROCESS
        - PROCESSING_DECOMPRESS
        - SUCCESS
        - DUPLICATE
        - PARTIAL_SUCCESS
        - REPROCESSED
        - ARCHIVED
        - IGNORED
    PageParam:
      description: Page of results to show
      minimum: 1
      type: integer
      format: int32
      example: 1
    ResultsPerPageParam:
      description: Results to return per page
      maximum: 1000
      minimum: 1
      type: integer
      format: int32
      example: 100
    SortParam:
      description: >-
        Comma-delimited list of the fields to sort by - defaults to ascending
        order, suffix :desc to change
      example: id,name | name:desc
      type: string
    FieldsParam:
      description: >-
        Comma-delimited list of the field(s) to return if only a subset is
        required
      example: id,name
      type: string
    DateTimeFilterParam:
      description: >-
        Filter by this date/time value where value can optionally be prefixed
        (gt:|lt:)
      example: yyyy-MM-ddTHH:mm:ssZ | lt:yyyy-MM-ddTHH:mm:ssZ | gt:yyyy-MM-ddTHH:mm:ssZ
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  parameters:
    page:
      name: page
      in: query
      description: Page of results to show
      schema:
        $ref: '#/components/schemas/PageParam'
      required: true
    pageSize:
      name: pageSize
      description: Results to return per page
      in: query
      schema:
        $ref: '#/components/schemas/ResultsPerPageParam'
      required: true
    sort:
      name: sort
      in: query
      description: >-
        Comma-delimited list of the fields to sort by - defaults to ascending
        order, suffix :desc to change
      schema:
        $ref: '#/components/schemas/SortParam'
      required: false
    fields:
      name: fields
      in: query
      description: >-
        Comma-delimited list of the field(s) to return if only a subset is
        required
      schema:
        $ref: '#/components/schemas/FieldsParam'
      required: false
