openapi: 3.0.2
info:
  title: ProVoice API
  description: ProVoice API
  termsOfService: 'https://provoice.nl/usage'
  contact:
    name: MediaServe International B.V.
    url: 'https://mediaserve.nl/'
    email: helpdesk@mediaserve.nl
  license:
    name: MIT
    url: 'https://github.com/MediaServe/provoice/blob/master/LICENSE'
  version: 1.2.0
servers:
  - url: 'https://api.provoice.nl/v1/main'
paths:
  /accounting/customers:
    get:
      summary: Get list of customers
      description: Request an array containing all customers in the platform
      operationId: getCustomers
      tags:
        - Accounting
        - Customer
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customers'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/customer:
    post:
      summary: Create customer
      description: Create a new customer with the specified parameters in the platform
      operationId: createCustomer
      tags:
        - Accounting
        - Customer
      parameters: []
      requestBody:
        description: Customer object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customers'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/customer/{index}':
    post:
      summary: Update customer
      description: Update an existing customer with the specified parameters in the platform
      operationId: updateCustomer
      tags:
        - Accounting
        - Customer
      parameters:
        - $ref: '#/components/parameters/customer'
      requestBody:
        description: Customer object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customers'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}':
    get:
      summary: Get specified customer
      description: Request an array containing one customer from the platform
      operationId: getCustomer
      tags:
        - Accounting
        - Customer
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customers'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/customers':
    get:
      summary: Get list of customers for the specified customer
      description: Request an array of customers where the parent is the specified customer
      operationId: getCustomerCustomers
      tags:
        - Accounting
        - Customer
        - Components
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customers'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/users':
    get:
      summary: Get list of users for the specified customer
      description: Request an array of users where the customer is the specified customer
      operationId: getCustomerUsers
      tags:
        - Accounting
        - Customer
        - Components
        - User
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/users'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/forwards':
    get:
      summary: Get list of forwards for the specified customer
      description: Request an array of forwards where the customer is the specified customer
      operationId: getCustomerForwards
      tags:
        - Accounting
        - Customer
        - Components
        - Forward
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forwards'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/domains':
    get:
      summary: Get list of domains for the specified customer
      description: Request an array of domains where the customer is the specified customer
      operationId: getCustomerDomains
      tags:
        - Accounting
        - Customer
        - Components
        - Domain
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domains'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/extensions':
    get:
      summary: Get list of extensions for the specified customer
      description: Request an array of extensions where the customer is the specified customer
      operationId: getCustomerExtensions
      tags:
        - Accounting
        - Customer
        - Components
        - Extension
      parameters:
        - $ref: '#/components/parameters/customer'
        - name: status
          in: query
          description: Status of the extension
          required: false
          style: form
          schema:
            type: string
            enum:
              - available
              - allocated
        - name: user
          in: query
          description: Unique identifier of a user
          required: false
          style: form
          schema:
            type: integer
            format: int64
        - name: type
          in: query
          description: Type of the extension
          required: false
          style: form
          schema:
            type: string
            enum:
              - inbound
              - outbound
            default: inbound
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/extensions'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/tariffplans':
    get:
      summary: Get list of tariffplans for the specified customer
      description: Request an array of tariffplans where the customer is the specified customer
      operationId: getCustomerTariffplans
      tags:
        - Accounting
        - Customer
        - Components
        - Tariffplan
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tariffplans'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/whitelists':
    get:
      summary: Get list of whitelists for the specified customer
      description: Request an array of tariffplans where the customer is the specified customer
      operationId: getCustomerWhitelists
      tags:
        - Accounting
        - Customer
        - Components
        - Whitelist
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whitelists'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/limits':
    get:
      summary: Get list of limits for the specified customer
      description: Request an array of limits where the customer is the specified customer
      operationId: getCustomerLimits
      tags:
        - Accounting
        - Customer
        - Components
        - Limit
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/limits'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/customer/{index}/destinations':
    get:
      summary: Get list of destinations for the specified customer
      description: Request an array of destinations where the customer is the specified customer
      operationId: getCustomerDestinations
      tags:
        - Accounting
        - Customer
        - Components
        - Destination
      parameters:
        - $ref: '#/components/parameters/customer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/destinations'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/user:
    post:
      summary: Create user
      description: Create a new user with the specified parameters in the platform for an existing customer
      operationId: createUser
      tags:
        - Accounting
        - User
      parameters: []
      requestBody:
        description: User object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/users'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/user/{index}':
    post:
      summary: Update user
      description: Update an existing user with the specified parameters in the platform
      operationId: updateUser
      tags:
        - Accounting
        - User
      parameters:
        - $ref: '#/components/parameters/user'
      requestBody:
        description: User object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/users'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/user/{index}':
    get:
      summary: Get specified user
      description: Request an array containing one user from the platform
      operationId: getUser
      tags:
        - Accounting
        - User
      parameters:
        - $ref: '#/components/parameters/user'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/users'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/user/{index}/limits':
    get:
      summary: Get list of limits for the specified user
      description: Request an array of limits where the user is the specified user
      operationId: getUserLimits
      tags:
        - Accounting
        - User
        - Components
        - Limit
      parameters:
        - $ref: '#/components/parameters/user'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/limits'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/user/{index}/extensions':
    get:
      summary: Get list of extensions for the specified user
      description: Request an array of extensions where the user is the specified user
      operationId: getUserExtensions
      tags:
        - Accounting
        - User
        - Components
        - Extension
      parameters:
        - $ref: '#/components/parameters/user'
        - name: type
          in: query
          description: Type of the extension
          required: false
          style: form
          schema:
            type: string
            enum:
              - inbound
              - outbound
            default: inbound
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/extensions'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/forward:
    post:
      summary: Create forward
      description: Create a new forward with the specified parameters in the platform for an existing customer or user
      operationId: createForward
      tags:
        - Accounting
        - Components
        - Forward
      parameters: []
      requestBody:
        description: Forward object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/forward'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forward'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/forward/{index}':
    post:
      summary: Update forward
      description: Update an existing forward with the specified parameters in the platform
      operationId: updateForward
      tags:
        - Accounting
        - Components
        - Forward
      parameters:
        - $ref: '#/components/parameters/forward'
      requestBody:
        description: Forward object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/forward'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forward'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/delete/accounting/forward/{index}':
    post:
      summary: Delete forward
      description: Delete an existing forward with the specified parameters in the platform
      operationId: deleteForward
      tags:
        - Accounting
        - Components
        - Forward
      parameters:
        - $ref: '#/components/parameters/forward'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleted'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/forward/{index}':
    get:
      summary: Get specified forward
      description: Request a specific forward from the platform
      operationId: getForward
      tags:
        - Accounting
        - Components
        - Forward
      parameters:
        - $ref: '#/components/parameters/forward'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/forward'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/domain/{index}':
    get:
      summary: Get specified domain
      description: Request a specific domain from the platform
      operationId: getDomain
      tags:
        - Accounting
        - Components
        - Domain
      parameters:
        - $ref: '#/components/parameters/domain'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/extension:
    post:
      summary: Create extension
      description: Create a new inbound or outbound extension in the platform for an existing customer or user
      operationId: createExtension
      tags:
        - Accounting
        - Components
        - Extension
      parameters: []
      requestBody:
        description: Extension object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/extension'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/extension'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/extension/{index}':
    post:
      summary: Update extension
      description: Update an existing inbound or outbound extension in the platform
      operationId: updateExtension
      tags:
        - Accounting
        - Components
        - Extension
      parameters:
        - $ref: '#/components/parameters/extension'
      requestBody:
        description: Extension object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/extension'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/extension'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/delete/accounting/extension/{index}':
    post:
      summary: Delete extension
      description: Delete an existing inbound or outbound extension in the platform
      operationId: deleteExtension
      tags:
        - Accounting
        - Components
        - Extension
      parameters:
        - $ref: '#/components/parameters/extension'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleted'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/extension/{index}':
    get:
      summary: Get specified extension
      description: Request a specific extension from the platform
      operationId: getExtension
      tags:
        - Accounting
        - Components
        - Extension
      parameters:
        - $ref: '#/components/parameters/extension'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/extension'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/tariffplan/{index}':
    get:
      summary: Get specified tariffplan
      description: Request a specific tariffplan from the platform
      operationId: getTariffplan
      tags:
        - Accounting
        - Components
        - Tariffplan
      parameters:
        - $ref: '#/components/parameters/tariffplan'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tariffplan'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/whitelist:
    post:
      summary: Create whitelist
      description: Create a new whitelist with the specified parameters in the platform for an existing customer or user
      operationId: createWhitelist
      tags:
        - Accounting
        - Components
        - Whitelist
      parameters: []
      requestBody:
        description: Whitelist object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/whitelist'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whitelist'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/whitelist/{index}':
    post:
      summary: Update whitelist
      description: Update an existing whitelist with the specified parameters in the platform
      operationId: updateWhitelist
      tags:
        - Accounting
        - Components
        - Whitelist
      parameters:
        - $ref: '#/components/parameters/whitelist'
      requestBody:
        description: Whitelist object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/whitelist'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whitelist'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/delete/accounting/whitelist/{index}':
    post:
      summary: Delete whitelist
      description: Delete an existing whitelist with the specified parameters in the platform
      operationId: deleteWhitelist
      tags:
        - Accounting
        - Components
        - Whitelist
      parameters:
        - $ref: '#/components/parameters/whitelist'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleted'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/whitelist/{index}':
    get:
      summary: Get specified whitelist
      description: Request a specific whitelist from the platform
      operationId: getWhitelist
      tags:
        - Accounting
        - Components
        - Whitelist
      parameters:
        - $ref: '#/components/parameters/whitelist'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whitelist'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/limit:
    post:
      summary: Create limit
      description: Create a new abuse limit with the specified parameters in the platform for an existing customer or user
      operationId: createLimit
      tags:
        - Accounting
        - Components
        - Limit
      parameters: []
      requestBody:
        description: Limit object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/limit'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/limit/{index}':
    post:
      summary: Update limit
      description: Update an existing abuse limit with the specified parameters in the platform
      operationId: updateLimit
      tags:
        - Accounting
        - Components
        - Limit
      parameters:
        - $ref: '#/components/parameters/limit'
      requestBody:
        description: Limit object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/limit'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/limit/{index}':
    get:
      summary: Get specified limit
      description: Request a specific limit from the platform
      operationId: getLimit
      tags:
        - Accounting
        - Components
        - Limit
      parameters:
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/limit'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /accounting/destination:
    post:
      summary: Create destination
      description: Create a new SIP destination with the specified parameters in the platform for an existing customer or user
      operationId: createDestination
      tags:
        - Accounting
        - Components
        - Destination
      parameters: []
      requestBody:
        description: Destination object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/destination'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/destination'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/update/accounting/destination/{index}':
    post:
      summary: Update destination
      description: Update an existing SIP destination with the specified parameters in the platform
      operationId: updateDestination
      tags:
        - Accounting
        - Components
        - Destination
      parameters:
        - $ref: '#/components/parameters/destination'
      requestBody:
        description: Destination object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/destination'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/destination'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/delete/accounting/destination/{index}':
    post:
      summary: Delete destination
      description: Delete an existing SIP destination with the specified parameters in the platform
      operationId: deleteDestination
      tags:
        - Accounting
        - Components
        - Destination
      parameters:
        - $ref: '#/components/parameters/destination'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleted'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  '/accounting/destination/{index}':
    get:
      summary: Get specified destination
      description: Request a specific destination from the platform
      operationId: getDestination
      tags:
        - Accounting
        - Components
        - Destination
      parameters:
        - $ref: '#/components/parameters/destination'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/destination'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /records/calls:
    get:
      summary: Get call detail records for all customers
      description: Create a callback request to get call detail records for any customer from the platform
      operationId: getCallRecords
      tags:
        - Records
        - Calls
      parameters:
        - $ref: '#/components/parameters/window'
        - $ref: '#/components/parameters/filter'
        - name: callback
          in: query
          description: Callback location to trigger when the request is completed
          required: true
          style: form
          schema:
            type: string
            format: uri
            example: 'https://provider.provoice.nl/api/consumer/cdr'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accepted'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      callbacks:
        records:
          '{$request.query.callback}/records':
            post:
              requestBody:
                description: Requested call detail records
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/cdr'
              responses:
                '202':
                  description: Accepted
                  content:
                    application/json:
                      schema:
                        $ref: '#/components/schemas/accepted'
  '/records/calls/customer/{index}':
    get:
      summary: Get call detail records for the specified customer
      description: Create a callback request to get call detail records for a specific customer from the platform
      operationId: getCustomerCallRecords
      tags:
        - Records
        - Calls
      parameters:
        - $ref: '#/components/parameters/customer'
        - $ref: '#/components/parameters/window'
        - $ref: '#/components/parameters/filter'
        - name: callback
          in: query
          description: Callback location to trigger when the request is completed
          required: true
          style: form
          schema:
            type: string
            format: uri
            example: 'https://provider.provoice.nl/api/consumer/cdr'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accepted'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      callbacks:
        records:
          '{$request.query.callback}/records':
            post:
              requestBody:
                description: Requested call detail records
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/cdr'
              responses:
                '202':
                  description: Accepted
                  content:
                    application/json:
                      schema:
                        $ref: '#/components/schemas/accepted'
