openapi: 3.0.0
servers:
  - url: https://api.vonage.com/t/vbc.prod/vis/v1
info:
  contact:
    email: gunifydevops@vonage.com
    name: VGIS
    url: https://integrate.vonage.com
  description: >
    The Vonage Integration Suite API enables call control and webhooks for call events.


    Your application must subscribe to the VonageIntegrationSuite API suite to use this API.
  title: Vonage Integration Suite
  version: 1.0.1
  x-origin:
    - format: openapi
      url: https://raw.githubusercontent.com/nexmo/api-specification/master/definitions/vonage-business-cloud/vgis.yml
      version: "3.0"
  x-providerName: vonage.com
  x-serviceName: vgis
tags:
  - name: Users
  - name: Accounts
  - name: Calls
  - name: Events
  - description: Webhooks are external URLs which subscribe to receive events via HTTP POST for a specified set of events.
    name: Webhooks
paths:
  /self:
    get:
      operationId: getUser
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: User info
      tags:
        - Users
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /self/account:
    get:
      operationId: getAccount
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Account"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Account info
      tags:
        - Accounts
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /self/calls:
    get:
      description: Lists currently active calls
      operationId: listCalls
      parameters:
        - description: Return calls that occurred after this point in time
          in: query
          name: fromDate
          schema:
            type: integer
        - description: Return calls that occurred before this point in time
          in: query
          name: toDate
          schema:
            type: integer
        - description: Filter by call direction. For multiple criteria, seperate values by a comma.
          in: query
          name: direction
          schema:
            enum:
              - INBOUND
              - OUTBOUND
            example: INBOUND,OUTBOUND
            type: string
        - description: Filter calls by state. For multiple criteria, seperate values by a comma.
          in: query
          name: states
          schema:
            default: ACTIVE
            enum:
              - INITIALIZING
              - RINGING
              - ACTIVE
              - HELD
              - REMOTE_HELD
            example: ACTIVE,RINGING
            type: string
        - description: Page number of calls to return
          in: query
          name: offset
          schema:
            format: int64
            type: integer
        - description: Return this amount of calls in the response
          in: query
          name: size
          schema:
            default: 20
            type: integer
        - description: Sort in either ascending or descending order
          in: query
          name: order
          schema:
            default: ASC
            enum:
              - DESC
              - ASC
            type: string
        - description: Sort calls by property
          in: query
          name: sort
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Call"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: List active calls
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    post:
      operationId: createCall
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CallCreate"
        description: Place call parameters
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Call"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Place a call
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /self/calls/count:
    get:
      operationId: getCallsCount
      parameters:
        - description: Return calls that occurred after this point in time
          in: query
          name: fromDate
          schema:
            type: integer
        - description: Return calls that occurred before this point in time
          in: query
          name: toDate
          schema:
            type: integer
        - description: Filter by call direction. For multiple criteria, seperate values by a comma.
          in: query
          name: direction
          schema:
            enum:
              - INBOUND
              - OUTBOUND
            example: INBOUND,OUTBOUND
            type: string
        - description: Filter calls by state. For multiple criteria, seperate values by a comma.
          in: query
          name: states
          schema:
            default: ACTIVE
            enum:
              - INITIALIZING
              - RINGING
              - ACTIVE
              - HELD
              - REMOTE_HELD
            example: ACTIVE,RINGING
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventsCount"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Get calls count
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/calls/{id}":
    delete:
      operationId: destroyCall
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Call"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: End a call
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    get:
      operationId: getRoles
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Call"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Get a call
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/calls/{id}/answer":
    put:
      operationId: callAnswer
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Call"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Answer call (On supported devices)
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/calls/{id}/hold":
    delete:
      operationId: callUnold
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Call"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Unhold
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    put:
      operationId: callHold
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Call"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Put call on hold
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/calls/{id}/transfer":
    post:
      operationId: callTransfer
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CallTransfer"
        description: Call transfer parameters
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Call"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Transfer call
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/calls/{id}/vmtransfer":
    put:
      operationId: callVMTransfer
      parameters:
        - description: Unique identifier of the call
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Call"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Send call to voicemail
      tags:
        - Calls
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /self/events:
    get:
      operationId: listEvents
      parameters:
        - description: Record type
          in: query
          name: types
          schema:
            enum:
              - CALL
            example: CALL
            type: string
        - description: Return events that occurred after this point in time
          in: query
          name: fromDate
          schema:
            type: integer
        - description: Return events that occurred before this point in time
          in: query
          name: toDate
          schema:
            type: integer
        - description: Filter by event direction
          in: query
          name: direction
          schema:
            enum:
              - INBOUND
              - OUTBOUND
            example: INBOUND,OUTBOUND
            type: string
        - description: Filter events by state
          in: query
          name: states
          schema:
            enum:
              - INITIALIZING
              - RINGING
              - ACTIVE
              - HELD
              - REMOTE_HELD
              - DETACHED
              - REJECTED
              - CANCELLED
              - ANSWERED
              - MISSED
            example: ACTIVE,RINGING
            type: string
        - description: Page number of events to return
          in: query
          name: offset
          schema:
            format: int64
            type: integer
        - description: Return this amount of events in the response
          in: query
          name: size
          schema:
            default: 20
            type: integer
        - description: Sort in either ascending or descending order'
          in: query
          name: order
          schema:
            default: ASC
            enum:
              - DESC
              - ASC
            type: string
        - description: Sort events by property
          in: query
          name: sort
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Event"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: List events
      tags:
        - Events
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /self/events/count:
    get:
      operationId: getEventsCount
      parameters:
        - description: Return events that occurred after this point in time
          in: query
          name: fromDate
          schema:
            type: integer
        - description: Return events that occurred before this point in time
          in: query
          name: toDate
          schema:
            type: integer
        - description: Filter by event direction
          in: query
          name: direction
          schema:
            enum:
              - INBOUND
              - OUTBOUND
            example: INBOUND,OUTBOUND
            type: string
        - description: Filter events by state
          in: query
          name: states
          schema:
            enum:
              - INITIALIZING
              - RINGING
              - ACTIVE
              - HELD
              - REMOTE_HELD
            example: ACTIVE,RINGING
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventsCount"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Get events count
      tags:
        - Events
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/events/{id}":
    get:
      operationId: getEvent
      parameters:
        - description: Unique identifier of the event
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Event"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Get event
      tags:
        - Events
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  /self/webhooks:
    get:
      operationId: listWebhooks
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Webhook"
                type: array
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: List web hooks
      tags:
        - Webhooks
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    post:
      operationId: createWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookCreate"
        description: Webhook create parameters
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Create a new webhook subscription
      tags:
        - Webhooks
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/webhooks/{id}":
    delete:
      operationId: destroyWebhook
      parameters:
        - description: Unique identifier of the webhook
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Remove a web hook
      tags:
        - Webhooks
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
    get:
      operationId: viewWebhook
      parameters:
        - description: Unique identifier of the webhook
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Get web hook details
      tags:
        - Webhooks
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
  "/self/webhooks/{id}/renew":
    put:
      operationId: renewWebhook
      parameters:
        - description: Webhook ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
          description: Successful
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: "Bad Request: The client should not repeat the request without modifications"
        "401":
          description: "Unauthorized: Invalid access token"
        "403":
          description: "Forbidden: The user has no rights to access the resource(s)"
        "408":
          description: "Timeout: The client may repeat the request without modifications"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: Validation Error
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      summary: Renews a web hook
      tags:
        - Webhooks
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
components:
  schemas:
    Account:
      properties:
        id:
          description: Unique identifier of the account
          example: 257073
          type: integer
        name:
          description: Name of the account
          example: Vonage
          type: string
        org:
          description: Organization of the account
          example: Vonage
          type: string
        status:
          description: Status of the account
          enum:
            - PENDING
            - ACTIVE
            - DELETED
            - ARCHIVED
          example: ACTIVE
          type: string
        ucis:
          items:
            properties:
              health:
                properties:
                  message:
                    type: string
                  status:
                    type: string
                type: object
              id:
                format: int64
                type: integer
              type:
                default: ACCOUNT_UCI
                type: string
              ucpAccountId:
                type: string
              ucpLabel:
                type: string
            type: object
          type: array
      type: object
    Call:
      properties:
        accountId:
          description: Unique identifier of the account
          format: int64
          type: integer
        answerTime:
          description: Time to answer the call
          format: date
          type: string
        callerId:
          description: Remote caller ID
          type: string
        direction:
          description: Direction of the call
          enum:
            - INBOUND
            - OUTBOUND
          type: string
        duration:
          description: Duration of the call in milliseconds
          format: int64
          type: integer
        endTime:
          description: End time of the call
          format: date
          type: string
        externalId:
          description: External identifier of the call
          type: string
        id:
          description: Unique identifier of the call
          format: int64
          type: integer
        phoneNumber:
          description: Unique identifier of the account
          type: string
        startTime:
          description: Start time of the call
          format: date
          type: string
        state:
          description: Status of the call
          enum:
            - INITIALIZING
            - RINGING
            - ACTIVE
            - HELD
            - REMOTE_HELD
            - DETACHED
            - REJECTED
            - CANCELLED
            - ANSWERED
            - MISSED
          type: string
        type:
          description: Record type
          enum:
            - CALL
          type: string
        uciId:
          description: Unique identifier of communications provider
          format: int64
          type: integer
        userId:
          description: Unique identifier of the user
          format: int64
          type: integer
      required:
        - id
        - type
        - accountId
        - userId
        - uciId
        - direction
        - duration
        - state
        - phoneNumber
        - startTime
      type: object
    CallCreate:
      properties:
        phoneNumber:
          description: Phone number to call
          type: string
      required:
        - phoneNumber
      type: object
    CallTransfer:
      properties:
        phoneNumber:
          description: Phone number to transfer to
          type: string
      required:
        - phoneNumber
      type: object
    Error:
      properties:
        field:
          type: string
        message:
          type: string
      type: object
    ErrorResponse:
      properties:
        errorCode:
          type: string
        errorMessage:
          type: string
        errors:
          items:
            $ref: "#/components/schemas/Error"
          type: array
      type: object
    Event:
      properties:
        accountId:
          description: Unique identifier of the account
          format: int64
          type: integer
        answerTime:
          description: Time to answer the event
          format: date
          type: string
        callerId:
          description: Remote caller ID
          type: string
        direction:
          description: Direction of the event
          enum:
            - INBOUND
            - OUTBOUND
          type: string
        duration:
          description: Duration of the call in milliseconds
          format: int64
          type: integer
        endTime:
          description: End time of the event
          format: date
          type: string
        externalId:
          description: External identifier of the event
          type: string
        id:
          description: Unique identifier of the event
          format: int64
          type: integer
        phoneNumber:
          description: Unique identifier of the account
          type: string
        smsData:
          type: string
        startTime:
          description: Start time of the event
          format: date
          type: string
        state:
          description: Status of the event
          enum:
            - INITIALIZING
            - RINGING
            - ACTIVE
            - HELD
            - REMOTE_HELD
            - DETACHED
            - REJECTED
            - CANCELLED
            - ANSWERED
            - MISSED
          type: string
        type:
          description: Record type
          enum:
            - CALL
          type: string
        uciId:
          description: Unique identifier of communications provider
          format: int64
          type: integer
        userId:
          description: Unique identifier of the user
          format: int64
          type: integer
      required:
        - id
        - type
        - accountId
        - userId
        - uciId
        - direction
        - state
        - phoneNumber
        - startTime
      type: object
    EventsCount:
      properties:
        count:
          description: Number of events found
          format: int64
          type: integer
      type: object
    User:
      properties:
        accountId:
          description: Unique identifier of the user's account
          example: 257073
          type: integer
        acountLabel:
          description: The name of the user's account
          example: Vonage
          type: string
        contactNumber:
          description: Contact number of the user
          example: 14155550100
          type: string
        emailAddress:
          description: Email address of the user
          example: john.smith@example.com
          type: string
        firstName:
          description: First name of the user
          example: Robert
          type: string
        id:
          description: Unique identifier of the user
          example: 522078
          type: integer
        lastName:
          description: Last name of the user
          example: Smith
          type: string
        roles:
          items:
            properties:
              code:
                description: Code for the role
                example: AU
                type: string
              name:
                description: Name for the role
                example: Account User
                type: string
            type: object
          type: array
        status:
          description: Status of the user
          enum:
            - PENDING
            - ACTIVE
            - DELETED
            - ARCHIVED
          example: ACTIVE
          type: string
        ucis:
          items:
            properties:
              health:
                properties:
                  message:
                    type: string
                  status:
                    type: string
                type: object
              id:
                format: int64
                type: integer
              type:
                default: USER_UCI
                type: string
              ucpLabel:
                type: string
            type: object
          type: array
      type: object
    Webhook:
      properties:
        accountId:
          description: Unique identifier of the account
          example: 257073
          type: string
        createdAt:
          description: Created time for the webhook
          example: 2019-01-01T00:00:00.000Z
          type: string
        events:
          description: Subscribed events for the webhook
          example:
            - CALL
          items:
            enum:
              - CALL
            type: string
          type: array
        expireAt:
          description: Expiration time for the webhook
          example: 2019-01-01T00:00:00.000Z
          type: string
        id:
          description: Unique identifier for the webhook
          example: 184094
          type: string
        metadataPolicy:
          description: Metadata policy for the webhook
          enum:
            - NONE
            - HEADER
            - BODY
          example: NONE
          type: string
        purgeAt:
          description: Scheduled purge time for the webhook
          example: 2019-01-01T00:00:00.000Z
          type: string
        renewedAt:
          description: Last renewed time for the webhook
          example: 2019-01-01T00:00:00.000Z
          type: string
        signingAlgo:
          description: Signing algorithm for the webhook
          enum:
            - HMAC_SHA256
            - NONE
          example: HMAC_SHA256
          type: string
        signingKey:
          description: Signing key for the webhook
          type: string
        statistics:
          properties:
            failed:
              description: Current delivery status
              example: false
              type: boolean
            totalAttempts:
              description: Total delivery attempts
              example: 10
              type: integer
            totalFailures:
              description: Total failed deliveries
              example: 10
              type: integer
            totalSuccesses:
              description: Total successful deliveries
              example: 10
              type: integer
          type: object
        status:
          description: Status for the webhook
          enum:
            - ACTIVE
            - PAUSED
          example: ACTIVE
          type: string
        url:
          description: Destination URL for events
          example: https://www.example.com
          type: string
        userId:
          description: Unique identifier of the user
          example: 522078
          type: string
      type: object
    WebhookCreate:
      properties:
        events:
          description: Events to subscribe to the webhook
          example:
            - CALL
          items:
            enum:
              - CALL
            example: CALL
            type: string
          type: array
        metadataPolicy:
          description: Metadata policy for the webhook
          enum:
            - NONE
            - HEADER
            - BODY
          example: NONE
          type: string
        signingAlgo:
          description: Signing algorithm for the webhook
          enum:
            - HMAC_SHA256
          example: HMAC_SHA256
          type: string
        signingKey:
          description: Signing key for the webhook
          type: string
        url:
          description: Destination URL for events
          example: https://www.example.com
          type: string
      type: object
