openapi: 3.0.3
info:
  title: Fax Configuration API
  version: '2.0'
  description: |
    The fax configuration API allows you to administer:
      * Mail to Fax 
      * Fax to Email
      * Fax to FTP
      * Fax to Webservice
servers:
  - url: https://fax-config.de2.retarus.com/v2
    description: Production
tags:
  - name: Inbound Fax
    description: View and configure inbound fax numbers
  - name: Inbound Fax Profiles
    description: View and configure inbound fax profiles
  - name: Mail to Fax
    description: View and configure email to fax users
  - name: Mail to Fax Profiles
    description: View and configure email to fax profiles
  - name: Joint Outbound and Inbound
    description: Retrieve joined Mail to Fax user and Fax to Mail number
paths:
  /inbound/numbers:
    get:
      tags:
        - Inbound Fax
      summary: Retrieve inbound number configurations
      description: Retrieve inbound number configurations.
      operationId: getNumbers
      parameters:
        - name: assigned
          in: query
          description: Retrieve only numbers that are assigned to a profile
          schema:
            type: boolean
        - name: prefix
          in: query
          description: Retrieve only numbers that begin with the specified prefix
          schema:
            type: string
          example: '+4989'
        - name: active
          in: query
          description: Retrieve only numbers that are active
          schema:
            type: boolean
        - name: cost-center
          in: query
          description: >-
            Retrieve only numbers where the cost-center matches the specified
            value
          schema:
            type: string
          example: ABC123
        - name: inherit
          in: query
          description: Toggle whether to show settings inherited from the profile
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 'Array of numbers and their settings '
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/InboundFaxNumber'
                    - $ref: '#/components/schemas/InboundFaxToEmailNumber'
                    - $ref: '#/components/schemas/InboundFaxToFtpNumber'
                    - $ref: '#/components/schemas/InboundFaxToWsNumber'
              examples:
                InboundFaxNumbers:
                  $ref: '#/components/examples/InboundFaxNumbers'
                InboundFaxNumbersWithInherit:
                  $ref: '#/components/examples/InboundFaxNumbersWithInherit'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - http-basic-auth: []
  /inbound/numbers/{number}:
    get:
      tags:
        - Inbound Fax
      summary: Retrieve a single inbound fax number
      description: Retrieve the configuration for the single specified inbound fax number.
      operationId: getNumber
      parameters:
        - name: number
          in: path
          description: The inbound fax number
          required: true
          schema:
            type: string
          example: '+443069990000'
        - name: inherit
          in: query
          description: Toggle whether to show inherited fields
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Inbound fax number configuration for the specififed number.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/InboundFaxNumber'
                  - $ref: '#/components/schemas/InboundFaxToEmailNumber'
                  - $ref: '#/components/schemas/InboundFaxToFtpNumber'
                  - $ref: '#/components/schemas/InboundFaxToWsNumber'
              examples:
                FaxToEmailNumber:
                  $ref: '#/components/examples/FaxToEmailNumber'
                FaxToEmailNumberInherit:
                  $ref: '#/components/examples/FaxToEmailNumberInherit'
                FaxToFtpNumberInherit:
                  $ref: '#/components/examples/FaxToFtpNumberInherit'
                FaxToWsNumberInherit:
                  $ref: '#/components/examples/FaxToWsNumberInherit'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownNumber'
      security:
        - http-basic-auth: []
    put:
      tags:
        - Inbound Fax
      summary: Update a single inbound fax number
      description: >-
        Update a single inbound fax number. Any omitted fields are 
        automatically defaulted to null, where null is equivalent to Default ie
        the value will be inherited from the assigned profile.
      operationId: updateNumber
      parameters:
        - name: number
          in: path
          description: The inbound fax number
          required: true
          schema:
            type: string
          example: '+498900000000'
      requestBody:
        description: A list of recipient email addresses, for now
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/InboundFaxNumber'
                - $ref: '#/components/schemas/InboundFaxToEmailNumber'
                - $ref: '#/components/schemas/InboundFaxToFtpNumber'
                - $ref: '#/components/schemas/InboundFaxToWsNumber'
            examples:
              faxToEmailUpdateMinimum:
                $ref: '#/components/examples/FaxToEmailNumberUpdate'
              faxToEmailUpdateAll:
                $ref: '#/components/examples/FaxToEmailNumberUpdateAll'
              faxToFtpUpdateAll:
                $ref: '#/components/examples/FaxToFtpNumberUpdateAll'
              faxToWsUpdateAll:
                $ref: '#/components/examples/FaxToWsNumberUpdateAll'
        required: true
      responses:
        '204':
          description: Successful
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownNumber'
      security:
        - http-basic-auth: []
  /inbound/profiles:
    get:
      tags:
        - Inbound Fax Profiles
      summary: Retrieve inbound profile configurations
      description: Retrieve inbound fax profile configurations.
      operationId: getInboundProfiles
      parameters:
        - name: inherit
          in: query
          description: Toggle whether to show inherited fields
          schema:
            type: boolean
            default: false
        - name: serviceType
          in: query
          schema:
            $ref: '#/components/schemas/InboundProfileServiceType'
        - name: name
          in: query
          schema:
            type: string
          example: Fax2Mail USA
      responses:
        '200':
          description: List of inbound fax profiles
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InboundFaxProfile'
              examples:
                InboundFaxProfiles:
                  $ref: '#/components/examples/InboundFaxProfiles'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - http-basic-auth: []
  /inbound/profiles/{profile}:
    get:
      tags:
        - Inbound Fax Profiles
      summary: Retrieve a single inbound fax profile
      description: Retrieve a specific inbound fax profile.
      operationId: getInboundProfile
      parameters:
        - name: profile
          in: path
          description: The inbound fax profile name
          required: true
          schema:
            type: string
          example: Fax2Mail USA
        - name: inherit
          in: query
          description: Toggle whether to show inherited fields
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Voilà
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboundFaxProfile'
              examples:
                FaxToEmailProfile:
                  $ref: '#/components/examples/FaxToEmailProfile'
                Fax2WSProfile:
                  $ref: '#/components/examples/Fax2WSProfile'
                Fax2FTPProfile:
                  $ref: '#/components/examples/Fax2FTPProfile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownProfile'
      security:
        - http-basic-auth: []
    put:
      tags:
        - Inbound Fax Profiles
      summary: Create an inbound fax profile
      description: Create an inbound fax profile.
      operationId: upsertInboundProfile
      parameters:
        - name: profile
          in: path
          required: true
          schema:
            type: string
          example: FaxToEmail-USA
      requestBody:
        description: A complete profile representation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboundFaxProfileCreate'
            examples:
              FaxToEmailProfile:
                $ref: '#/components/examples/FaxToEmailProfileCreate'
              Fax2WSProfile:
                $ref: '#/components/examples/Fax2WSProfileCreate'
              Fax2FTPProfile:
                $ref: '#/components/examples/Fax2FTPProfileCreate'
        required: true
      responses:
        '200':
          description: Inbound fax profile updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboundFaxProfile'
              examples:
                FaxToEmailProfile:
                  $ref: '#/components/examples/FaxToEmailProfile'
                Fax2WSProfile:
                  $ref: '#/components/examples/Fax2WSProfile'
                Fax2FTPProfile:
                  $ref: '#/components/examples/Fax2FTPProfile'
        '201':
          description: New inbound fax profile created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboundFaxProfile'
              examples:
                FaxToEmailProfile:
                  $ref: '#/components/examples/FaxToEmailProfile'
                Fax2WSProfile:
                  $ref: '#/components/examples/Fax2WSProfile'
                Fax2FTPProfile:
                  $ref: '#/components/examples/Fax2FTPProfile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - http-basic-auth: []
    delete:
      tags:
        - Inbound Fax Profiles
      summary: Delete an inbound fax profile
      description: Delete an inbound fax profile.
      operationId: deleteInboundProfile
      parameters:
        - name: profile
          in: path
          description: The profile name
          required: true
          schema:
            type: string
          example: FaxToEmail-USA
      responses:
        '200':
          description: Inbound fax profile was deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownProfile'
        '409':
          $ref: '#/components/responses/Conflict'
      security:
        - http-basic-auth: []
  /outbound/users/{user}:
    get:
      tags:
        - Mail to Fax
      summary: Retrieve a Mail2Fax user
      description: Retrieve a Mail2Fax user
      operationId: getUser
      parameters:
        - name: user
          in: path
          description: The users email address
          required: true
          schema:
            type: string
          example: john.smith@retarus.com
      responses:
        '200':
          description: The configuration for the requested Mail2Fax user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailToFaxUser'
              examples:
                Mail2FaxUser:
                  $ref: '#/components/examples/Mail2FaxUser'
                Mail2FaxUserAllOptions:
                  $ref: '#/components/examples/Mail2FaxUserAllOptions'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownMail2FaxUser'
      security:
        - http-basic-auth: []
    put:
      tags:
        - Mail to Fax
      summary: Upsert a Mail2Fax user
      description: Create a new or update an existing Mail2Fax user
      operationId: upsertUser
      parameters:
        - name: user
          in: path
          description: The users email address
          required: true
          schema:
            type: string
          example: john.smith@retarus.com
      requestBody:
        description: A complete MailToFaxUser representation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailToFaxUser'
            examples:
              Mail2FaxUser:
                $ref: '#/components/examples/Mail2FaxUserCreate'
              Mail2FaxUserAllOptions:
                $ref: '#/components/examples/Mail2FaxUserAllOptionsCreate'
        required: true
      responses:
        '200':
          description: Mail2Fax user updated
        '201':
          description: Mail2Fax user created
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownMail2FaxUser'
        '409':
          $ref: '#/components/responses/Conflict'
    delete:
      tags:
        - Mail to Fax
      summary: Delete a Mail2Fax user
      description: Delete a Mail2Fax user
      operationId: deleteUser
      parameters:
        - name: user
          in: path
          description: The Mail2Fax user's email address
          required: true
          schema:
            type: string
          example: john.smith@retarus.com
      responses:
        '200':
          description: Mail2Fax user deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownMail2FaxUser'
      security:
        - http-basic-auth: []
    patch:
      tags:
        - Mail to Fax
      summary: Patch a Mail2Fax user
      description: Patch (update) a Mail2Fax user
      operationId: patchUser
      parameters:
        - name: user
          in: path
          description: The users email address
          required: true
          schema:
            type: string
          example: john.smith@retarus.com
      requestBody:
        description: A json patch object according to RFC 6902
        required: true
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/Mail2FaxUserPatch'
            examples:
              Mail2FaxUserPatch:
                $ref: '#/components/examples/Mail2FaxUserPatch'
      responses:
        '200':
          description: Mail2Fax user updated
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownMail2FaxUser'
        '409':
          $ref: '#/components/responses/Conflict'
      security:
        - http-basic-auth: []
  /outbound/users:
    get:
      tags:
        - Mail to Fax
      summary: Retrieve Mail2Fax users
      description: Retrieve Mail2Fax users
      operationId: getUsers
      parameters:
        - name: profile
          in: query
          description: Retrieve only users that are assigned to the specified profile
          schema:
            type: string
          example: default
        - name: client
          in: query
          description: Retrieve only users that are assigned to the specified client
          schema:
            type: string
          example: default
        - name: search
          in: query
          description: >-
            Retrieve only users whose email address, profile or client matches
            the specified search string
          schema:
            type: string
          example: john.smith@retarus.com
        - name: fuzzy
          in: query
          description: Switch between exact- and contains-match
          schema:
            type: string
          example: false
        - name: limit
          in: query
          description: Number of users to return in the response
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          description: Retrieve users starting with the offset
          schema:
            type: integer
            format: int32
            default: 0
        - name: template
          in: query
          description: Retrieve users with the specified coverpage template
          schema:
            type: string
          example: coverpage_us_sales.rtf
      responses:
        '200':
          description: '#FIXME Add a description'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MailToFaxUser'
              examples:
                Mail2FaxUsers:
                  $ref: '#/components/examples/Mail2FaxUsers'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - http-basic-auth: []
  /joint/accounts/{correlation-id}:
    get:
      tags:
        - Joint Outbound and Inbound
      summary: Retrieve joint fax accounts
      description: Retrieve joint fax accounts
      operationId: getAccounts
      parameters:
        - name: correlation-id
          in: path
          description: >-
            Retrieve inbound numbers and outbound users correlated by the
            specified id
          required: true
          schema:
            type: string
            default: aecd8419-6bf4-4e17-9380-b3236297ecfa
          example: aecd8419-6bf4-4e17-9380-b3236297ecfa
      responses:
        '200':
          description: Voilà
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JointAccounts'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - http-basic-auth: []
  /outbound/profiles:
    get:
      tags:
        - Mail to Fax Profiles
      summary: Retrieve Mail2Fax profiles
      description: Retrieve Mail2Fax profiles.
      operationId: getMail2FaxProfiles
      parameters:
        - name: limit
          in: query
          description: Limit the amount of profiles returned
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          description: 'Skip the specified amount of profiles #FIXME'
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: List of Mail2Fax profiles matching the search criteria
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Mail2FaxProfile'
              examples:
                Mail2FaxProfiles:
                  $ref: '#/components/examples/Mail2FaxProfiles'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - http-basic-auth: []
  /outbound/profiles/{profile}:
    get:
      tags:
        - Mail to Fax Profiles
      summary: Retrieve a Mail2Fax profile
      description: Retrieve a specifc Mail2Fax profile
      operationId: getMail2FaxProfile
      parameters:
        - name: profile
          in: path
          description: The profile name
          required: true
          schema:
            type: string
          example: default
      responses:
        '200':
          description: The requested Mail2Fax profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail2FaxProfile'
              examples:
                Mail2FaxProfile:
                  $ref: '#/components/examples/Mail2FaxProfile'
                Mail2FaxProfileAllOptions:
                  $ref: '#/components/examples/Mail2FaxProfileAllOptions'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownProfile'
      security:
        - http-basic-auth: []
    put:
      tags:
        - Mail to Fax Profiles
      summary: Insert or update a Mail2Fax profile
      description: Create a new or update an existing Mail2Fax profile
      operationId: upsertMail2FaxProfile
      parameters:
        - name: profile
          in: path
          description: The profile name
          required: true
          schema:
            type: string
          example: default
      requestBody:
        description: A complete Mail2Fax profile representation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mail2FaxProfile'
            examples:
              Mail2FaxProfileCreate:
                $ref: '#/components/examples/FaxToEmailProfileCreate'
              Mail2FaxProfileAllOptionsCreate:
                $ref: '#/components/examples/Mail2FaxProfileAllOptionsCreate'
        required: true
      responses:
        '200':
          description: Mail2Fax profile updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail2FaxProfile'
        '201':
          description: Mail2Fax profile created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail2FaxProfile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownProfile'
      security:
        - http-basic-auth: []
    delete:
      tags:
        - Mail to Fax Profiles
      summary: Delete a Mail2Fax profile
      description: Delete the specified Mail2Fax profile
      operationId: deleteMail2FaxProfile
      parameters:
        - name: profile
          in: path
          description: The profile name
          required: true
          schema:
            type: string
          example: retarus-usa-sales
      responses:
        '200':
          description: Mail2Fax profile deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownProfile'
      security:
        - http-basic-auth: []
    patch:
      tags:
        - Mail to Fax Profiles
      summary: Patch a single outbound fax profile
      description: 'Patch a single outbound fax profile. #FIXME this description'
      operationId: patchMail2FaxProfile
      parameters:
        - name: profile
          in: path
          description: The profile name
          required: true
          schema:
            type: string
          example: default
      requestBody:
        description: A json patch object according to RFC 6902
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Mail2FaxProfilePatch'
      responses:
        '200':
          description: Voilà
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail2FaxProfile'
        '201':
          description: Voilà
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailToFaxUser'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/UnknownProfile'
      security:
        - http-basic-auth: []