components:
  schemas:
    customers:
      type: array
      items:
        $ref: '#/components/schemas/customer'
    customer:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the customer
          format: int64
          readOnly: true
        description:
          type: string
          description: Additional description attached to the customer
        parent:
          type: integer
          description: Unique identifier of the parent customer
          format: int64
          nullable: true
        tariffplan:
          type: integer
          description: Unique identifier of the tariffplan that applies to this customer
          format: int64
        accountable:
          type: boolean
          description: Whether the customer should accountable for any costs or if the accountability is delegated to the parent
          default: true
        outbound:
          type: integer
          description: Default fallback number that is used for outbound calls without a valid source number
          format: int64
          nullable: true
          default: null
        dialogs:
          type: integer
          description: Defined number of dialogs for this customer
          format: int64
          default: 256
        active:
          type: boolean
          description: Whether the customer is active in the platform or deactivated
          default: true
    users:
      type: array
      items:
        $ref: '#/components/schemas/user'
    user:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the user
          format: int64
          readOnly: true
        customer:
          type: integer
          description: Unique identifier of the customer that owns the user
          format: int64
        description:
          type: string
          description: Additional description attached to the user
        username:
          type: string
          description: The user part in the URI that makes a unique address of record
        password:
          type: string
          description: Authentication password that belongs to the unique address of record
          writeOnly: true
        active:
          type: boolean
          description: Whether the user is active in the platform or deactivated
          default: true
        domain:
          type: integer
          description: The unique identifier of the domain part in the URI that makes a unique address of record
          format: int64
          default: 1
        anonymous:
          type: boolean
          description: Whether the proxy should request privacy on all outbound calls for this user or not
          default: 0
        outbound:
          type: object
          description: Parameters for outbound calls without a valid source number
          properties:
            extension:
              type: integer
              description: Default fallback number that is used for outbound calls without a valid source number
              format: int64
              nullable: true
            suppress:
              type: boolean
              description: Whether privacy should be requested or not when the fallback outbound extension is applied
              default: false
        dialogs:
          type: integer
          description: Defined number of dialogs for this user
          format: int64
          default: 16
    extensions:
      type: array
      items:
        $ref: '#/components/schemas/extension'
    extension:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the extension
          format: int64
          readOnly: true
        customer:
          type: integer
          description: Unique identifier of the customer that owns the extension
          format: int64
        user:
          type: integer
          description: User that is attached to the number and that should be used for inbound routing
          format: int64
          nullable: true
        prefix:
          type: integer
          description: Leading digits for the number in ITU E.164 format
          format: int64
        inbound:
          type: boolean
          description: Whether the number should be used for inbound routing
          default: true
        activation:
          type: string
          description: Activation date that is updated when the object is being created
          format: date
          readOnly: true
    tariffplans:
      type: array
      items:
        $ref: '#/components/schemas/tariffplan'
    tariffplan:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the tariffplan
          format: int64
        customer:
          type: integer
          description: Unique identifier of the customer that owns the tariffplan
          format: int64
        description:
          type: string
          description: Additional description attached to the tariffplan
        rateplan:
          $ref: '#/components/schemas/rateplan'
        serviceplan:
          type: integer
          description: Unique identifier of the serviceplan attached to the tariffplan
          format: int64
    rateplans:
      type: array
      items:
        $ref: '#/components/schemas/rateplan'
    rateplan:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the rateplan
          format: int64
        description:
          type: string
          description: Additional description attached to the rateplan
        type:
          type: string
          description: Whether the rateplan is used for sale or purchase rates
          enum:
            - sale
            - purchase
    serviceplans:
      type: array
      items:
        $ref: '#/components/schemas/serviceplan'
    serviceplan:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the serviceplan
          format: int64
        description:
          type: string
          description: Additional description attached to the serviceplan
    forwards:
      type: array
      items:
        $ref: '#/components/schemas/forward'
    forward:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the forward
          format: int64
          readOnly: true
        customer:
          type: integer
          description: Unique identifier of the customer that owns the forward and for which the forward will be activated
          format: int64
        user:
          type: integer
          description: Unique identifier of the user for which the forward will be activated
          format: int64
          nullable: true
        extension:
          type: integer
          description: Unique identifier of the extension for which the forward will be activated
          format: int64
          nullable: true
        type:
          type: string
          description: Condition that triggers the forward to be activated
          enum:
            - always
            - busy
            - failure
            - unreachable
        prefix:
          type: integer
          description: Number in ITU E.164 format to where the forwarded call will be redirected
          format: int64
        transparent:
          type: boolean
          description: Whether the initial source number should be applied to the forwarded call or not
          default: 1
        active:
          type: boolean
          description: Whether the forward is active in the platform or deactivated
          default: 1
    domains:
      type: array
      items:
        $ref: '#/components/schemas/domain'
    domain:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the domain
          format: int64
        customer:
          type: integer
          description: Unique identifier of the customer that owns the domain
          format: int64
        domain:
          type: string
          description: Unique domain name that is recognized as a local domain in the platform
    whitelists:
      type: array
      items:
        $ref: '#/components/schemas/whitelist'
    whitelist:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the whitelist
          format: int64
          readOnly: true
        customer:
          type: integer
          description: Unique identifier of the customer that owns the whitelist
          format: int64
        user:
          type: integer
          description: Unique identifier of the user that will be authenticated by the whitelist
          format: int64
        address:
          type: string
          description: Source IP address of the request to be authenticated
        port:
          type: integer
          description: Optional source port of the request to be authenticated
          format: int64
          nullable: true
          default: null
    limits:
      type: array
      items:
        $ref: '#/components/schemas/limit'
    limit:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the limit
          format: int64
          readOnly: true
        type:
          type: object
          properties:
            type:
              type: string
              description: Whether the limit should be applied to a customer or a user
              enum:
                - customer
                - user
            index:
              type: integer
              description: Unique identifier of either the user or the customer as defined as the type to which the limit will be applied
              format: int64
        interval:
          type: string
          description: Whether the limit will be based on a daily or a monthly interval
          enum:
            - monthly
            - daily
        limit:
          type: number
          description: The actual limit in the global platform currency
          format: float
          default: 250
        usage:
          type: number
          description: The usage of the limit in the global platform currency
          format: float
          readOnly: true
    destinations:
      type: array
      items:
        $ref: '#/components/schemas/destination'
    destination:
      type: object
      properties:
        index:
          type: integer
          description: Unique identifier of the destination
          format: int64
          readOnly: true
        customer:
          type: integer
          description: Unique identifier of the customer that owns the destination
          format: int64
        description:
          type: string
          description: Additional description attached to the destination
        destination:
          type: string
          description: Destination SIP URI of inbound calls if no active SIP registration was found
    window:
      type: object
      required:
        - begin
      properties:
        begin:
          type: string
          description: Marks the begin of the selected time frame
          format: date-time
        end:
          type: string
          description: Marks the end of the selected time frame
          format: date-time
    filter:
      type: object
      properties:
        code:
          type: integer
          description: Final SIP response code of the call
          minimum: 200
          maximum: 607
        direction:
          type: string
          description: Direction of the call
          enum:
            - inbound
            - outbound
    cdr:
      type: object
      properties:
        uuid:
          type: string
          description: The unique identifier that was issued during the request
          format: uuid
        request:
          type: object
          description: The parameters that were used during the request
          properties:
            window:
              $ref: '#/components/schemas/window'
            filter:
              $ref: '#/components/schemas/filter'
        records:
          type: array
          description: Requested call detail records
          items:
            type: object
            required:
              - _id
              - proxy
              - direction
              - status
              - time
              - call
              - accounting
            properties:
              _id:
                type: string
                description: Unique identification hash of the record
                format: hex
              proxy:
                type: string
                description: Name of the proxy that handled the call
              direction:
                type: string
                description: Direction of the call
                enum:
                  - inbound
                  - outbound
              status:
                type: string
                description: Final status of the call
                enum:
                  - successful
                  - failed
              hangup:
                type: string
                description: Side that initiated the termination of the call
                enum:
                  - source
                  - destination
              duration:
                type: number
                description: Number of seconds the call lasted
                format: float
              time:
                type: object
                required:
                  - initialized
                minProperties: 2
                maxProperties: 2
                properties:
                  initialized:
                    type: string
                    description: Time when the call was being initialized
                    format: date-time
                  successful:
                    type: object
                    description: Successful call was confirmed and terminated
                    required:
                      - confirmed
                      - terminated
                    properties:
                      confirmed:
                        type: string
                        description: Time when the call was confirmed after being initialized
                        format: date-time
                      terminated:
                        type: string
                        description: Time when call was terminated after being confirmed
                        format: date-time
                  failed:
                    type: string
                    description: Time when the call was failed after being initialized
                    format: date-time
              call:
                type: object
                required:
                  - cli
                  - extension
                  - anonymous
                  - source
                  - destination
                  - sip
                properties:
                  cli:
                    type: string
                    description: The calling line identification (CLI)
                    format: e164
                  extension:
                    type: string
                    description: The automatic number identification (ANI)
                    format: e164
                  anonymous:
                    type: boolean
                    description: The calling line requested privacy
                  source:
                    type: object
                    description: Internal routing details about the calling line
                    required:
                      - customer
                      - user
                      - domain
                    properties:
                      customer:
                        type: integer
                        description: Unique identifier of the calling customer
                        format: int64
                      user:
                        type: integer
                        description: Unique identifier of the calling user
                        format: int64
                      domain:
                        type: string
                        description: SIP domain name corresponding to the source
                        format: int64
                  destination:
                    type: object
                    description: Internal routing details about the called line
                    required:
                      - customer
                      - user
                      - domain
                    properties:
                      customer:
                        type: integer
                        description: Unique identifier of the called customer
                        format: int64
                      user:
                        type: integer
                        description: Unique identifier of the called user
                        format: int64
                      domain:
                        type: string
                        description: SIP domain name corresponding to the destination
                        format: int64
                  sip:
                    type: object
                    description: Details about the SIP dialog
                    required:
                      - callid
                      - code
                      - reason
                      - from
                      - to
                    properties:
                      callid:
                        type: string
                        description: The SIP Call-ID-header
                      code:
                        type: integer
                        description: The final response code to the request
                        minimum: 200
                        maximum: 607
                      reason:
                        type: string
                        description: Additional message to the final response code
                      from:
                        type: object
                        description: Details from the SIP From-header
                        required:
                          - user
                          - domain
                        properties:
                          user:
                            type: string
                            description: The user-part in the SIP From-header
                          domain:
                            type: string
                            description: The domain-part in the SIP From-header
                          tag:
                            type: string
                            description: The tag in the SIP From-header
                      to:
                        type: object
                        description: Details from the SIP To-header
                        required:
                          - user
                          - domain
                        properties:
                          user:
                            type: string
                            description: The user-part in the SIP To-header
                          domain:
                            type: string
                            description: The domain-part in the SIP To-header
                          tag:
                            type: string
                            description: The tag in the SIP To-header
                  federation:
                    type: object
                    description: Optional federation details about the call
                    required:
                      - user
                      - domain
                      - environment
                    properties:
                      user:
                        type: string
                        description: The federation user that was used for the call
                      domain:
                        type: string
                        description: The federation domain that was used for the call
                      environment:
                        type: string
                        description: The name of the federation environment
              accounting:
                type: object
                description: Accounting details about the call
                required:
                  - destination
                  - customer
                  - rating
                properties:
                  destination:
                    type: object
                    description: Details about the called destination
                    required:
                      - index
                      - description
                      - rated
                    properties:
                      index:
                        type: integer
                        description: Unique identifier of the destination that was called
                        format: int64
                      description:
                        type: string
                        description: Description of the destination that was called
                      rated:
                        type: integer
                        description: Unique identifier of the destination that was used to determine the rate
                        format: int64
                  customer:
                    type: object
                    description: Details about the customer
                    required:
                      - index
                      - accountable
                      - tariffplan
                      - ppc
                      - ppm
                      - cost
                    properties:
                      index:
                        type: integer
                        description: Unique identifier of the customer
                        format: int64
                      accountable:
                        type: boolean
                        description: The customer is accountable for the costs
                      tariffplan:
                        type: integer
                        description: The configured tariffplan for the customer
                        format: int64
                      tariff:
                        type: integer
                        description: Unique identifier of the applied tariff
                        format: int64
                      ppc:
                        type: number
                        description: Calculated price per call in tariffplan
                        format: float
                      ppm:
                        type: number
                        description: Calculated price per minute in tariffplan
                        format: float
                      cost:
                        type: number
                        description: Calculated total cost for customer
                        format: float
                  rating:
                    type: object
                    description: Details about the call rating
                    required:
                      - rateplan
                      - rate
                      - timerange
                      - ppc
                      - ppm
                    properties:
                      rateplan:
                        type: integer
                        description: Unique identifier of the rateplan inherited from the tariffplan
                        format: int64
                      rate:
                        type: integer
                        description: Unique identifier of the applied rate for the call
                        format: int64
                      timerange:
                        type: integer
                        description: Unique identifier of the applied timerange for the selected rate
                        format: int64
                      ppc:
                        type: number
                        description: Rated price per call
                        format: float
                      ppm:
                        type: number
                        description: Rated price per minute
                        format: float
                  reseller:
                    type: object
                    description: Details about the reseller
                    required:
                      - destination
                      - customer
                      - rating
                    properties:
                      destination:
                        type: object
                        description: Details about the called destination
                        required:
                          - index
                          - description
                          - rated
                        properties:
                          index:
                            type: integer
                            description: Unique identifier of the destination that was called
                            format: int64
                          description:
                            type: string
                            description: Description of the destination that was called
                          rated:
                            type: integer
                            description: Unique identifier of the destination that was used to determine the rate
                            format: int64
                      customer:
                        type: object
                        description: Details about the accountable reseller
                        required:
                          - index
                          - accountable
                          - tariffplan
                          - ppc
                          - ppm
                          - cost
                        properties:
                          index:
                            type: integer
                            description: Unique identifier of the customer
                            format: int64
                          accountable:
                            type: boolean
                            description: The customer is accountable for the costs
                          tariffplan:
                            type: integer
                            description: The configured tariffplan for the customer
                            format: int64
                          tariff:
                            type: integer
                            description: Unique identifier of the applied tariff
                            format: int64
                          ppc:
                            type: number
                            description: Calculated price per call in tariffplan
                            format: float
                          ppm:
                            type: number
                            description: Calculated price per minute in tariffplan
                            format: float
                          cost:
                            type: number
                            description: Calculated total cost for customer
                            format: float
                      rating:
                        type: object
                        description: Details about the call rating
                        required:
                          - rateplan
                          - rate
                          - timerange
                          - ppc
                          - ppm
                        properties:
                          rateplan:
                            type: integer
                            description: Unique identifier of the rateplan inherited from the tariffplan
                            format: int64
                          rate:
                            type: integer
                            description: Unique identifier of the applied rate for the call
                            format: int64
                          timerange:
                            type: integer
                            description: Unique identifier of the applied timerange for the selected rate
                            format: int64
                          ppc:
                            type: number
                            description: Rated price per call
                            format: float
                          ppm:
                            type: number
                            description: Rated price per minute
                            format: float
                  transit:
                    type: object
                    description: Details about the used transit
                    required:
                      - user
                      - customer
                      - rateplan
                      - ppc
                      - ppm
                      - cost
                    properties:
                      user:
                        type: integer
                        description: Unique identifier of the transit user
                        format: int64
                      customer:
                        type: integer
                        description: Unique identifier of the transit customer
                        format: int64
                      rateplan:
                        type: integer
                        description: Unique identifier of the transit rateplan
                        format: int64
                      ppc:
                        type: number
                        description: Rated price per call
                        format: float
                      ppm:
                        type: number
                        description: Rated price per minute
                        format: float
                      cost:
                        type: number
                        description: Calculated total transit cost
                        format: float
    accepted:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        message:
          type: string
    deleted:
      type: object
      properties:
        deleted:
          type: boolean
    error:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 400
            - 403
            - 404
            - 429
        message:
          type: string
  parameters:
    customer:
      name: index
      in: path
      description: Unique identifier of the customer
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    user:
      name: index
      in: path
      description: Unique identifier of the user
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    forward:
      name: index
      in: path
      description: Unique identifier of the forward
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    domain:
      name: index
      in: path
      description: Unique identifier of the domain
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    extension:
      name: index
      in: path
      description: Unique identifier of the extension
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    tariffplan:
      name: index
      in: path
      description: Unique identifier of the tariffplan
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    whitelist:
      name: index
      in: path
      description: Unique identifier of the whitelist
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    limit:
      name: index
      in: path
      description: Unique identifier of the limit
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    destination:
      name: index
      in: path
      description: Unique identifier of the destination
      required: true
      style: simple
      schema:
        type: integer
        format: int64
    window:
      name: window
      in: query
      description: Requested time frame for call detail records
      required: true
      style: form
      schema:
        $ref: '#/components/schemas/window'
    filter:
      name: filter
      in: query
      description: Filter the results
      required: false
      style: form
      schema:
        $ref: '#/components/schemas/filter'
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    '404':
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    '429':
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  securitySchemes:
    apiKey:
      type: apiKey
      description: Service authentication
      name: X-ProVoice-Authentication
      in: header
security:
  - apiKey: []
tags:
  - name: Accounting
    description: The ProVoice accounting section contains all necessary components for managing users and its various parameters.
  - name: Customer
    description: Customers are object nodes in the accounting tree to define a container for users. Each customer has a parent customer and is able to have multiple child customers.
  - name: User
    description: Users are unique identities for a customer. A user can be registrated on the platform and will be used for voice routing. A user is contained by a customer object and each customer object can contain any amount of users
  - name: Components
    description: Discover and manage the various components in the platform.
  - name: Forward
    description: 'Manage conditional and unconditional call forwards. With call forwards an incoming dialog can be redirected to another phone number based on the user state, for example when a user is busy or unavailable.'
  - name: Whitelist
    description: 'Manage IP whitelists for outbound routing. With an IP whitelist a user can initiate dialogs without SIP authentication, based on the originating IP address and port in the request.'
  - name: Limit
    description: Manage usage limits. With a limit the allowed monthly or daily platform usage for a customer or its user will be limited.
  - name: Destination
    description: Manage static user destinations. Using a static user destination a user is no longer required to maintain a registration on the platform. All inbound dialogs will be routed in accordance with the specified resource locator.
  - name: Domain
    description: Manage platform domains. A domain is the namespace for a customer and a user to operate in. All users are unique within the scope of the domain. Domains are also used for routing.
  - name: Tariffplan
    description: Manage customer tariffplans. With a tariffplan a customer can have a specific rateplan and serviceplan tailored.
  - name: Extension
    description: 'Manage extensions. An extension, either inbound or outbound, represents a phone number or prefix. With inbound extensions a dialog will be routed to a user.'
  - name: Records
    description: Request usage records
  - name: Calls
    description: Call detail records
externalDocs:
  description: ProVoice Documentation
  url: 'https://docs.provoice.nl/'