components:
  schemas:
    CoverSheetSettings:
      type: object
      properties:
        fileName:
          type: string
        dateFormat:
          type: string
        timeFormat:
          type: string
    DialingSettings:
      type: object
      properties:
        countryCode:
          type: string
        areaCode:
          type: string
    FaxSettings:
      type: object
      properties:
        csid:
          type: string
        costCenter:
          type: string
        header:
          type: string
        blacklist:
          type: boolean
        paperSize:
          type: string
        resolution:
          type: string
        preferredMimeType:
          type: string
        attachmentsOnly:
          type: boolean
        suppressBlankPages:
          type: boolean
    InboundProfileServiceType:
      type: string
      enum:
        - Fax2Mail
        - Fax2WS
        - Fax2FTP
    GeneralUserSettings:
      type: object
      properties:
        client:
          type: string
        profile:
          type: string
        active:
          type: boolean
        timezone:
          type: string
    MailToFaxUser:
      type: object
      properties:
        email:
          type: string
        general:
          $ref: '#/components/schemas/GeneralUserSettings'
        fax:
          $ref: '#/components/schemas/FaxSettings'
        dialing:
          $ref: '#/components/schemas/DialingSettings'
        reportEmail:
          $ref: '#/components/schemas/ReportEmailSettings'
        coverSheet:
          $ref: '#/components/schemas/CoverSheetSettings'
        personalization:
          type: object
          additionalProperties:
            type: string
    ReportEmailSettings:
      type: object
      properties:
        language:
          type: string
        reportFormat:
          type: string
        sender:
          type: string
        recipients:
          type: string
        recipientsIfError:
          type: string
        recipientsCc:
          type: string
        attachTiff:
          type: boolean
        attachTiffOnlyIfError:
          type: boolean
        attachPdf:
          type: boolean
        sortByStatus:
          type: string
        reportRecipients:
          type: string
        errorReportRecipients:
          type: string
        copyStatusReports:
          type: string
    InboundFaxNumber:
      type: object
      properties:
        number:
          type: string
          readOnly: true
        displayNumber:
          description: >-
            The display number is used in the meta provided to the user or
            application, and in reporting. If it is null, the actual number will
            be used.
          type: string
        comments:
          type: string
        faxId:
          description: CSID
          type: string
        costCenter:
          type: string
        active:
          description: >-
            If the number should be active or not. If it is not active, when the
            number is called the repsonse will be wrong number.
          type: boolean
        profile:
          description: The assigned profile display name.
          type: string
          readOnly: true
    InboundFaxToEmailNumber:
      allOf:
        - $ref: '#/components/schemas/InboundFaxNumber'
        - type: object
          properties:
            email:
              type: object
              properties:
                recipients:
                  type: array
                  items:
                    type: string
                language:
                  $ref: '#/components/schemas/InboundFaxLanguage'
                documentFormat:
                  $ref: '#/components/schemas/InboundFaxDocumentFormat'
    InboundFaxToFtpNumber:
      allOf:
        - $ref: '#/components/schemas/InboundFaxNumber'
        - type: object
          properties:
            ftp:
              type: object
              properties:
                directory:
                  type: string
                  writeOnly: true
                language:
                  $ref: '#/components/schemas/InboundFaxLanguage'
                documentFormat:
                  $ref: '#/components/schemas/InboundFaxDocumentFormat'
    InboundFaxToWsNumber:
      allOf:
        - $ref: '#/components/schemas/InboundFaxNumber'
        - type: object
          properties:
            webservice:
              type: object
              properties:
                language:
                  $ref: '#/components/schemas/InboundFaxLanguage'
                documentFormat:
                  $ref: '#/components/schemas/InboundFaxDocumentFormat'
    InboundFaxLanguage:
      type: string
      enum:
        - de
        - en
        - fr
        - es
        - pt
    InboundFaxDocumentFormat:
      type: string
      enum:
        - TIF
        - PDF
        - PDF_A
    ProfileAssignment:
      type: object
      properties:
        profile.display_name:
          type: string
          writeOnly: true
        number.customer_namespace_no:
          type: string
          writeOnly: true
        profile:
          type: string
        number:
          type: string
    ProfileAssignmentUpdate:
      type: object
      properties:
        profile:
          type: string
    InboundFaxProfile:
      type: object
      properties:
        name:
          type: string
        serviceType:
          $ref: '#/components/schemas/InboundProfileServiceType'
    InboundFaxProfileCreate:
      type: object
      properties:
        serviceType:
          $ref: '#/components/schemas/InboundProfileServiceType'
    InboundFaxProfilePatch:
      type: array
      items:
        $ref: '#/components/schemas/PatchDocument'
    Mail2FaxProfilePatch:
      type: array
      items:
        $ref: '#/components/schemas/PatchDocument'
    Mail2FaxUserPatch:
      type: array
      items:
        $ref: '#/components/schemas/PatchDocument'
    PatchDocument:
      description: A JSONPatch document as defined by RFC 6902
      required:
        - op
        - path
      properties:
        op:
          type: string
          description: The operation to be performed
          enum:
            - add
            - remove
            - replace
            - move
            - copy
            - test
        path:
          type: string
          description: A JSON-Pointer
        value:
          type: object
          description: The value to be used within the operations.
        from:
          type: string
          description: A string containing a JSON Pointer value.
    RingMasterDao:
      type: object
      properties:
        uri:
          type: string
          format: uri
    User:
      type: object
      properties:
        name:
          type: string
        customerNumber:
          type: string
        roles:
          uniqueItems: true
          type: array
          items:
            type: string
        ringmasterDao:
          $ref: '#/components/schemas/RingMasterDao'
    GeneralProfileSettings:
      type: object
      properties:
        name:
          type: string
        active:
          type: boolean
        timezone:
          type: string
    Mail2FaxProfile:
      type: object
      properties:
        name:
          type: string
        general:
          $ref: '#/components/schemas/GeneralProfileSettings'
        fax:
          $ref: '#/components/schemas/FaxSettings'
        dialing:
          $ref: '#/components/schemas/DialingSettings'
        reportEmail:
          $ref: '#/components/schemas/ReportEmailSettings'
        coverSheet:
          $ref: '#/components/schemas/CoverSheetSettings'
        personalization:
          type: object
          additionalProperties:
            type: string
    JsonNode:
      type: object
      properties:
        valueNode:
          type: boolean
        containerNode:
          type: boolean
        missingNode:
          type: boolean
        object:
          type: boolean
        nodeType:
          type: string
          enum:
            - ARRAY
            - BINARY
            - BOOLEAN
            - MISSING
            - 'NULL'
            - NUMBER
            - OBJECT
            - POJO
            - STRING
        pojo:
          type: boolean
        number:
          type: boolean
        integralNumber:
          type: boolean
        floatingPointNumber:
          type: boolean
        short:
          type: boolean
        int:
          type: boolean
        long:
          type: boolean
        float:
          type: boolean
        double:
          type: boolean
        bigDecimal:
          type: boolean
        bigInteger:
          type: boolean
        textual:
          type: boolean
        boolean:
          type: boolean
        binary:
          type: boolean
        array:
          type: boolean
        empty:
          type: boolean
        'null':
          type: boolean
    JointAccounts:
      type: object
      properties:
        correlationId:
          type: string
        inbound:
          type: array
          items:
            $ref: '#/components/schemas/InboundFaxNumber'
        outbound:
          type: array
          items:
            $ref: '#/components/schemas/MailToFaxUser'
    Error:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: string
  responses:
    Unauthorized:
      description: Valid credentials must be provided
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 401
            message: Credentials are required to access this resource.
    Forbidden:
      description: Access to the ressource is not allowed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 403
            message: Forbidden
    UnknownNumber:
      description: Number does not exsist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 404
            message: Unknown number
    UnknownProfile:
      description: Inbound fax profile does not exsist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 404
            message: Unknown profile
    UnknownMail2FaxUser:
      description: Mail2Fax user does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 404
            message: User does not exist
            details: john.smith@retarus.com
    Conflict:
      description: '#FIXME'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 409
            message: null
  examples:
    InboundFaxNumbersWithInherit:
      summary: List of all numbers with inherit enabled
      value:
        - number: '+498955281201'
          displayNumber: '+4980012345678'
          faxId: retarus
          active: true
          profile: Fax2FTP Orders
          ftp:
            language: de
            documentFormat: TIFF
            directory: other
        - number: '+498955281919'
          faxId: retarus
          active: true
          profile: Fax2FTP Orders
          ftp:
            language: de
            documentFormat: TIFF
            directory: orders
        - number: '+33187166310'
          faxId: retarus
          active: true
          profile: Fax2WS Lab Reports
          webservice:
            language: fr
            documentFormat: PDF
        - number: '+12012051606'
          faxId: retarus
          active: true
          profile: Fax2Mail USA
          email:
            language: en
            documentFormat: PDF
            recipients:
              - sales-helpdesk@retarus.com
              - crm@retarus.com
        - number: '+12012051606'
          comments: Sales fax number USA - New York Office
          faxId: retarus
          costCenter: USA - Sales
          active: true
          profile: Fax2Mail USA
          email:
            language: en
            documentFormat: PDF
            recipients:
              - sales-helpdesk@retarus.com
              - crm@retarus.com
        - number: '+498955281919'
    InboundFaxNumbers:
      summary: List of all numbers
      value:
        - number: '+498955281201'
          displayNumber: '+4980012345678'
          profile: Fax2FTP Orders
          ftp:
            directory: other
        - number: '+498955281919'
          profile: Fax2FTP Orders
          ftp: {}
        - number: '+33187166310'
          profile: Fax2WS Lab Reports
          webservice: {}
        - number: '+12012051606'
          profile: Fax2Mail USA
          email:
            recipients:
              - sales-helpdesk@retarus.com
              - crm@retarus.com
        - number: '+12012051606'
          comments: Sales fax number USA - New York Office
          costCenter: USA - Sales
          profile: Fax2Mail USA
          email:
            recipients:
              - sales-helpdesk@retarus.com
              - crm@retarus.com
        - number: '+498955281919'
    FaxToEmailNumberInherit:
      summary: Fax to Email number configuration with inherit
      value:
        costCenter: Consulting
        number: 0049/89/208076-5001
        displayNumber: '+499876543210'
        comments: initial Comment
        faxId: initial CSID
        active: true
        profile: FaxToEmail
        email:
          language: de
          documentFormat: PDF
          recipients:
            - recipient@null.dev.retloc
    FaxToFtpNumberInherit:
      summary: Fax to FTP number configuration with inherit
      value:
        costCenter: Consulting
        number: 0049/89/208076-5001
        displayNumber: '+499876543210'
        comments: initial Comment
        faxId: initial CSID
        active: true
        profile: FaxToSFTP
        ftp:
          language: de
          documentFormat: TIF
          directory:
            - fax2ftp
    FaxToWsNumberInherit:
      summary: Fax to webservice number configuration with inherit
      value:
        costCenter: Consulting
        number: 0049/89/208076-5001
        displayNumber: '+499876543210'
        comments: initial Comment
        faxId: initial CSID
        active: true
        profile: FaxToWS
        webservice:
          language: de
          documentFormat: TIF
    FaxToEmailNumber:
      summary: Fax to Email number configuration without inherit
      value:
        number: 0049/89/208076-5001
        profile: FaxToEmail
        email:
          recipients:
            - recipient@null.dev.retloc
    FaxToEmailNumberUpdate:
      summary: Set just the recipient for a Fax to Email number
      description: >-
        Set the email recipient for Fax to Email number, defaulting all other
        settings to the values from the profile - ie inherit the remaing
        settings.
      value:
        email:
          recipients:
            - john.smith@acme.com
    FaxToEmailNumberUpdateAll:
      summary: Set everything for Fax to Email number
      value:
        costCenter: Sales
        displayNumber: '+498900000000'
        comments: Inbound fax number for John Smith - set on 01.01.2021
        faxId: '498900000000'
        active: true
        email:
          language: en
          documentFormat: PDF
          recipients:
            - ann.smith@acme.com
            - john.smith@acme.com
    FaxToFtpNumberUpdateAll:
      summary: Set everything for a Fax to FTP number
      value:
        costCenter: Sales
        displayNumber: '+498900000000'
        comments: Inbound fax number for John Smith - set on 01.01.2021
        faxId: '498900000000'
        active: true
        ftp:
          language: en
          documentFormat: PDF
          directory: sales
    FaxToWsNumberUpdateAll:
      summary: Set everything for a Fax to Webservice number.
      value:
        costCenter: Sales
        displayNumber: '+498900000000'
        comments: Inbound fax number for John Smith - set on 01.01.2021
        faxId: '498900000000'
        active: true
        webservice:
          language: en
          documentFormat: PDF
    InboundFaxProfiles:
      summary: Inbound fax profiles
      value:
        - name: Fax2FTP Orders
          serviceType: Fax2FTP
        - name: Fax2WS Lab Reports
          serviceType: Fax2WS
        - name: Fax2Mail USA
          serviceType: Fax2Mail
    FaxToEmailProfile:
      summary: Fax to Email Profile
      value:
        name: FaxToEmail-USA
        serviceType: Fax2Mail
    Fax2WSProfile:
      summary: Fax to Applications - Webservice Push - Profile
      value:
        name: Fax2WS-Orders
        serviceType: Fax2WS
    Fax2FTPProfile:
      summary: Fax to Applications - FTP - Profile
      value:
        name: Fax2FTP-Orders
        serviceType: Fax2FTP
    FaxToEmailProfileCreate:
      summary: Fax to Email Profile
      value:
        serviceType: Fax2Mail
    Fax2WSProfileCreate:
      summary: Fax to Applications - Webservice Push - Profile
      value:
        serviceType: Fax2WS
    Fax2FTPProfileCreate:
      summary: Fax to Applications - FTP - Profile
      value:
        serviceType: Fax2FTP
    Mail2FaxUser:
      summary: Basic Mail2Fax user
      description: >-
        A typical Mail2Fax user with only a user specific cost center and a few
        personalization values
      value:
        email: john.smith@retarus.com
        personalization:
          department: Sales
          title: Sales Representative
        general:
          client: default
          profile: default
        fax:
          costCenter: Sales-USA
    Mail2FaxUserAllOptions:
      summary: Mail2Fax user with all options
      description: A Mail2Fax user with all options set within the user
      value:
        email: john.smith@retarus.com
        dialing:
          countryCode: '+1'
          areaCode": '215'
        reportEmail:
          language: es
          sender: faxservice-admin@retarus.com
          recipients: fax-delivered@retarus.com
          recipientsIfError: fax-not-delivered@retarus.com
          recipientsCc: archive-fax@retarus.com
          attachTiff: true
          attachTiffOnlyIfError: true
          attachPdf: true
          sortByStatus: errors-first
        coverSheet:
          fileName: retarus-partner-sales-cover.rtf
          dateFormat: dd.MM.yyyy
          timeFormat: HH:mm:ss
        personalization:
          department: Sales
          title: Sales Representative
        general:
          client: default
          profile: default
          active: true
          timezone: US/Eastern
        fax:
          csid": Retarus - Partner Sales
          costCenter: Partner-Sales-USA
          header: '%0f %d.%m.%Y %H:%M:%S Retarus Partner Sales from %e for %C %r%P/%T'
          blacklist: false
          paperSize: letter
          resolution: high
          preferredMimeType: text/plain
          attachmentsOnly: true
          suppressBlankPages: true
    Mail2FaxUsers:
      summary: List of Mail2Fax users"
      value:
        - email: john.smith@retarus.com
          personalization:
            department: Sales
            title: Sales Representative
          general:
            client: default
            profile: default
            active: true
          fax:
            costCenter: Sales-USA
        - email: max.mustermann@retarus.de
          personalization:
            department: Vertrieb
            title: Vertriebsmitarbeiter
          general:
            client: default
            profile: default
            active: true
          fax:
            costCenter: Sales-DEU
    Mail2FaxUserCreate:
      summary: Basic Mail2Fax user
      description: >-
        A typical Mail2Fax user with only a user specific cost center and a few
        personalization values
      value:
        personalization:
          department: Sales
          title: Sales Representative
        general:
          client: default
          profile: default
          active: true
        fax:
          costCenter: Sales-USA
    Mail2FaxUserAllOptionsCreate:
      summary: Mail2Fax user with all options
      description: A Mail2Fax user with all options set within the user
      value:
        dialing:
          countryCode: 1
          areaCode": 215
        reportEmail:
          language: es
          sender: faxservice-admin@retarus.com
          recipients: fax-delivered@retarus.com
          recipientsIfError: fax-not-delivered@retarus.com
          recipientsCc: archive-fax@retarus.com
          attachTiff: true
          attachTiffOnlyIfError: true
          attachPdf: true
          sortByStatus: errors-first
        coverSheet:
          fileName: retarus-usa-sales-cover.rtf
          dateFormat: MM/dd/yyyy
          timeFormat: h:mm a
        personalization:
          department: Sales
          title: Sales Representative
        general:
          client: default
          profile: default
          active: true
          timezone: US/Eastern
        fax:
          csid: Retarus - Sales
          costCenter: Partner-Sales-USA
          header: '%0f %d.%m.%Y %H:%M:%S Retarus Partner Sales from %e for %C %r%P/%T'
          blacklist: false
          paperSize: letter
          resolution: high
          preferredMimeType: text/plain
          attachmentsOnly: true
          suppressBlankPages: true
    Mail2FaxUserPatch:
      summary: Change the cost center
      description: Change the cost center of the Mail2Fax user
      value:
        path: /fax
        value:
          costCenter: Retarus-Sales-USA
        op: add
    Mail2FaxProfiles:
      summary: List of Mail2Fax profiles
      value:
        - name: Retarus-USA-Sales
          dialing:
            countryCode: 1
            areaCode: 201
          reportEmail:
            language: en
          coverSheet:
            dateFormat: MM/dd/yyyy
            timeFormat: h:mm a
          personalization:
            company: retarus (North America) Inc.
          general:
            timezone: US/Eastern
          fax:
            csid: Retarus USA
            costCenter: Retarus-USA-Sales
            paperSize: letter
        - name: Retarus-DE-Sales
          dialing:
            countryCode: 49
            areaCode: 89
          reportEmail:
            language: de
          coverSheet:
            dateFormat: dd.MM.yyyy
            timeFormat: HH:mm:ss
          personalization:
            company: retarus GmbH.
          general:
            timezone: Europe/Berlin
          fax:
            csid: Retarus GmbH.
            costCenter: Retarus-DE-Sales
            paperSize: A4
    Mail2FaxProfile:
      summary: Basic Mail2Fax profile
      value:
        name: Retarus-USA-Sales
        dialing:
          countryCode: 1
          areaCode: 201
        reportEmail:
          language: en
        coverSheet:
          dateFormat: MM/dd/yyyy
          timeFormat: h:mm a
        personalization:
          company: retarus (North America) Inc.
        general:
          timezone: US/Eastern
        fax:
          csid: Retarus USA
          costCenter: Retarus-USA-Sales
          paperSize: letter
    Mail2FaxProfileAllOptions:
      summary: Mail2Fax profile with all options
      value:
        name: Retarus-USA-Sales
        dialing:
          countryCode: 1
          areaCode": 215
        reportEmail:
          language: es
          sender: faxservice-admin@retarus.com
          recipients: fax-delivered@retarus.com
          recipientsIfError: fax-not-delivered@retarus.com
          recipientsCc: archive-fax@retarus.com
          attachTiff: true
          attachTiffOnlyIfError: true
          attachPdf: true
          sortByStatus: errors-first
        coverSheet:
          fileName: retarus-usa-sales-cover.rtf
          dateFormat: MM/dd/yyyy
          timeFormat: h:mm a
        personalization:
          department: Sales
          title: Sales Representative
        general:
          client: default
          profile: default
          active: true
          timezone: US/Eastern
        fax:
          csid: Retarus - Sales
          costCenter: Partner-Sales-USA
          header: '%0f %d.%m.%Y %H:%M:%S Retarus Partner Sales from %e for %C %r%P/%T'
          blacklist: false
          paperSize: letter
          resolution: high
          preferredMimeType: text/plain
          attachmentsOnly: true
          suppressBlankPages: true
    Mail2FaxProfileCreate:
      summary: Basic Mail2Fax profile
      value:
        dialing:
          countryCode: 1
          areaCode: 201
        reportEmail:
          language: en
        coverSheet:
          dateFormat: MM/dd/yyyy
          timeFormat: h:mm a
        personalization:
          company: retarus (North America) Inc.
        general:
          timezone: US/Eastern
        fax:
          csid: Retarus USA
          costCenter: Retarus-USA-Sales
          paperSize: letter
    Mail2FaxProfileAllOptionsCreate:
      summary: Mail2Fax profile with all options
      value:
        dialing:
          countryCode: 1
          areaCode": 215
        reportEmail:
          language: es
          sender: faxservice-admin@retarus.com
          recipients: fax-delivered@retarus.com
          recipientsIfError: fax-not-delivered@retarus.com
          recipientsCc: archive-fax@retarus.com
          attachTiff: true
          attachTiffOnlyIfError: true
          attachPdf: true
          sortByStatus: errors-first
        coverSheet:
          fileName: retarus-usa-sales-cover.rtf
          dateFormat: MM/dd/yyyy
          timeFormat: h:mm a
        personalization:
          department: Sales
          title: Sales Representative
        general:
          client: default
          profile: default
          active: true
          timezone: US/Eastern
        fax:
          csid: Retarus - Sales
          costCenter: Partner-Sales-USA
          header: '%0f %d.%m.%Y %H:%M:%S Retarus Partner Sales from %e for %C %r%P/%T'
          blacklist: false
          paperSize: letter
          resolution: high
          preferredMimeType: text/plain
          attachmentsOnly: true
          suppressBlankPages: true
  securitySchemes:
    http-basic-auth:
      type: http
      description: HTTP Basic Auth against EAS User Database
      scheme: basic
