{
  "openapi": "3.0.1",
  "info": {
    "title": "QVOICE Platform API",
    "version": "2.0.0",
    "description": "REST API of QVOICE Platform. Authenticate with an API key (X-API-Key + X-Account-ID) or a bearer token. Guides: https://docs.qvoice.net/api/api-key-auth/"
  },
  "servers": [
    {
      "url": "https://{domain}:9443",
      "description": "Your portal domain. Paths are absolute (/api/v2, /callcenter, /ucp, ...).",
      "variables": {
        "domain": {
          "default": "your-domain.com"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Access Roles"
    },
    {
      "name": "Account",
      "description": "Access to Account information"
    },
    {
      "name": "Account Billing"
    },
    {
      "name": "Accounts",
      "description": "Access to Accounts information"
    },
    {
      "name": "Addressbook"
    },
    {
      "name": "AI Agents"
    },
    {
      "name": "AI Concierge",
      "description": "Endpoints powering the AI Concierge product (signup flow, authentication, voice catalog, DID search, etc.)"
    },
    {
      "name": "API Keys",
      "description": "Manage API keys for authentication"
    },
    {
      "name": "Authentication"
    },
    {
      "name": "Autoprovision"
    },
    {
      "name": "Call Center"
    },
    {
      "name": "Callflows",
      "description": "Access and modify the information that has to do with Call Recording, both for the account and for the users."
    },
    {
      "name": "Call Recording"
    },
    {
      "name": "Calls",
      "description": "Real-time call control (hangup). Originating, bridging, transferring and querying live call state are not exposed as REST endpoints — see the \"Calls (real-time)\" note below. Exception - POST /api/v2/calls/quickcall rings an extension and sends the answered call to another extension."
    },
    {
      "name": "Campaigns"
    },
    {
      "name": "Conferences"
    },
    {
      "name": "Credit"
    },
    {
      "name": "CRM"
    },
    {
      "name": "Custom Caller ID",
      "description": "Access and modify information about custom caller ID (Account and Users)"
    },
    {
      "name": "Custom Routing"
    },
    {
      "name": "Devices"
    },
    {
      "name": "DidNumbers"
    },
    {
      "name": "Export"
    },
    {
      "name": "Fax"
    },
    {
      "name": "Fax Config"
    },
    {
      "name": "Feature Bundles"
    },
    {
      "name": "FMFM Profile"
    },
    {
      "name": "FMFM Profiles"
    },
    {
      "name": "FMFM State"
    },
    {
      "name": "IP Whitelisting"
    },
    {
      "name": "LDAP"
    },
    {
      "name": "Locations",
      "description": "Access to locations information"
    },
    {
      "name": "MainNumbers"
    },
    {
      "name": "Media"
    },
    {
      "name": "Mobile"
    },
    {
      "name": "Numbers"
    },
    {
      "name": "Numbers Provider"
    },
    {
      "name": "Onboard"
    },
    {
      "name": "Onboard Customization"
    },
    {
      "name": "Omnichannel"
    },
    {
      "name": "Payments"
    },
    {
      "name": "Pins",
      "description": "Access and Modify to Pins Information"
    },
    {
      "name": "Provisioning"
    },
    {
      "name": "Queues"
    },
    {
      "name": "Ratedecks"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Security Policies"
    },
    {
      "name": "Service Plans"
    },
    {
      "name": "Signup"
    },
    {
      "name": "SMS Providers"
    },
    {
      "name": "Status"
    },
    {
      "name": "Storage"
    },
    {
      "name": "System"
    },
    {
      "name": "Tags"
    },
    {
      "name": "Tasks"
    },
    {
      "name": "Transcription"
    },
    {
      "name": "UCP Dashboard"
    },
    {
      "name": "Users"
    },
    {
      "name": "Voicemail"
    },
    {
      "name": "VMBoxes"
    },
    {
      "name": "Webchat"
    },
    {
      "name": "Webphone"
    }
  ],
  "externalDocs": {
    "description": "QVOICE Platform documentation",
    "url": "https://docs.qvoice.net/"
  },
  "paths": {
    "/api/v2/calls/quickcall": {
      "post": {
        "tags": [
          "Calls"
        ],
        "summary": "Ring an extension and send the answered call to another extension",
        "operationId": "createQuickcall",
        "description": "Rings the user or device that owns `target_ext` and, once a phone answers, sends the call to the `route_to` extension (an IVR, a pivot callflow, reception). Typical use: a hotel wake-up call (ring the room, then play the wake-up IVR). The call is placed asynchronously: a `202` means the phones are being rung, not that anyone answered. Set `status_callback` to receive an `answered` POST and a `completed` POST.\n\nRequires an account admin bearer token or an API key (`X-API-Key` + `X-Account-ID`). The call is placed in the working account (`X-Account-ID`, else the user's own account).\n\nThe answered leg's caller ID number is `target_ext`, so the `route_to` callflow and its pivot see which phone answered.\n",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyAuth": [],
            "accountIdHeader": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickcallRequest"
              },
              "example": {
                "target_ext": "4440",
                "route_to": "7100",
                "timeout": 45,
                "caller_id": {
                  "name": "Wake-up call",
                  "number": "7100"
                },
                "no_voicemail": true,
                "custom_application_vars": {
                  "stay_id": "RES-2026-118842"
                },
                "status_callback": "https://pms.example.com/hooks/wakeup"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The phones are being rung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickcallResponse"
                },
                "example": {
                  "call_ids": [
                    "6f0e2a4c-3b9d-4f1e-9a43-1c2d3e4f5a6b"
                  ],
                  "target": {
                    "type": "users",
                    "id": "0b6d7c3e9f2a4b1c8d5e6f7a8b9c0d1e"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or unknown field, `target_ext` not 1-16 digits, `route_to` not 1-32 of digits/`*`/`#`, `timeout` outside 5-300, bad `status_callback`, `target_ext` is not a user or device (ring group, queue, IVR), no callflow for `route_to`, or Kazoo refused the request (caller ID or SIP headers).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                },
                "example": {
                  "error": "target_ext must be 1 to 16 digits"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No callflow owns `target_ext`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "callbacks": {
          "statusCallback": {
            "{$request.body#/status_callback}": {
              "post": {
                "summary": "Quickcall status event",
                "operationId": "quickcallStatusCallback",
                "security": [],
                "description": "Sent by goportal when a leg answers (`event: answered`) and once every leg has ended (`event: completed`). Each POST times out after 10 seconds; a failed POST is retried after 2 and 5 seconds. The POST carries no authentication header. The watch is held in memory: a goportal restart during the call loses its callbacks.\n",
                "requestBody": {
                  "required": true,
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/QuickcallStatusEvent"
                      },
                      "example": {
                        "event": "completed",
                        "status": "answered",
                        "call_ids": [
                          "6f0e2a4c-3b9d-4f1e-9a43-1c2d3e4f5a6b"
                        ],
                        "target_ext": "4440",
                        "route_to": "7100",
                        "hangup_cause": "NORMAL_CLEARING",
                        "talk_seconds": 22,
                        "timestamp": 1764763260,
                        "custom_application_vars": {
                          "stay_id": "RES-2026-118842"
                        }
                      }
                    }
                  }
                },
                "responses": {
                  "2XX": {
                    "description": "Any 2xx acknowledges the event."
                  },
                  "4XX": {
                    "description": "Any non-2xx answer (or no answer in 10 seconds) is a failure; the POST is retried after 2 and 5 seconds, then dropped.\n"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/calls/hangup": {
      "delete": {
        "tags": [
          "Calls"
        ],
        "summary": "Hang up an active call",
        "description": "Tears down a two-legged call by call-leg UUID. The inbound and outbound leg UUIDs come from the CDR or from the realtime call events that the platform emits. The handler first attempts to hang up via the Kazoo API (`HangupCall`) on the inbound leg, then falls back to the outbound leg, and finally to a force `fs_cli uuid_kill` over SSH on every configured FreeSWITCH node if both API calls fail. Both legs are best-effort: a `204 No Content` only means the request was accepted, not that both legs were guaranteed alive when the kill was issued.\n",
        "parameters": [
          {
            "in": "query",
            "name": "inbound",
            "required": true,
            "description": "UUID of the inbound leg (A-leg).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "outbound",
            "required": false,
            "description": "UUID of the outbound leg (B-leg). Optional but strongly recommended for bridged calls — if only the inbound leg is supplied and the Kazoo hangup of that leg fails, the call cannot be torn down.\n",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Hangup request accepted. Both legs were torn down via Kazoo, or the SSH `uuid_kill` fallback was triggered.",
            "content": {}
          },
          "400": {
            "description": "Required `inbound` query parameter is missing.",
            "content": {}
          },
          "500": {
            "description": "Both Kazoo hangup attempts (inbound and outbound) failed.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/calls/{action}/{uuid}/{extension}": {
      "post": {
        "tags": [
          "Calls"
        ],
        "summary": "Spy, barge or whisper into a live call",
        "description": "Adds a supervisor extension into a live call leg in one of three listen modes. The handler forwards the request to the queues / three-way engine (`GET /threeway_barge`) which patches the supervisor into the existing bridge.\n\nThe mode is selected by the `action` path parameter:\n\n  * `spy`   — silent monitoring. The supervisor hears both parties but\n              is muted to everyone (a.k.a. listen / eavesdrop).\n  * `barge` — the supervisor joins the conversation and is audible to\n              both parties.\n  * `coach` — whisper / coaching. The supervisor is audible ONLY to the\n              monitored agent (`extension`), not to the remote party.\n\n\nThis endpoint is the call-control twin of `PUT /callcenter/queue/queue_add_agent/{confid}/{ext}/{action}`; this one keys off the live call-leg UUID, the call-center one keys off the queue conference id. The HTTP status returned mirrors whatever the queues engine replies with.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "description": "Kazoo account id that owns the call.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "action",
            "required": true,
            "description": "Monitoring mode.",
            "schema": {
              "type": "string",
              "enum": [
                "spy",
                "barge",
                "coach"
              ]
            }
          },
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "description": "UUID of the call leg to monitor (from the CDR or realtime call events).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "extension",
            "required": true,
            "description": "Supervisor extension to patch into the call.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request accepted and forwarded to the queues engine. The effective status mirrors the queues engine response.",
            "content": {}
          },
          "400": {
            "description": "Missing `X-Account-ID` header.",
            "content": {}
          },
          "500": {
            "description": "Could not build the request to, or reach, the queues engine.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/fax": {
      "post": {
        "summary": "Fax Configuration",
        "description": "Edit the fax configuration for the current user account.",
        "tags": [
          "Fax Config"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FaxConfig"
              },
              "description": "New fax configuration details",
              "required": true
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "get": {
        "summary": "Fax Configuration",
        "description": "Retrieve the fax configuration for the current user account.",
        "tags": [
          "Fax Config"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaxConfig"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/new": {
      "post": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Start AI Concierge signup",
        "description": "Verifies the provided Google OAuth access token and returns a short-lived signup token (30 minutes) whose claims include the Google email, to be used across the signup flow.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accessToken": {
                    "type": "string",
                    "description": "Google OAuth access token",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signup token generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signupToken": {
                      "type": "string",
                      "description": "JWT that must be sent as Bearer token in subsequent signup requests"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid request body",
            "content": {}
          },
          "401": {
            "description": "Invalid Google access token",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signin": {
      "post": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Sign in an existing AI Concierge user",
        "description": "Verifies the Google OAuth access token and looks up a user with the\nauthenticated email.\n\n- If `account` is omitted, the backend searches across all accounts.\n- If `account` is provided, the search is limited to that account.\n\nWhen the user belongs to exactly one account (or the account is\nspecified), access and refresh tokens are returned. When the user\nbelongs to multiple accounts, the list of accounts is returned so\nthe client can re-send the request with the chosen account id.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accessToken": {
                    "type": "string",
                    "description": "Google OAuth access token",
                    "required": true
                  },
                  "account": {
                    "type": "string",
                    "description": "Optional account id to restrict the lookup"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sign in succeeded (tokens) or multiple accounts matched (accounts list)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "type": "string",
                      "description": "Matched account id (present when a single account match)"
                    },
                    "userId": {
                      "type": "string",
                      "description": "Matched user id (present when a single account match)"
                    },
                    "accessToken": {
                      "type": "string",
                      "description": "Session access token (present when a single account match)"
                    },
                    "refreshToken": {
                      "type": "string",
                      "description": "Session refresh token (present when a single account match)"
                    },
                    "accounts": {
                      "type": "array",
                      "description": "List of accounts matching the email (present when multiple matches and no account was specified)",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid request body",
            "content": {}
          },
          "401": {
            "description": "Invalid Google access token",
            "content": {}
          },
          "404": {
            "description": "No user found for the given email (and account, if provided)",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/refresh": {
      "post": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Refresh session tokens",
        "description": "Rotates the session by returning a new access + refresh token pair.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <refresh_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "New tokens issued successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid refresh token",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/voices": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "List available AI agent voices",
        "description": "Returns the catalog of voices that can be assigned to the AI agent during signup. Each entry includes a `previewUrl` pointing to the audio preview endpoint.",
        "responses": {
          "200": {
            "description": "List of voices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Voice identifier used by the TTS provider"
                      },
                      "name": {
                        "type": "string"
                      },
                      "gender": {
                        "type": "string",
                        "enum": [
                          "Male",
                          "Female"
                        ]
                      },
                      "description": {
                        "type": "string"
                      },
                      "avatarColor": {
                        "type": "string",
                        "description": "Hex color used by the UI to render the voice avatar"
                      },
                      "previewUrl": {
                        "type": "string",
                        "description": "URL for streaming a short audio preview of the voice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/voices/{voice_id}/preview": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Stream a voice preview audio sample",
        "description": "Returns an MP3 audio stream with a short sample of the requested voice. Responses are cached in memory on the server and on the client (24h).",
        "parameters": [
          {
            "in": "path",
            "name": "voice_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Voice identifier returned by the voices endpoint"
          }
        ],
        "responses": {
          "200": {
            "description": "Audio sample",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown voice id",
            "content": {}
          },
          "502": {
            "description": "Upstream TTS provider failed",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/phone_numbers": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Search available phone numbers for the signup flow",
        "description": "Queries the DID provider (Twilio) for local phone numbers that match the given ISO country code and optional area code.",
        "parameters": [
          {
            "in": "query",
            "name": "country",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ISO 3166-1 alpha-2 country code (e.g. US, CA, AR)"
          },
          {
            "in": "query",
            "name": "areaCode",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Numeric area code prefix to filter available numbers"
          }
        ],
        "responses": {
          "200": {
            "description": "List of available phone numbers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "E.164 phone number used as identifier"
                      },
                      "number": {
                        "type": "string",
                        "description": "Friendly-formatted phone number (e.g. \"(415) 555-1234\")"
                      },
                      "location": {
                        "type": "string",
                        "description": "Human-readable location label (e.g. \"San Francisco, CA · US\")"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid query parameters",
            "content": {}
          },
          "502": {
            "description": "DID provider request failed",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/plans": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "List available AI Concierge plans",
        "description": "Returns the catalog of plans a user can pick during signup. The plans\nare stored in the AI Concierge master account as service plan documents\nlinked to permissions templates. Missing plans / permissions are created\non the first call.\n",
        "responses": {
          "200": {
            "description": "List of plans",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Service plan document id"
                      },
                      "name": {
                        "type": "string"
                      },
                      "ratePerUser": {
                        "type": "number",
                        "format": "float",
                        "description": "Monthly rate per user"
                      },
                      "features": {
                        "type": "object",
                        "description": "Feature flags derived from the linked permissions template (true = enabled)",
                        "properties": {
                          "desktop": {
                            "type": "boolean"
                          },
                          "mobile": {
                            "type": "boolean"
                          },
                          "portal": {
                            "type": "boolean"
                          },
                          "smartpbx": {
                            "type": "boolean"
                          },
                          "reports": {
                            "type": "boolean"
                          },
                          "callcenter": {
                            "type": "boolean"
                          },
                          "phone_numbers": {
                            "type": "boolean"
                          },
                          "sms": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/agency/name_availability/{name}": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Check whether an agency name is available",
        "description": "Sanitizes the provided name (trims and collapses internal whitespace)\nand reports whether it can be used as the account name when completing\nsignup. The same sanitization runs at account creation time to guarantee\nthe value checked here is the one persisted.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <signup_token>"
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agency name to validate (URL-encoded)"
          }
        ],
        "responses": {
          "200": {
            "description": "Availability result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Sanitized name that was checked"
                    },
                    "available": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing name query parameter",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid signup token",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/auth/signup/payment/setup_intent": {
      "post": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Create a Stripe SetupIntent for the signup flow",
        "description": "Creates a Stripe customer for the signup email and a SetupIntent whose\nclient secret is returned so the FE can securely collect card details\nvia Stripe.js (no card data ever touches our backend).\n\nThe returned `customerId` + the payment method id the FE obtains after\nconfirming the SetupIntent must be sent in the `accounts/new` request.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <signup_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Setup intent created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customerId": {
                      "type": "string"
                    },
                    "clientSecret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid signup token",
            "content": {}
          },
          "502": {
            "description": "Stripe request failed",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/accounts/new": {
      "post": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Complete signup and create the AI Concierge account",
        "description": "Final step of the signup flow. Provisions everything needed for the\ncustomer to start using AI Concierge:\n\n1. Creates a child account under the AI Concierge master account\n   (with the chosen service plan stamped on it).\n2. Creates the admin user (email comes from the signup token claims,\n   first/last name are derived from `fullName`).\n3. Creates the AI Concierge agent document with the voice/greeting/language.\n4. Binds the selected plan to the account in Kazoo.\n5. Attaches the Stripe payment method to the customer, tags the\n   customer with the new account id and sets it as default.\n6. Purchases the selected phone number from Twilio. When\n   `ai_concierge.twilio_sip_trunk_sid` is configured, attaches the\n   DID to that Elastic SIP Trunk (QVoice inbound) before Kazoo\n   registration. Registers the number in the numbers DB. If anything\n   after the Twilio purchase fails the number is released automatically\n   to avoid charges.\n7. Issues access + refresh tokens so the FE can drop the signup token.\n\nAll `createAccountRequest` fields are required.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <signup_token>"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agencyName": {
                    "type": "string",
                    "description": "Used both as the account name and as part of the realm"
                  },
                  "fullName": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string",
                    "description": "ISO 3166-1 alpha-2 country code"
                  },
                  "state": {
                    "type": "string",
                    "description": "Region / province / state of the agency"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone name (e.g. \"America/Argentina/Buenos_Aires\")"
                  },
                  "agentName": {
                    "type": "string"
                  },
                  "voiceId": {
                    "type": "string",
                    "description": "Voice id from the voices catalog"
                  },
                  "language": {
                    "type": "string",
                    "description": "Primary language code (e.g. \"en\", \"es\")"
                  },
                  "greeting": {
                    "type": "string"
                  },
                  "greetingOutbound": {
                    "type": "string",
                    "description": "First sentence the AI agent will say on outbound calls. Empty string is valid; backend cap is 1000 characters.\n"
                  },
                  "voicemailGreeting": {
                    "type": "string",
                    "description": "Text for the admin user's voicemail greeting. Persisted on persona.voicemail_greeting; audio is synthesized by OpenAI in the signup voiceId and uploaded as an MP3 to the VMBox media. Empty string is replaced server-side with a default greeting built from the first name. Backend cap is 1000 characters.\n"
                  },
                  "areaCodePrefix": {
                    "type": "string",
                    "description": "Area code prefix used for the number search"
                  },
                  "phoneNumberId": {
                    "type": "string",
                    "description": "E.164 phone number selected from the availability search"
                  },
                  "planId": {
                    "type": "string",
                    "description": "Plan id from the signup plans endpoint"
                  },
                  "billingCycle": {
                    "type": "string",
                    "enum": [
                      "monthly",
                      "yearly"
                    ]
                  },
                  "stripeCustomerId": {
                    "type": "string"
                  },
                  "paymentMethodId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "agentId": {
                      "type": "string"
                    },
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing required field or invalid billing cycle",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid signup token",
            "content": {}
          },
          "409": {
            "description": "Agency name is already taken",
            "content": {}
          },
          "500": {
            "description": "Internal error while provisioning the account",
            "content": {}
          },
          "502": {
            "description": "Upstream provider error (Twilio phone number purchase)",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/me": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Get the authenticated user and account",
        "description": "Returns the AI Concierge user and account documents with only the fields\nrelevant to the FE, derived from the data persisted during signup.\n\nAuthenticated with a session access token; the user id and account id\nare extracted from the token claims.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated user + account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "fullName": {
                          "type": "string"
                        }
                      }
                    },
                    "account": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "plan": {
                          "type": "string",
                          "description": "Service plan id assigned to the account"
                        },
                        "billing": {
                          "type": "string",
                          "enum": [
                            "monthly",
                            "yearly"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid access token",
            "content": {}
          },
          "500": {
            "description": "Internal error while loading the documents",
            "content": {}
          }
        }
      }
    },
    "/api/v2/ai_concierge/agent": {
      "get": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Get the AI Concierge agent configuration",
        "description": "Returns the AI Concierge agent document for the authenticated account.\nEach account has exactly one agent (created at signup time).\n\nThe Twilio SID stored alongside the phone number is intentionally\nomitted from the response — it is an internal handle used for provider\noperations and never needed by the FE.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Agent configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "voiceId": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "greetingOutbound": {
                      "type": "string",
                      "description": "First sentence the AI speaks on outbound calls. Empty string when not set.\n"
                    },
                    "voicemailGreeting": {
                      "type": "string",
                      "description": "Pass-through read of persona.voicemail_greeting. No Crossbar call on GET. Empty string for legacy accounts provisioned before this field was added (their audio may still play from the old media doc) until the next save.\n"
                    },
                    "phoneNumber": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "number": {
                          "type": "string",
                          "description": "E.164 phone number assigned to the agent"
                        }
                      }
                    },
                    "gmailInboundCampaignId": {
                      "type": "string",
                      "description": "Campaign id for Gmail inbound lead dialer adds"
                    },
                    "gmailSenderInclude": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Gmail sender domain allowlist (portal gmail_sender_include)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid access token",
            "content": {}
          },
          "404": {
            "description": "No agent exists for this account",
            "content": {}
          },
          "500": {
            "description": "Internal error while loading the agent doc",
            "content": {}
          }
        }
      },
      "patch": {
        "tags": [
          "AI Concierge"
        ],
        "summary": "Update the AI Concierge agent configuration",
        "description": "Partial update of the AI Concierge agent. Only supplied fields are\nwritten. Returns the same shape as GET /agent.\n\nThe voicemail audio is regenerated (OpenAI TTS in the persona voice)\nwhen `voicemailGreeting` is supplied OR when `voiceId` changes and the\npersona already has a voicemail greeting. `language` is NOT required\nfor the voicemail greeting.\n\nIf the persona write succeeds but the voicemail step fails, the\nresponse is 502 and the persona change is kept (partial-write window;\nthe FE should re-fetch via GET /agent to show the actual state).\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "voiceId": {
                    "type": "string"
                  },
                  "greeting": {
                    "type": "string"
                  },
                  "greetingOutbound": {
                    "type": "string",
                    "description": "First sentence the AI speaks on outbound calls. Empty string clears the field. Max 1000 characters.\n"
                  },
                  "voicemailGreeting": {
                    "type": "string",
                    "description": "Voicemail greeting text. Persisted on persona.voicemail_greeting; audio is synthesized by OpenAI in the persona voice and uploaded as an MP3. Empty string is replaced with a default greeting (never cleared). Max 1000 characters. `language` is NOT required.\n"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es"
                    ],
                    "description": "Optional. Rewrites the persona prompt language instruction. Not coupled to the voicemail greeting (voicemail voice is the persona voice).\n"
                  },
                  "officeHours": {
                    "type": "object"
                  },
                  "voiceWhatsappNotifyScope": {
                    "type": "string"
                  },
                  "gmailInboundCampaignId": {
                    "type": "string"
                  },
                  "gmailSenderInclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent configuration after update (same shape as GET /agent)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "voiceId": {
                      "type": "string"
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "greetingOutbound": {
                      "type": "string"
                    },
                    "voicemailGreeting": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (a greeting field exceeds the 1000-character cap).\n",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid access token",
            "content": {}
          },
          "404": {
            "description": "No agent exists for this account",
            "content": {}
          },
          "502": {
            "description": "Voicemail upstream failure after persona was written. Persona change is retained.\n",
            "content": {}
          }
        }
      }
    },
    "/api/v2/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Log in",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "User Email",
                    "required": true
                  },
                  "password": {
                    "type": "string",
                    "description": "User Password",
                    "required": true
                  },
                  "domain": {
                    "type": "string",
                    "description": "User account name",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authentication was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "refresh_token": {
                      "type": "string"
                    },
                    "user": {
                      "type": "object",
                      "description": "User authenticated Data"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The user could not be authenticated. The request body is incorrect",
            "content": {}
          },
          "500": {
            "description": "The user could not be authenticated. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/apikeys": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "API Keys"
        ],
        "summary": "Create API Key",
        "operationId": "createAPIKey",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID for which to create the API key"
            }
          }
        ],
        "requestBody": {
          "description": "API key information that needs to be created",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Nombre de la API key",
                    "example": "API Key para integración"
                  },
                  "description": {
                    "type": "string",
                    "description": "Descripción opcional de la API key",
                    "example": "API key para integración con sistema externo"
                  },
                  "expires_at": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Timestamp Unix de expiración (0 = sin expiración)",
                    "example": 1735689600,
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID único de la API key"
                    },
                    "key": {
                      "type": "string",
                      "description": "API key en texto plano (solo se devuelve una vez)"
                    },
                    "account_id": {
                      "type": "string",
                      "description": "ID de la cuenta"
                    },
                    "name": {
                      "type": "string",
                      "description": "Nombre de la API key"
                    },
                    "description": {
                      "type": "string",
                      "description": "Descripción de la API key"
                    },
                    "created_by": {
                      "type": "string",
                      "description": "ID del usuario que creó la API key"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Fecha de creación"
                    },
                    "is_revoked": {
                      "type": "boolean",
                      "description": "Indica si la API key está revocada"
                    },
                    "expires_at": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Timestamp Unix de expiración (0 = sin expiración)",
                      "example": 1735689600
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required fields",
            "content": {}
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      },
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "API Keys"
        ],
        "summary": "API Keys List",
        "operationId": "listAPIKeys",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID for which to list API keys"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API keys successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the API key"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the API key"
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the API key"
                      },
                      "created_by": {
                        "type": "string",
                        "description": "User ID who created the API key"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Creation timestamp"
                      },
                      "last_used": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Last usage timestamp"
                      },
                      "is_revoked": {
                        "type": "boolean",
                        "description": "Whether the API key is revoked"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Expiration date of the API key (null if no expiration)"
                      },
                      "is_expired": {
                        "type": "boolean",
                        "description": "Whether the API key has expired"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing X-Account-ID header",
            "content": {}
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/apikeys/{key_id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "API Keys"
        ],
        "summary": "API Key by ID",
        "operationId": "getAPIKey",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the API key to retrieve"
            }
          },
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID for which to retrieve the API key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the API key"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the API key"
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the API key"
                    },
                    "created_by": {
                      "type": "string",
                      "description": "User ID who created the API key"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Creation timestamp"
                    },
                    "last_used": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Last usage timestamp"
                    },
                    "is_revoked": {
                      "type": "boolean",
                      "description": "Whether the API key is revoked"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Expiration date of the API key (null if no expiration)"
                    },
                    "is_expired": {
                      "type": "boolean",
                      "description": "Whether the API key has expired"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing X-Account-ID header",
            "content": {}
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication",
            "content": {}
          },
          "404": {
            "description": "API key not found",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "API Keys"
        ],
        "summary": "API Key",
        "operationId": "deleteAPIKey",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the API key to delete"
            }
          },
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID for which to delete the API key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "API key successfully deleted",
            "content": {}
          },
          "400": {
            "description": "Bad request - missing X-Account-ID header",
            "content": {}
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication",
            "content": {}
          },
          "404": {
            "description": "API key not found",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/apikeys/{key_id}/revoke": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "API Keys"
        ],
        "summary": "Revoke API Key",
        "operationId": "revokeAPIKey",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the API key to revoke"
            }
          },
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID for which to revoke the API key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "API key successfully revoked",
            "content": {}
          },
          "400": {
            "description": "Bad request - missing X-Account-ID header",
            "content": {}
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication",
            "content": {}
          },
          "404": {
            "description": "API key not found",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/billing/{accountID}/users": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Billing"
        ],
        "summary": "Accounts with Paid Users",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "Account ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts with paid users has been listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingAccounts"
                }
              }
            }
          },
          "500": {
            "description": "Accounts with paid users could not be listed",
            "content": {}
          }
        }
      }
    },
    "/billing/users": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Billing"
        ],
        "summary": "All Accounts with Paid Users",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts with paid users has been listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingAccounts"
                }
              }
            }
          },
          "500": {
            "description": "Accounts with paid users could not be listed",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/payments/gateway/{id}": {
      "put": {
        "tags": [
          "Payments"
        ],
        "summary": "PUT Payment Gateway Integration data",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Payment gateway integration"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Payment gateway name"
                  },
                  "note": {
                    "type": "string",
                    "description": "Payment gateway note"
                  },
                  "api_key": {
                    "type": "string",
                    "description": "Payment gateway api_key of Stripe"
                  },
                  "publishable_key": {
                    "type": "string",
                    "description": "Payment gateway publishable_key of Stripe"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Payment gateway integration has been edited successfully",
            "content": {}
          },
          "400": {
            "description": "Payment gateway could not be edited. Bad request",
            "content": {}
          },
          "500": {
            "description": "Payment gateway could not be edited. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/payments/gateway": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "GET Payment Gateway Integration data",
        "responses": {
          "200": {
            "description": "Payment gateway data has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentGateway"
                }
              }
            }
          },
          "500": {
            "description": "Payment gateway could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Create Payment Gateway Integration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Payment gateway name"
                  },
                  "note": {
                    "type": "string",
                    "description": "Payment gateway note"
                  },
                  "api_key": {
                    "type": "string",
                    "description": "Payment gateway api_key of Stripe"
                  },
                  "publishable_key": {
                    "type": "string",
                    "description": "Payment gateway publishable_key of Stripe"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payment gateway integration has been created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of payment gateway integration"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payment gateway could not be created. Bad Request",
            "content": {}
          },
          "500": {
            "description": "Payment gateway could not be created. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/payments/gateway/{provider}/currencies": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "GET payment gateway available currencies",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Payments Gateway (stripe, etc.)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment gateway currencies have been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "Currency three-digit code",
                    "required": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payments gateway currencies could not be obtained. Specified payments gateway is unknown",
            "content": {}
          },
          "500": {
            "description": "Payments gateway currencies could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/account/payments/method/new": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "VALIDATE and CREATE new payment method",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "integer",
                    "description": "Card Number"
                  },
                  "expiration_date": {
                    "type": "integer",
                    "description": "Card Expiration Date"
                  },
                  "cvv": {
                    "type": "integer",
                    "description": "Card Security Three-Digit Code"
                  },
                  "cardholder": {
                    "type": "string",
                    "description": "Owner of the Card"
                  },
                  "country": {
                    "type": "string",
                    "description": "Country of Card Owner"
                  },
                  "city": {
                    "type": "string",
                    "description": "City of Card Owner"
                  },
                  "address_zip": {
                    "type": "integer",
                    "description": "Address ZIP of Card Owner"
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of Payment Method"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Set payment method as active"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payment method has been created successfully",
            "content": {}
          },
          "400": {
            "description": "Payment method has not been created. Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Validation Error",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "description": "Error Code"
                        },
                        "description": {
                          "type": "string",
                          "description": "Error Description"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Payment method has not been created. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/blocked-numbers": {
      "get": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "List the caller's blocked numbers",
        "description": "Returns the authenticated user's personal block list. The list only applies to direct calls from external numbers to the user's extension and direct numbers; queue calls do not consult it.",
        "responses": {
          "200": {
            "description": "The block list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "+14155550100"
                      ]
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "busy",
                        "message",
                        "voicemail"
                      ],
                      "description": "What a blocked caller gets. busy when never set.",
                      "example": "busy"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "Block a number",
        "description": "Adds a number to the authenticated user's block list. Adding a number already on the list succeeds and leaves the list unchanged.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "number"
                ],
                "properties": {
                  "number": {
                    "type": "string",
                    "description": "Phone number, 7 to 20 digits with an optional leading +. Spaces, dashes, dots and parentheses are ignored.",
                    "example": "+14155550100"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated block list."
          },
          "400": {
            "description": "The number is not valid."
          },
          "422": {
            "description": "The block list has reached its limit of 500 numbers."
          }
        }
      }
    },
    "/ucp/v2/blocked-numbers/company": {
      "get": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "List the company block list",
        "description": "Admins only. The account's company block list, managed from UCP as the Kazoo blacklist named \"Company block list\". Kazoo rejects these callers with 486 Busy Here on every number of the account, before any callflow, queue or IVR runs. Other blacklists on the account are not listed.",
        "responses": {
          "200": {
            "description": "The company block list, E.164 numbers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "+14155550100"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The user is not an admin."
          }
        }
      },
      "post": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "Block a number for the whole company",
        "description": "Admins only. The first number creates the list and attaches it to the account. A NANP number may be entered without +1; any other number needs its country code with a leading +. Adding a number already on the list succeeds and leaves the list unchanged.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "number"
                ],
                "properties": {
                  "number": {
                    "type": "string",
                    "example": "+14155550100"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated company block list."
          },
          "400": {
            "description": "The number is not valid or needs its country code."
          },
          "401": {
            "description": "The user is not an admin."
          },
          "422": {
            "description": "The company block list has reached its limit of 1000 numbers."
          }
        }
      }
    },
    "/ucp/v2/blocked-numbers/company/{number}": {
      "delete": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "Unblock a number for the whole company",
        "description": "Admins only. Removing a number that is not on the list succeeds and leaves the list unchanged.",
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated company block list."
          },
          "401": {
            "description": "The user is not an admin."
          }
        }
      }
    },
    "/ucp/v2/blocked-numbers/action": {
      "put": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "Set what blocked callers get",
        "description": "busy: the caller hears a busy signal (486 Busy Here). message: the caller hears a not-available prompt as early media, then busy. voicemail: the call goes to the user's voicemail box, or busy when the user has none. The list itself is unchanged.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "busy",
                      "message",
                      "voicemail"
                    ],
                    "example": "voicemail"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The block list with the new action."
          },
          "400": {
            "description": "The action is not one of busy, message or voicemail."
          }
        }
      }
    },
    "/ucp/v2/blocked-numbers/{number}": {
      "delete": {
        "tags": [
          "Blocked Numbers"
        ],
        "summary": "Unblock a number",
        "description": "Removes a number from the authenticated user's block list. Removing a number that is not on the list succeeds and leaves the list unchanged.",
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated block list."
          }
        }
      }
    },
    "/ucp/v2/user/basic": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "User Basic Information",
        "responses": {
          "200": {
            "description": "The data has been obtained successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "User ID",
                      "required": true
                    },
                    "first_name": {
                      "type": "string",
                      "description": "User First Name",
                      "required": true
                    },
                    "last_name": {
                      "type": "string",
                      "description": "User Last Name",
                      "required": true
                    },
                    "email": {
                      "type": "string",
                      "description": "User Email",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error. The data could not be obtained.",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "User Basic Information",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "description": "User First Name",
                    "required": true
                  },
                  "last_name": {
                    "type": "string",
                    "description": "User Last Name",
                    "required": true
                  },
                  "email": {
                    "type": "string",
                    "description": "User Email",
                    "required": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "User has been edited successfully.",
            "content": {}
          },
          "400": {
            "description": "User has not been edited. Bad request",
            "content": {}
          },
          "500": {
            "description": "User has not been edited. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/{id}/level": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "User Permission Level",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "User ID to edit"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "level": {
                    "type": "string",
                    "description": "User permission level to assign",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "User has been edited successfully.",
            "content": {}
          },
          "400": {
            "description": "User has not been edited. Bad request",
            "content": {}
          },
          "500": {
            "description": "User has not been edited. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/{id}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "User",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "User ID to delete"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "User has been removed successfully.",
            "content": {}
          },
          "500": {
            "description": "User has not been removed. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/user/monster/auth": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Crossbar Authentication Token",
        "responses": {
          "200": {
            "description": "User has been logged successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "description": "Authentication token returned by Crossbar API",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "User has not been logged successfully",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Users List",
        "responses": {
          "200": {
            "description": "Users list has been obtained successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "User ID",
                        "required": true
                      },
                      "first_name": {
                        "type": "string",
                        "description": "User First Name",
                        "required": true
                      },
                      "last_name": {
                        "type": "string",
                        "description": "User Last Name",
                        "required": true
                      },
                      "email": {
                        "type": "string",
                        "description": "User Email",
                        "required": true
                      },
                      "level": {
                        "type": "string",
                        "description": "User Permission Role (user/admin)",
                        "required": true
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Users list has not been obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/account/basic": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Basic Information",
        "responses": {
          "200": {
            "description": "Account information has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Account ID",
                      "required": true
                    },
                    "name": {
                      "type": "string",
                      "description": "Account Name",
                      "required": true
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Account Timezone",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Account information has not been obtained",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Account Basic Information",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Account Name",
                    "required": true
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Account Timezone",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Account information has been edited successfully",
            "content": {}
          },
          "400": {
            "description": "Account information has not been edited. Bad request",
            "content": {}
          },
          "500": {
            "description": "Account information has not been edited. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/account/billing": {
      "get": {
        "tags": [
          "Account Billing"
        ],
        "summary": "Account Billing Status",
        "responses": {
          "200": {
            "description": "Account billing status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "Account Billing Status [\"valid\", \"grace_period\", \"suspended\"]",
                      "required": true
                    },
                    "status_date": {
                      "type": "integer",
                      "description": "Last status change date",
                      "required": false
                    },
                    "grace_period_duration_days": {
                      "type": "integer",
                      "description": "Duration in days of grace period",
                      "required": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid request headers.",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/account/number": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Main Number",
        "responses": {
          "200": {
            "description": "Account main number has been obtained successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "number": {
                      "type": "string",
                      "description": "Account main number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Account Main Number",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "description": "Number that will be set as main number",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Account main number has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Bad request",
            "content": {}
          },
          "401": {
            "description": "Unauthorized",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/accounts/{account_id}/users/{user_id}/password": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "User Password",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Account"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          },
          {
            "in": "query",
            "name": "password",
            "required": true,
            "schema": {
              "type": "string",
              "description": "New Password"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Crossbar API Authorization Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "User password has been reset successfully",
            "content": {}
          },
          "400": {
            "description": "Bad Request. Request parameters are invalid",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/numbers": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Account Numbers",
        "responses": {
          "200": {
            "description": "Numbers have been listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "number": {
                        "type": "string",
                        "description": "DID Number",
                        "required": true
                      },
                      "users": {
                        "type": "array",
                        "required": true,
                        "items": {
                          "type": "string",
                          "description": "User ID assigned to number"
                        }
                      },
                      "sms": {
                        "type": "boolean",
                        "description": "Indicates if number has SMS capability",
                        "required": true
                      },
                      "free": {
                        "type": "boolean",
                        "description": "Indicates if number is free of charge",
                        "required": true
                      },
                      "main": {
                        "type": "boolean",
                        "description": "Indicates if number is the main company number",
                        "required": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {}
          },
          "500": {
            "description": "DIDs Numbers has not been listed. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/numbers/provider": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Numbers Provider Type",
        "responses": {
          "200": {
            "description": "Numbers provider type has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string",
                      "description": "Provider Type",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Numbers provider type has not been obtained",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/numbers/available": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Available Numbers to Purchase",
        "parameters": [
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Two-letter abbreviation of state (For instance California = CA)"
            }
          },
          {
            "in": "query",
            "name": "areacode",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Numbers area code (For instance 201)"
            }
          },
          {
            "in": "query",
            "name": "sms",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Numbers should support SMS or not"
            }
          },
          {
            "in": "query",
            "name": "results",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Maximum quantity of results (For instance 10)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Numbers has been listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "number": {
                        "type": "string",
                        "description": "DID Number",
                        "required": true
                      },
                      "type": {
                        "type": "string",
                        "description": "DID Type (For instance did_us)",
                        "required": true
                      },
                      "rate": {
                        "type": "number",
                        "description": "DID Rate",
                        "required": true
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Numbers has not been listed. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/numbers/purchase": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Purchase Numbers",
        "requestBody": {
          "description": "Numbers to be Purchased",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "required": true,
                    "items": {
                      "type": "object",
                      "properties": {
                        "number": {
                          "type": "string",
                          "required": true,
                          "description": "DID Number"
                        },
                        "rate": {
                          "type": "number",
                          "required": true,
                          "description": "DID Number Rate"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "DID Numbers has been purchased successfully.",
            "content": {}
          },
          "400": {
            "description": "DID Numbers has not been purchased. Bad Request",
            "content": {}
          },
          "500": {
            "description": "DID Numbers has not been purchased. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/numbers/{number}/assign": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Assign DID to Users",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string",
              "description": "DID to assign"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "users": {
                    "type": "array",
                    "required": true,
                    "items": {
                      "type": "string",
                      "description": "User ID"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "DID Number has been assigned successfully",
            "content": {}
          },
          "400": {
            "description": "DID Number has not been assigned. Bad Request",
            "content": {}
          },
          "500": {
            "description": "DID Number has not been assigned. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/numbers/release": {
      "delete": {
        "tags": [
          "Numbers"
        ],
        "summary": "Release Numbers",
        "parameters": [
          {
            "in": "query",
            "name": "did",
            "required": true,
            "schema": {
              "type": "string",
              "description": "DID to release"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "DID has been released successfully",
            "content": {}
          },
          "500": {
            "description": "DID has not been released. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/conference/pin": {
      "put": {
        "tags": [
          "Conferences"
        ],
        "summary": "User Conference PIN",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pin": {
                    "type": "string",
                    "description": "PIN Number to set",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Conference PIN has been edited successfully",
            "content": {}
          },
          "400": {
            "description": "Request body is not correct",
            "content": {}
          },
          "500": {
            "description": "Conference PIN could not be edited",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/conference/numbers": {
      "get": {
        "tags": [
          "Conferences"
        ],
        "summary": "User Conference Numbers",
        "description": "GET Room and PSTN Numbers of user conference",
        "responses": {
          "200": {
            "description": "Conference numbers has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "room_number": {
                      "type": "string",
                      "description": "Conference Room Number",
                      "required": true
                    },
                    "pstn_numbers": {
                      "type": "array",
                      "required": true,
                      "items": {
                        "type": "string",
                        "description": "Conference PSTN Number"
                      }
                    },
                    "pin_number": {
                      "type": "string",
                      "required": true,
                      "description": "Conference PIN Number"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Conference numbers could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/mobile/v2/sms/outbound": {
      "put": {
        "tags": [
          "Mobile"
        ],
        "summary": "User SMS Number",
        "parameters": [
          {
            "name": "cloud_username",
            "in": "query",
            "description": "Cloud Username",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "Cloud Password",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "description": "Number used for SMS",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The number used for SMS has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "The request body is invalid. Bad Request",
            "content": {}
          },
          "500": {
            "description": "The number used for SMS could not be updated",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Mobile"
        ],
        "summary": "User SMS Numbers",
        "parameters": [
          {
            "name": "cloud_username",
            "in": "query",
            "description": "Cloud Username",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "Cloud Password",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list of numbers has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "Number with SMS Feature Enabled"
                      }
                    },
                    "selected": {
                      "type": "string",
                      "description": "User number used for SMS Feature"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The list of numbers could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ldap/enabled": {
      "get": {
        "tags": [
          "LDAP"
        ],
        "summary": "LDAP Login Status",
        "responses": {
          "200": {
            "description": "LDAP login enabled value has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "LDAP login enabled value could not been obtained"
          }
        }
      },
      "put": {
        "tags": [
          "LDAP"
        ],
        "summary": "LDAP Login Status",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "LDAP login enabled value has been successfully updated"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "LDAP login enabled value could not been obtained"
          }
        }
      }
    },
    "/api/v2/config/numbers/{number}/sms": {
      "put": {
        "tags": [
          "SMS Providers"
        ],
        "summary": "Assign SMS Provider to Number",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Phone Number"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "description": "SMS Provider Account ID",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "SMS provider has been assigned the number successfully",
            "content": {}
          },
          "400": {
            "description": "Data sent in the body of the request is incorrect",
            "content": {}
          },
          "404": {
            "description": "The requested number could not be found",
            "content": {}
          },
          "500": {
            "description": "SMS provider could not be assigned to the specified number",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/sms/providers/{id}": {
      "get": {
        "tags": [
          "SMS Providers"
        ],
        "summary": "SMS Provider Account",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "SMS Provider Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SMS provider account has been successfully obtained",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSProviderAccount"
                }
              }
            }
          },
          "404": {
            "description": "SMS provider account could not be found",
            "content": {}
          },
          "500": {
            "description": "SMS provider account could not be obtained",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "SMS Providers"
        ],
        "summary": "SMS Provider Account",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "SMS Provider Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SMSProviderAccountForm"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "SMS provider account has been successfully updated",
            "content": {}
          },
          "400": {
            "description": "Data sent in the body of the request is incorrect",
            "content": {}
          },
          "404": {
            "description": "SMS provider account could not be found",
            "content": {}
          },
          "500": {
            "description": "SMS provider account could not be updated",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "SMS Providers"
        ],
        "summary": "SMS Provider Account",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "SMS Provider Account ID"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "SMS provider account has been successfully deleted",
            "content": {}
          },
          "500": {
            "description": "SMS provider account could not be deleted",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/sms/providers": {
      "get": {
        "tags": [
          "SMS Providers"
        ],
        "summary": "SMS Providers Accounts",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SMS provider accounts have been successfully obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true,
                      "description": "SMS Feature Status"
                    },
                    "providers": {
                      "$ref": "#/components/schemas/SMSProvidersAccountsList"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Unable to get SMS provider accounts",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/sms/providers": {
      "post": {
        "tags": [
          "SMS Providers"
        ],
        "summary": "CREATE SMS Provider Account",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SMSProviderAccountForm"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "SMS provider account has been created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of SMS Provider Account created",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Data sent in the body of the request is incorrect",
            "content": {}
          },
          "500": {
            "description": "SMS provider account could not be created",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/status": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Account Status",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Account"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "required": true,
                    "description": "Account Status (\"enabled\" or \"disabled\")"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The account status has been edited successfully",
            "content": {}
          },
          "400": {
            "description": "The information sent in the body of the request is incorrect",
            "content": {}
          },
          "500": {
            "description": "Unable to modify account status.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/callerid": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Account Caller ID",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Account"
            }
          }
        ],
        "requestBody": {
          "204": {
            "description": "Account caller id has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Bad request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          },
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external": {
                    "type": "string",
                    "required": true,
                    "description": "External caller ID number"
                  },
                  "emergency": {
                    "type": "string",
                    "required": true,
                    "description": "Emergency caller ID number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ucp/v2/users/callerid": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "User External Caller ID",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callerid": {
                    "type": "string",
                    "required": true,
                    "description": "User External Caller ID Number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The external caller ID number of user has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "The external caller ID number could not be updated. The request body is invalid",
            "content": {}
          },
          "500": {
            "description": "The external caller ID number could not be updated",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/callerid/external": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "User External Numbers",
        "responses": {
          "200": {
            "description": "User numbers have been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "User External Number"
                      }
                    },
                    "value": {
                      "type": "string",
                      "description": "User Caller ID External Number"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "User numbers could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/contacts/{source}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "User Contacts",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the contacts source. Valid values [google, fonouc]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User contacts list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contacts"
                }
              }
            }
          },
          "500": {
            "description": "Contacts could not be obtained",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Add new contact",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the contacts source. Valid values [google, fonouc]"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "required": true,
                    "description": "Contact name"
                  },
                  "phone_number": {
                    "type": "array",
                    "required": true,
                    "items": {
                      "type": "string"
                    },
                    "description": "Contact phone numbers"
                  },
                  "companies": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Contact companies"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contact successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "500": {
            "description": "Error creating contact",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Edit contact",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the contacts source. Valid values [google, fonouc]"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "required": true,
                    "description": "Contact ID"
                  },
                  "name": {
                    "type": "string",
                    "required": true,
                    "description": "Contact name"
                  },
                  "phone_number": {
                    "type": "array",
                    "required": true,
                    "items": {
                      "type": "string"
                    },
                    "description": "Contact phone numbers"
                  },
                  "companies": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Contact companies"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact successfully edited"
          },
          "500": {
            "description": "Error editing contact",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/users/contacts/{source}/{contactID}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete User Contact",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the contacts source. Valid values [google, fonouc]"
            }
          },
          {
            "in": "path",
            "name": "contactID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the contact to delete"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact successfully deleted"
          },
          "500": {
            "description": "Error deleting contact",
            "content": {}
          }
        }
      }
    },
    "/api/ucp/v2/devices": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "New Device",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "required": true,
                    "description": "Device Name"
                  },
                  "number": {
                    "type": "string",
                    "required": true,
                    "description": "Device Number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Device Created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "9eca3e9020030b9a95793f9e7a81590e"
                    },
                    "call_forward": {
                      "type": "object",
                      "properties": {
                        "direct_calls_only": {
                          "type": "boolean",
                          "example": false
                        },
                        "enabled": {
                          "type": "boolean",
                          "example": true
                        },
                        "failover": {
                          "type": "boolean",
                          "example": false
                        },
                        "ignore_early_media": {
                          "type": "boolean",
                          "example": true
                        },
                        "keep_caller_id": {
                          "type": "boolean",
                          "example": true
                        },
                        "number": {
                          "type": "number",
                          "example": 123
                        },
                        "require_keypress": {
                          "type": "boolean",
                          "example": true
                        },
                        "substitute": {
                          "type": "boolean",
                          "example": true
                        }
                      }
                    },
                    "contact_list": {
                      "type": "object",
                      "properties": {
                        "exclude": {
                          "type": "boolean",
                          "example": true
                        }
                      }
                    },
                    "device_type": {
                      "type": "string",
                      "example": "cellphone"
                    },
                    "enabled": {
                      "type": "boolean",
                      "example": true
                    },
                    "exclude_from_queues": {
                      "type": "boolean",
                      "example": false
                    },
                    "media": {
                      "type": "object",
                      "properties": {
                        "encryption": {
                          "type": "object",
                          "properties": {
                            "enforce_security": {
                              "type": "boolean",
                              "example": false
                            }
                          }
                        },
                        "audio": {
                          "type": "object",
                          "properties": {
                            "codecs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "example": "PCMU"
                              }
                            },
                            "encryption": {
                              "type": "object",
                              "properties": {
                                "enforce_security": {
                                  "type": "boolean",
                                  "example": false
                                }
                              }
                            }
                          }
                        },
                        "video": {
                          "type": "object",
                          "properties": {
                            "codecs": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "music_on_hold": {
                      "type": "object"
                    },
                    "mwi_unsolicitated_updates": {
                      "type": "boolean",
                      "example": true
                    },
                    "name": {
                      "type": "string",
                      "example": "my_device"
                    },
                    "owner_id": {
                      "type": "string",
                      "example": "e65cf6fa51dbba68aa4f1ba70fe05e9f"
                    },
                    "register_overwrite_notify": {
                      "type": "boolean",
                      "example": false
                    },
                    "ringtones": {
                      "type": "object"
                    },
                    "sip": {
                      "type": "object",
                      "properties": {
                        "expire_seconds": {
                          "type": "number",
                          "example": 300
                        },
                        "invite_format": {
                          "type": "string",
                          "example": "contact"
                        },
                        "method": {
                          "type": "string",
                          "example": "method"
                        }
                      }
                    },
                    "suppress_unregister_notifications": {
                      "type": "boolean",
                      "example": true
                    },
                    "ui_metadata": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing information",
            "content": {}
          },
          "500": {
            "description": "Device could not be created",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}/devices": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "User Device",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "required": true,
                    "description": "Device Name"
                  },
                  "device_type": {
                    "type": "string",
                    "description": "One of sip_device (default), softphone, cellphone, smartphone, landline, fax, sip_uri, ata, mobile, application"
                  },
                  "media": {
                    "type": "object",
                    "properties": {
                      "audio": {
                        "type": "object",
                        "properties": {
                          "codecs": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "PCMA",
                              "PCMU"
                            ]
                          }
                        }
                      },
                      "webrtc": {
                        "type": "boolean"
                      }
                    }
                  },
                  "sip": {
                    "type": "object",
                    "description": "Optional. How the INVITE to this device is addressed. SIP credentials are always generated. When omitted the device uses invite_format contact, as before.",
                    "properties": {
                      "invite_format": {
                        "type": "string",
                        "enum": [
                          "contact",
                          "username",
                          "npan",
                          "1npan",
                          "e164",
                          "route"
                        ],
                        "description": "Defaults to contact. Use route (with sip.route) for a sip_uri device."
                      },
                      "route": {
                        "type": "string",
                        "example": "sip:27871334133@sipgw.example.com",
                        "description": "SIP URI (sip:/sips:) the call is sent to. Required when invite_format is route; a route without invite_format implies route. Only account admins may set it (403 otherwise). Not supported by the bulk endpoint."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The device has been created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "required": true,
                      "description": "ID of Created Device"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid sip block; the body names the field, e.g. {\"sip.route\":{\"required\":{\"message\":\"...\"}}}",
            "content": {}
          },
          "403": {
            "description": "A non-admin user tried to set sip.route",
            "content": {}
          },
          "500": {
            "description": "The device could not be created",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/devices/{id}": {
      "patch": {
        "tags": [
          "Devices"
        ],
        "summary": "Update Device SIP addressing",
        "description": "Updates how calls to a device are addressed (sip.invite_format / sip.route). Account admins only. Any other field is rejected with 400.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the Device"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sip": {
                    "type": "object",
                    "properties": {
                      "invite_format": {
                        "type": "string",
                        "enum": [
                          "contact",
                          "username",
                          "npan",
                          "1npan",
                          "e164",
                          "route"
                        ]
                      },
                      "route": {
                        "type": "string",
                        "example": "sip:27871334133@sipgw.example.com"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated device",
            "content": {}
          },
          "400": {
            "description": "Invalid request (unknown field, missing sip, or invalid sip values)",
            "content": {}
          },
          "401": {
            "description": "The user is not an account admin",
            "content": {}
          },
          "404": {
            "description": "Device not found in the account",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}/devices/bulk": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "User Devices Bulk",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "required": true,
                      "description": "Device Name"
                    },
                    "media": {
                      "type": "object",
                      "properties": {
                        "audio": {
                          "type": "object",
                          "properties": {
                            "codecs": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "List of audio codecs"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The device has been created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of successfully created devices"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Partial success - Some devices created successfully, some encountered errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of successfully created devices"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Errors encountered during device creation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - The request body could not be decoded"
          },
          "500": {
            "description": "The device could not be created",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}/fmfm": {
      "put": {
        "tags": [
          "FMFM State"
        ],
        "summary": "User FMFM State",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true,
                    "description": "Enable FMFM feature for user?"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "FMFM state updated successfully."
          },
          "400": {
            "description": "FMFM state couldn't be set due to absence of devices associated to the user."
          },
          "500": {
            "description": "FMFM state couldn't be updated due to internal server error."
          }
        }
      }
    },
    "/api/v2/config/users/{id}/teams/sync": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Force Teams Synchronization",
        "description": "Forces synchronization of a user with Mattermost/Teams. This endpoint allows admins to manually trigger a sync when automatic sync fails.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User ID"
          }
        ],
        "responses": {
          "200": {
            "description": "User successfully synced with Mattermost",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message",
                      "example": "User successfully synced with Mattermost"
                    },
                    "user_id": {
                      "type": "string",
                      "description": "User ID"
                    },
                    "username": {
                      "type": "string",
                      "description": "Username"
                    },
                    "account_id": {
                      "type": "string",
                      "description": "Account ID"
                    },
                    "sync_timestamp": {
                      "type": "string",
                      "description": "Sync timestamp",
                      "example": "now"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Account or user does not have collaboration enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code",
                      "enum": [
                        "COLLABORATION_DISABLED",
                        "USER_COLLABORATION_DISABLED"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "description": "Internal server error - Failed to sync user with Mattermost",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "details": {
                      "type": "string",
                      "description": "Detailed error information"
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code",
                      "enum": [
                        "SERVICE_UNAVAILABLE",
                        "SYNC_FAILED"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/users/{id}/teams/password-reset": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Force Teams Password Reset",
        "description": "Forces a password reset for a user in Mattermost/Teams. This endpoint specifically focuses on password synchronization issues.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User ID"
          }
        ],
        "responses": {
          "200": {
            "description": "User password successfully reset in Mattermost",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message",
                      "example": "User password successfully reset in Mattermost"
                    },
                    "user_id": {
                      "type": "string",
                      "description": "User ID"
                    },
                    "username": {
                      "type": "string",
                      "description": "Username"
                    },
                    "account_id": {
                      "type": "string",
                      "description": "Account ID"
                    },
                    "reset_timestamp": {
                      "type": "string",
                      "description": "Reset timestamp",
                      "example": "now"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Account or user does not have collaboration enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code",
                      "enum": [
                        "COLLABORATION_DISABLED",
                        "USER_COLLABORATION_DISABLED"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "description": "Internal server error - Failed to reset user password in Mattermost",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "details": {
                      "type": "string",
                      "description": "Detailed error information"
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code",
                      "enum": [
                        "SERVICE_UNAVAILABLE",
                        "PASSWORD_RESET_FAILED"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/credit_thresholds": {
      "put": {
        "tags": [
          "Credit"
        ],
        "summary": "Account Credit Thresholds",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Account"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "threshold_alert": {
                    "type": "number",
                    "required": true
                  },
                  "recharge_threshold": {
                    "type": "number",
                    "required": true
                  },
                  "recharge_amount": {
                    "type": "number",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The account credit thresholds have been updated successfully.",
            "content": {}
          },
          "500": {
            "description": "The credit thresholds of the account could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/credit/{operation}": {
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Credit"
        ],
        "summary": "Account Credit Balance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Account"
            }
          },
          {
            "in": "path",
            "name": "operation",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Type of Operation (add or remove)"
            }
          },
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Credit amount"
                  },
                  "mount": {
                    "type": "number",
                    "deprecated": true,
                    "description": "Deprecated alias for amount (still accepted)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The account credit balance has been updated successfully.",
            "content": {}
          },
          "500": {
            "description": "The credit balance of the account could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/vmboxes": {
      "get": {
        "tags": [
          "VMBoxes"
        ],
        "summary": "GET list of VMBoxes",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list of VMBoxes has been successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VMBoxesList"
                }
              }
            }
          },
          "500": {
            "description": "The list of VMBoxes could not be retrieved.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/service_plans/{id}": {
      "get": {
        "tags": [
          "Service Plans"
        ],
        "summary": "Service Plan",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Service Plan"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The service plan has been successfully obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "required": true,
                      "description": "ID of Service Plan"
                    },
                    "name": {
                      "type": "string",
                      "required": true,
                      "description": "Name of Service Plan"
                    },
                    "ratedeck": {
                      "type": "string",
                      "required": true,
                      "description": "Ratedeck of Service Plan"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The service plan is non-existent",
            "content": {}
          },
          "500": {
            "description": "The service plan could not be obtained",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Service Plans"
        ],
        "summary": "Service Plan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Service Plan"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The service plan has been successfully deleted",
            "content": {}
          },
          "404": {
            "description": "The service plan is non-existent",
            "content": {}
          },
          "500": {
            "description": "The service plan could not be deleted",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Service Plans"
        ],
        "summary": "Service Plan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Service Plan"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of Service Plan",
                    "required": true
                  },
                  "ratedeck": {
                    "type": "string",
                    "description": "Ratedeck to assign to the service plan"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The service plan has been successfully updated",
            "content": {}
          },
          "400": {
            "description": "The service plan could not be edited. The information sent is incorrect.",
            "content": {}
          },
          "404": {
            "description": "The service plan is non-existent",
            "content": {}
          },
          "500": {
            "description": "The service plan could not be edited",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/service_plans": {
      "get": {
        "tags": [
          "Service Plans"
        ],
        "summary": "LIST Account Service Plans",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list of service plans has been successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "required": true,
                        "description": "ID of Service Plan"
                      },
                      "name": {
                        "type": "string",
                        "required": true,
                        "description": "Name of Service Plan"
                      },
                      "ratedeck": {
                        "type": "string",
                        "required": true,
                        "description": "Ratedeck of Service Plan"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The list of service plans could not be retrieved.",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Service Plans"
        ],
        "summary": "CREATE Service Plan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "string",
                    "description": "ID of Service Plan",
                    "required": true
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of Service Plan",
                    "required": true
                  },
                  "ratedeck": {
                    "type": "string",
                    "description": "Ratedeck to assign to the service plan"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The service plan has been created successfully.",
            "content": {}
          },
          "400": {
            "description": "The service plan could not be created. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The service plan could not be created",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ratedecks/{ratedeck}/{number}/rate": {
      "get": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "GET Number Assigned Rate Data",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Ratedeck ID"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "number",
              "description": "Number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The information of the rate assigned to the number has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Base-Cost": {
                      "type": "number",
                      "format": "float"
                    },
                    "E164-Number": {
                      "type": "string"
                    },
                    "Prefix": {
                      "type": "number"
                    },
                    "Rate": {
                      "type": "string"
                    },
                    "Rate-Description": {
                      "type": "string"
                    },
                    "Rate-Increment": {
                      "type": "number"
                    },
                    "Rate-Minimum": {
                      "type": "string"
                    },
                    "Rate-Name": {
                      "type": "string"
                    },
                    "Ratedeck-ID": {
                      "type": "string"
                    },
                    "Surcharge": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The information of the assigned rate could not be obtained. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The information of the assigned rate could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ratedecks/status/{task}": {
      "get": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "GET Ratedeck Creation Status",
        "parameters": [
          {
            "in": "path",
            "name": "task",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Task ID. It allows us to check the status of the creation process"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task status has been successfully obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "Task Status. [success, executing, error]",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The status of the task could not be obtained. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The status of the task could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ratedecks/{ratedeck}": {
      "delete": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "DELETE Ratedeck",
        "description": "DELETE Ratedeck database with all rates assigned",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of Ratedeck"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The ratedeck has been successfully removed",
            "content": {}
          },
          "400": {
            "description": "The ratedeck could not be removed. The ratedeck parameter is not present in the URL.",
            "content": {}
          },
          "404": {
            "description": "The ratedeck could not be removed. The specified ratedeck is non-existent",
            "content": {}
          },
          "500": {
            "description": "The ratedeck could not be removed.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ratedecks/{ratedeck}/rates/{rate}": {
      "get": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "GET a Rate",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of Ratedeck"
            }
          },
          {
            "in": "path",
            "name": "rate",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Rate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The rate has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rate"
                }
              }
            }
          },
          "400": {
            "description": "The rate has been obtained successfully. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The rate could not be obtained",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "DELETE a Rate",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of Ratedeck"
            }
          },
          {
            "in": "path",
            "name": "rate",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Rate"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The rate has been deleted successfully",
            "content": {}
          },
          "400": {
            "description": "The rate could not be deleted. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The rate could not be deleted",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "UPDATE a Rate",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of Ratedeck"
            }
          },
          {
            "in": "path",
            "name": "rate",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of Rate"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The rate has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "The rate could not be updated. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The rate could not be updated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ratedecks/{ratedeck}/rates": {
      "post": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "CREATE a Rate",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of Ratedeck"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddRate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rate has been created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rate"
                }
              }
            }
          },
          "400": {
            "description": "The rate could not be created. The ratedeck parameter is not present",
            "content": {}
          },
          "500": {
            "description": "The rate could not be created.",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "GET Rates List of Specified Ratedeck",
        "parameters": [
          {
            "in": "path",
            "name": "ratedeck",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of Ratedeck"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Indicates the limit of the number of rates that will be returned as a response",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "nextStartKey",
            "in": "query",
            "description": "Indicate from which rate will be listed as response",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list of rates has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rates": {
                      "$ref": "#/components/schemas/RatesList"
                    },
                    "next_start_key": {
                      "type": "string",
                      "description": "Indicate from which rate will be listed as response",
                      "required": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The list of rates could not be obtained. The ratedeck parameter is not present",
            "content": {}
          },
          "404": {
            "description": "The list of rates could not be obtained. The specified ratedeck is non-existent",
            "content": {}
          },
          "500": {
            "description": "The list of rates could not be obtained.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ratedecks": {
      "post": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "Upload Ratedeck CSV",
        "description": "From the CSV file the ratedeck will be created",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "ratedeck": {
                    "type": "string",
                    "format": "binary",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The ratedeck is being created. Creation has not finished yet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "task_id": {
                      "type": "string",
                      "description": "Represents the ID of the task that is still running for the creation of the ratedeck"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "The ratedeck has been created successfully.",
            "content": {}
          },
          "400": {
            "description": "The ratedeck could not be created. The information sent is invalid.",
            "content": {}
          },
          "500": {
            "description": "The ratedeck could not be created.",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Ratedecks"
        ],
        "summary": "GET Ratedecks Names List",
        "responses": {
          "200": {
            "description": "The list of ratedecks has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "Name of Ratedeck"
                  }
                }
              }
            }
          },
          "500": {
            "description": "The list of ratedecks could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/numbers": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Users with Associated Numbers",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list of users with associated numbers has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersNumbersList"
                }
              }
            }
          },
          "500": {
            "description": "The list of associated numbers could not be obtained"
          }
        }
      }
    },
    "/api/v2/config/users/{id}/enabled": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "User Activation Status",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "User has been successfully activated"
          },
          "500": {
            "description": "User could not be activated"
          }
        }
      }
    },
    "/api/v2/config/users/{id}/disabled": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "User Activation Status",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "User has been successfully disabled"
          },
          "500": {
            "description": "User could not be disabled"
          }
        }
      }
    },
    "/api/v2/config/extension/valid": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Users"
        ],
        "summary": "EXTENSION VALIDATION",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "extension",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Extension has been validated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "boolean",
                      "description": "Represents if the specified extension is valid",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Extension could not be validated. The query extension parameter is not present",
            "content": {}
          },
          "500": {
            "description": "Extension could not be validated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/username/valid": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "USERNAME VALIDATION",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Username has been validated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "boolean",
                      "description": "Represents if the specified username is valid",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Username could not be validated. The query username parameter is not present",
            "content": {}
          },
          "500": {
            "description": "Username could not be validated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}/password": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "MODIFY User Password",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "User's ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "description": "It must contain a length of 2 elements. [MD5_HASH, SHA1_HASH]",
                    "required": true,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "User password has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "The user's password could not be updated. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The user's password could not be updated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}/tags": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update user's tags",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "User's ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tags": {
                    "type": "array",
                    "description": "Updated list of tags.",
                    "required": true,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "User tags have been updated successfully",
            "content": {}
          },
          "400": {
            "description": "The user's tags could not be updated. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The user's tags could not be updated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/tags/bulk": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update users' tags",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "description": "list of ids with their updated tags.",
                    "required": true,
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "description": "user's id",
                          "type": "string",
                          "required": true
                        },
                        "tags": {
                          "type": "array",
                          "description": "Updated list of tags.",
                          "required": true,
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "All users tags has been updated successfully",
            "content": {}
          },
          "207": {
            "description": "Some users' tags couldn't be updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "id uf users whose tags coulnd't be updated."
                  }
                }
              }
            }
          },
          "400": {
            "description": "The user's tags could not be updated. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The user's tags could not be updated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}/numbers": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Assign numbers to user",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "required": true,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Numbers assigned to user successfully.",
            "content": {}
          },
          "400": {
            "description": "Bad request.",
            "content": {}
          },
          "500": {
            "description": "Numbers could not be assigned due to internal error.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/{id}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "User",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {},
            "description": "User has been successfully removed"
          },
          "500": {
            "content": {},
            "description": "The user could not be deleted"
          }
        }
      },
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "User",
        "description": "GET User Data (enabled, firstname, lastname, email, level)",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User has been successfully obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true
                    },
                    "first_name": {
                      "type": "string",
                      "required": true
                    },
                    "last_name": {
                      "type": "string",
                      "required": true
                    },
                    "email": {
                      "type": "string",
                      "required": true
                    },
                    "username": {
                      "type": "string",
                      "required": true
                    },
                    "level": {
                      "type": "string",
                      "required": true,
                      "description": "user role (user or admin)"
                    },
                    "extension": {
                      "type": "string",
                      "required": true,
                      "description": "user extension"
                    },
                    "include_in_directory": {
                      "type": "boolean",
                      "required": true,
                      "description": "Indicates if the user is included in the company directory"
                    },
                    "conferencing": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "required": true,
                          "description": "enabled user conference room"
                        },
                        "number": {
                          "type": "string",
                          "required": false,
                          "description": "user conference room number"
                        },
                        "pin": {
                          "type": "string",
                          "required": false,
                          "description": "user conference members pin"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The user specified in the path is non-existent",
            "content": {}
          },
          "500": {
            "description": "The user could not be obtained",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "UPDATE User",
        "description": "Update a user. Enabled, first name, last name, email, role...",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of User"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true
                  },
                  "first_name": {
                    "type": "string",
                    "required": true
                  },
                  "last_name": {
                    "type": "string",
                    "required": true
                  },
                  "email": {
                    "type": "string",
                    "required": true
                  },
                  "level": {
                    "type": "string",
                    "required": true,
                    "description": "user role (user or admin)"
                  },
                  "is_operator": {
                    "type": "boolean",
                    "required": true
                  },
                  "conference": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "required": true
                      },
                      "pin": {
                        "type": "string",
                        "required": false
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "User has been edited successfully",
            "content": {}
          },
          "400": {
            "description": "The user could not be edited. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The user could not be edited",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/by_username/{username}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "DELETE User",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "username",
            "required": true,
            "schema": {
              "type": "string",
              "description": "username of User"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {},
            "description": "User has been successfully removed"
          },
          "500": {
            "content": {},
            "description": "The user could not be deleted"
          }
        }
      }
    },
    "/api/v2/config/users/bulk": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Bulk Creation of Users",
        "description": "Bulk creation of users based on csv file",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "users": {
                    "format": "binary",
                    "required": true,
                    "description": "CSV File"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All users were created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUsersCreationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Request body is incorrect. The CSV file has not been sent successfully",
            "content": {}
          },
          "500": {
            "description": "Some users could not be created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUsersCreationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/users": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Users"
        ],
        "summary": "CREATE New User",
        "description": "Perform all the actions necessary for user creation (document generation, vmbox, callflow)",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "required": true
                  },
                  "last_name": {
                    "type": "string",
                    "required": true
                  },
                  "email": {
                    "type": "string",
                    "required": true
                  },
                  "level": {
                    "type": "string",
                    "required": true,
                    "description": "user role (user or admin)"
                  },
                  "password": {
                    "type": "string",
                    "required": true
                  },
                  "extension": {
                    "type": "string",
                    "required": true
                  },
                  "send_credentials": {
                    "type": "boolean",
                    "required": true
                  },
                  "include_in_directory": {
                    "type": "boolean",
                    "required": true
                  },
                  "role_id": {
                    "type": "string",
                    "required": true
                  },
                  "is_operator": {
                    "type": "boolean",
                    "required": true
                  },
                  "conference": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "required": true
                      },
                      "pin": {
                        "type": "string",
                        "required": false
                      }
                    }
                  },
                  "feature_plan": {
                    "type": "string",
                    "required": false,
                    "description": "ID of the feature plan the user is assigned to"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User creation has been completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "description": "Created user ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The user could not be created. The information sent is invalid",
            "content": {}
          },
          "500": {
            "description": "User creation could not be completed",
            "content": {}
          }
        }
      },
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Users"
        ],
        "summary": "Users List",
        "description": "Returns the list of users for the account specified in the X-Account-ID header. Each user has the essential information + the status of enablement...",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User list has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersSummary"
                }
              }
            }
          },
          "500": {
            "description": "Users list could not be obtained"
          }
        }
      }
    },
    "/api/v2/config/users/history": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Users Historical Data",
        "operationId": "GetUsersHistoricalData",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Users historical data was obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersHistoricalDataSummary"
                }
              }
            }
          },
          "401": {
            "description": "Users historical data could not be obtained. Unauthorized",
            "content": {}
          },
          "500": {
            "description": "Users historical data could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/users/history/csv": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Users Historical Data CSV",
        "operationId": "GetUsersHistoricalDataCSV",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Users historical data csv file was obtained successfully",
            "content": {
              "text/csv": {}
            }
          },
          "401": {
            "description": "Users historical data could not be obtained. Unauthorized",
            "content": {}
          },
          "500": {
            "description": "Users historical data could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/call_recording": {
      "get": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Call Recording Status",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Information about Call Recording has been successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallRecordingData"
                }
              }
            }
          },
          "500": {
            "description": "Information about Call Recording could not be obtained"
          }
        }
      },
      "put": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Call Recording Configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "account_mode"
                ],
                "properties": {
                  "account_mode": {
                    "type": "boolean"
                  },
                  "outbound_onnet": {
                    "type": "boolean"
                  },
                  "outbound_offnet": {
                    "type": "boolean"
                  },
                  "inbound_onnet": {
                    "type": "boolean"
                  },
                  "inbound_offnet": {
                    "type": "boolean"
                  },
                  "edited_users": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/EditCallRecordingUserData"
                    }
                  },
                  "is_filename_custom": {
                    "type": "boolean"
                  },
                  "custom_filename": {
                    "type": "string"
                  },
                  "enable_recording_per_user": {
                    "type": "boolean"
                  },
                  "encryption": {
                    "type": "object",
                    "description": "HIPAA compliant encryption configuration for recordings",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": "Whether encryption is enabled",
                        "default": false
                      },
                      "algorithm": {
                        "type": "string",
                        "description": "Encryption algorithm to use",
                        "default": "AES-256-GCM"
                      },
                      "key_version": {
                        "type": "integer",
                        "description": "Version of the encryption key",
                        "default": 1
                      },
                      "key_id": {
                        "type": "string",
                        "description": "Unique identifier for the encryption key",
                        "default": "key_1234567890"
                      },
                      "salt": {
                        "type": "string",
                        "description": "Base64 encoded salt for encryption",
                        "default": "base64-encoded-salt"
                      },
                      "encrypted_key": {
                        "type": "string",
                        "description": "Encrypted account-specific key",
                        "default": "encrypted-account-specific-key"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Information about Call Recording has been updated successfully"
          },
          "500": {
            "description": "Information about Call Recording could not be updated"
          }
        }
      }
    },
    "/api/v2/config/call_recording/mode/account": {
      "get": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Call Recording Account Configuration",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Information about Call Recording Account has been successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallRecordingAccountModeData"
                }
              }
            }
          },
          "500": {
            "description": "Information about Call Recording Account could not be obtained"
          }
        }
      }
    },
    "/api/v2/config/call_recording/mode/per_user": {
      "get": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Call Recording Users Configuration",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list of users with the call recording information has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallRecordingUsersData"
                }
              }
            }
          },
          "500": {
            "description": "The list of users with the call recording information could not be obtained"
          }
        }
      }
    },
    "/api/v2/config/call_recording/encryption": {
      "get": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Get encryption configuration",
        "description": "Retrieves the current encryption configuration for call recordings.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Encryption configuration retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "Whether encryption is enabled"
                        },
                        "algorithm": {
                          "type": "string",
                          "description": "Encryption algorithm used"
                        },
                        "key_version": {
                          "type": "integer",
                          "description": "Version of the encryption key"
                        },
                        "key_id": {
                          "type": "string",
                          "description": "Unique identifier for the encryption key"
                        },
                        "salt": {
                          "type": "string",
                          "description": "Base64 encoded salt for encryption"
                        },
                        "encrypted_key": {
                          "type": "string",
                          "description": "Encrypted account-specific key"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Failed to retrieve encryption configuration"
          }
        }
      }
    },
    "/api/v2/config/call_recording/encryption/configure": {
      "put": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Configure encryption settings",
        "description": "Updates the encryption configuration for call recordings. This endpoint allows you to enable or disable encryption\nand configure encryption parameters.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether to enable encryption for call recordings",
                    "example": false
                  },
                  "algorithm": {
                    "type": "string",
                    "description": "Encryption algorithm to use (optional, defaults to AES-256-GCM)",
                    "example": "AES-256-GCM"
                  },
                  "key_version": {
                    "type": "integer",
                    "description": "Version of the encryption key (optional, defaults to 1)",
                    "example": 1
                  },
                  "key_id": {
                    "type": "string",
                    "description": "Unique identifier for the encryption key (optional)",
                    "example": "key_default"
                  },
                  "salt": {
                    "type": "string",
                    "description": "Base64 encoded salt for encryption (optional)",
                    "example": "default_salt"
                  },
                  "encrypted_key": {
                    "type": "string",
                    "description": "Encrypted account-specific key (optional)",
                    "example": "default_encrypted_key"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Encryption configuration updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Encryption configuration updated successfully"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "algorithm": {
                          "type": "string"
                        },
                        "key_version": {
                          "type": "integer"
                        },
                        "key_id": {
                          "type": "string"
                        },
                        "salt": {
                          "type": "string"
                        },
                        "encrypted_key": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request format"
          },
          "500": {
            "description": "Failed to update encryption configuration"
          }
        }
      }
    },
    "/api/v2/config/account/autoprovision/mobile/codecs": {
      "put": {
        "tags": [
          "Autoprovision"
        ],
        "summary": "UCP Mobile Codecs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "audio",
                  "video"
                ],
                "type": "object",
                "properties": {
                  "audio": {
                    "type": "array",
                    "description": "UCP Mobile audio codecs list",
                    "items": {
                      "type": "string"
                    }
                  },
                  "video": {
                    "type": "array",
                    "description": "UCP Mobile video codecs list",
                    "items": {
                      "type": "string"
                    }
                  },
                  "transport": {
                    "type": "string",
                    "description": "UCP Mobile transport. [udp | tcp]",
                    "default": "tcp"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The UCP mobile codecs lists have been successfully updated"
          },
          "400": {
            "description": "The information sent is not valid (empty list of audio codecs)"
          },
          "500": {
            "description": "The UCP Mobile codecs lists could not be updated."
          }
        }
      }
    },
    "/api/v2/config/account/autoprovision/ucp/codecs": {
      "put": {
        "tags": [
          "Autoprovision"
        ],
        "summary": "UCP Codecs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "codecs"
                ],
                "type": "object",
                "properties": {
                  "codecs": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Audio Codecs List"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The UCP codecs have been successfully updated."
          },
          "400": {
            "description": "The information sent is not valid (empty list of codecs)"
          },
          "500": {
            "description": "The UCP codecs could not be updated."
          }
        }
      }
    },
    "/api/v2/config/account/autoprovision/codecs": {
      "get": {
        "tags": [
          "Autoprovision"
        ],
        "summary": "Autoprovision Codecs",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Codecs have been successfully obtained.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAutoprovisionCodecs"
                }
              }
            }
          },
          "400": {
            "description": "Autoprovisioning is not enabled in UCP and in Mobile"
          },
          "500": {
            "description": "Codecs could not be obtained."
          }
        }
      }
    },
    "/api/v2/config/account/autoprovision/status": {
      "get": {
        "tags": [
          "Autoprovision"
        ],
        "summary": "Autoprovision Status",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Autoprovision status has been successfully obtained.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAutoprovisionStatus"
                }
              }
            }
          },
          "500": {
            "description": "Status of autoprovisioning could not be obtained."
          }
        }
      }
    },
    "/api/ucp/v2/account": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Information",
        "responses": {
          "200": {
            "description": "Account has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "500": {
            "description": "Account could not been obtained"
          }
        }
      }
    },
    "/api/v2/config/account/timezone": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Timezone",
        "responses": {
          "200": {
            "description": "Account time zone has been obtained.",
            "content": {
              "*/*": {
                "schema": {
                  "description": "Account Timezone",
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "The time zone could not be obtained.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins": {
      "get": {
        "tags": [
          "Pins"
        ],
        "summary": "Account Pins Information",
        "description": "The handler will access the document that the account gives using the X-ACCOUNT-ID heading and will give a response with the information found in the document.",
        "responses": {
          "200": {
            "description": "The pin information has been successfully obtained.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "enabled",
                    "mode",
                    "disa_from_ignore_prefixes",
                    "disa_to_ignore_prefixes",
                    "disa_ignore_trunks_ids",
                    "groups",
                    "pins_v2",
                    "enabled_user_ids"
                  ],
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "number",
                      "description": "Pins status (0 / 1)",
                      "default": 0,
                      "example": 1
                    },
                    "mode": {
                      "type": "string",
                      "description": "whitelisted or blacklisted",
                      "example": "whitelisted",
                      "default": "whitelisted"
                    },
                    "disa_from_ignore_prefixes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "default": []
                    },
                    "disa_to_ignore_prefixes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "default": []
                    },
                    "disa_ignore_trunk_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "List of trunk IDs to ignore",
                      "default": []
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PinGroup"
                      },
                      "default": []
                    },
                    "pins_v2": {
                      "type": "object",
                      "default": {},
                      "properties": {
                        "pin": {
                          "type": "object",
                          "description": "Pin Number",
                          "properties": {
                            "note": {
                              "type": "string",
                              "description": "Pin V2 Description"
                            },
                            "groups": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "List of Groups IDs"
                            },
                            "owner_id": {
                              "type": "string",
                              "description": "Optional Kazoo user ID that owns this PIN. When present, only that user can use the PIN; when absent the PIN is shared within the account."
                            }
                          }
                        }
                      }
                    },
                    "enable_user_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "List of user IDs that have Pins enabled.",
                      "default": []
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The information about Pins could not be obtained.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/users": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Users Pins State",
        "description": "Modify Pins state in users documents.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "enabled_user_ids"
                ],
                "type": "object",
                "properties": {
                  "enabled_user_ids": {
                    "description": "List of user IDs with pins enabled",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The pin status has been successfully updated for all users.",
            "content": {}
          },
          "500": {
            "description": "The pin status could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/v2": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Update Pins V2 Structure",
        "description": "Modify Pins V2 Structure into pins data structure within account document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "pins_v2"
                ],
                "type": "object",
                "properties": {
                  "pins_v2": {
                    "description": "Pins V2 Object",
                    "type": "object",
                    "properties": {
                      "pin": {
                        "description": "Pin V2 Fields (Note, Assigned Groups List and optional Owner)",
                        "type": "object",
                        "properties": {
                          "note": {
                            "required": false,
                            "description": "Pin V2 Note",
                            "type": "string"
                          },
                          "groups": {
                            "required": true,
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Pin V2 Assigned Groups IDs"
                          },
                          "owner_id": {
                            "required": false,
                            "type": "string",
                            "description": "Optional Kazoo user ID that owns this PIN. When it is new or differs from the owner already stored for this PIN and does not resolve to a user in the account, the request is rejected with 400. A PIN resent with its already-stored owner is not revalidated, so a PIN whose owner was deleted does not block saving the rest of the map."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Pins V2 Data was successfully updated.",
            "content": {}
          },
          "500": {
            "description": "Pins V2 Data could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/groups": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Update Pins Groups List",
        "description": "Modify List of Pins Groups into pins data structure within account document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "groups"
                ],
                "type": "object",
                "properties": {
                  "groups": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PinGroup"
                    },
                    "description": "List of Groups (Pin Groups Structure)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The List of pins groups was successfully updated.",
            "content": {}
          },
          "500": {
            "description": "The List of pins groups could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/trunks": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Update Ignored Trunks List",
        "description": "Modify ignored trunks IDs list into pins data structure within account document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "disa_ignore_trunk_ids"
                ],
                "type": "object",
                "properties": {
                  "disa_ignore_trunk_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of ignored trunks IDs"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The ignored trunks list was successfully updated.",
            "content": {}
          },
          "500": {
            "description": "The ignored trunks list could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/ignore": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Ignore Pins Lists",
        "description": "Modify ignored pin lists. disa_from_ignore_prefixes and disa_to_ignore_prefixes within the pin data structure in the account document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "disa_from_ignore_prefixes",
                  "disa_to_ignore_prefixes"
                ],
                "type": "object",
                "properties": {
                  "disa_from_ignore_prefixes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of ignored prefixes (From)"
                  },
                  "disa_to_ignore_prefixes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of ignored prefixes (To)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The ignored pins lists was successfully updated.",
            "content": {}
          },
          "500": {
            "description": "The ignored pins lists could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/mode": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Pins Mode",
        "description": "Modify the mode field within the pin data structure in the account document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "mode"
                ],
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "description": "Pins Mode (whitelisted or blacklisted)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The pin mode was successfully updated.",
            "content": {}
          },
          "500": {
            "description": "The pin mode could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/pins/state": {
      "put": {
        "tags": [
          "Pins"
        ],
        "summary": "Pins State",
        "description": "Modifying the enabled field within the document of the account specified in X-Account-ID.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "enabled"
                ],
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Pins Status Boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The pin status was successfully updated.",
            "content": {}
          },
          "500": {
            "description": "The pin status could not be updated.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/custom_callerid/users": {
      "patch": {
        "tags": [
          "Custom Caller ID"
        ],
        "summary": "Edit custom Caller ID information about users.",
        "description": "All the documents of the users sent in the request will be modified. Modifying the fields sent by each user (callerid_name, callerid_number)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditUsersCallerID"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The user Custom Caller ID information has been successfully updated."
          },
          "500": {
            "description": "The user Custom Caller ID information could not be updated"
          }
        }
      },
      "get": {
        "tags": [
          "Custom Caller ID"
        ],
        "summary": "Get custom Caller ID information about users.",
        "description": "All documents of the users of the account specified in the header are accessed. A summary of these users is returned in response (with callerid_name & callerid_number)",
        "responses": {
          "200": {
            "description": "Custom Caller ID data about users has been successfully obtained.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersCallerID"
                }
              }
            }
          },
          "500": {
            "description": "Custom Caller ID data about users could not be obtained."
          }
        }
      }
    },
    "/api/v2/config/custom_callerid/state": {
      "patch": {
        "tags": [
          "Custom Caller ID"
        ],
        "summary": "Custom Caller ID Status",
        "description": "Accessing the account document, only the status of Custom Caller ID will be modified.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "enabled"
                ],
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Represents the Custom Caller ID status change."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The Custom Caller ID status has been successfully changed within the account document."
          },
          "500": {
            "description": "The Custom Caller ID status could not be updated."
          }
        }
      },
      "get": {
        "tags": [
          "Custom Caller ID"
        ],
        "summary": "Custom Caller ID Status",
        "description": "Accessing the account document, the value of the status of custom caller ID is returned in response.",
        "responses": {
          "200": {
            "description": "Custom Caller ID status has been successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred while trying to get the status of Custom Caller ID."
          }
        }
      }
    },
    "/api/v2/config/onboard/images/selected": {
      "get": {
        "tags": [
          "Onboard Customization"
        ],
        "summary": "Selected Image",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The attached image has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image": {
                      "type": "string",
                      "description": "Represents the byte string of the attached image"
                    },
                    "extension": {
                      "type": "string",
                      "description": "Represents the extension of the selected image"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The attached image could not be obtained",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Onboard Customization"
        ],
        "summary": "Selected Image",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "image.svg",
                    "description": "The name of the file to be set as selected"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The selected image has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "The information sent in the body of the petition is not correct",
            "content": {}
          },
          "500": {
            "description": "The selected image could not be updated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/onboard/images": {
      "delete": {
        "tags": [
          "Onboard Customization"
        ],
        "summary": "Delete Images",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Image Name",
                      "example": "image.svg"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The images have been successfully deleted",
            "content": {}
          },
          "400": {
            "description": "The images could not be removed. The information sent is incorrect",
            "content": {}
          },
          "500": {
            "description": "The images could not be removed",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Onboard Customization"
        ],
        "summary": "Account Images",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The images have been successfully recovered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Image Filename"
                          },
                          "image": {
                            "type": "string",
                            "description": "Byte string representing the image"
                          }
                        }
                      }
                    },
                    "selected": {
                      "type": "string",
                      "description": "The file name of the selected image"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The images could not be recovered",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Onboard Customization"
        ],
        "summary": "Add photos to the list of photos available for the onboard site",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "attachment": {
                    "type": "string",
                    "format": "binary",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The image has been successfully saved",
            "content": {}
          },
          "400": {
            "description": "The image could not be stored. The file has not been sent in the correct format or the image limit has been reached",
            "content": {}
          },
          "500": {
            "description": "The image could not be stored.",
            "content": {}
          }
        }
      }
    },
    "/onboard/v1/reinvite": {
      "post": {
        "tags": [
          "Onboard"
        ],
        "summary": "User Reinvite",
        "description": "Sends an onboarding email to the user on the account without a valid token",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "account",
                  "email"
                ],
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The email of the user to invite",
                    "example": "john@doe.com"
                  },
                  "account": {
                    "type": "string",
                    "description": "The account name to use",
                    "example": "fonoUC"
                  }
                }
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "description": "Email was properly sent",
            "content": {}
          },
          "400": {
            "description": "Invalid request",
            "content": {}
          },
          "500": {
            "description": "Server error",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "email"
      }
    },
    "/api/v2/config/locations/{id}/users": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Obtain a summary of the list of users with information about their provisioning with the location",
        "description": "Taking the ID of the Location that arrives by parameters of the URL, a summary of the list of users belonging to the account will be returned, each user will contain a boolean that indicates if the user belongs to that location.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of Location"
          }
        ],
        "responses": {
          "200": {
            "description": "The information of the users about the location has been obtained correctly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersLocationData"
                }
              }
            }
          },
          "400": {
            "description": "The location ID is non-existent."
          },
          "500": {
            "description": "The information of the users about the location could not be obtained."
          }
        }
      }
    },
    "/api/v2/config/account/locations/exists": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Check if the account does not have locations yet",
        "description": "A boolean will be returned in response, indicating whether the account document has locations or not.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether or not locations exist has been determined.",
            "content": {
              "*/*": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "500": {
            "description": "Unable to determine if the account has Locations.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/locations": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Account Locations",
        "operationId": "getLocations",
        "responses": {
          "200": {
            "description": "Locations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Locations"
                }
              }
            }
          },
          "400": {
            "description": "Duplicated location name",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Locations"
        ],
        "summary": "New Location",
        "operationId": "createLocation",
        "requestBody": {
          "description": "Location object that needs to be added to the account",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationAddEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Location successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Duplicated location name",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/api/v2/config/location/{locationID}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Location",
        "operationId": "getLocation",
        "parameters": [
          {
            "name": "locationID",
            "in": "path",
            "description": "ID of location to get",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Valid location",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                }
              }
            }
          },
          "400": {
            "description": "Invalid ID supplied",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Location",
        "operationId": "updateLocation",
        "parameters": [
          {
            "name": "locationID",
            "in": "path",
            "description": "ID of location to update",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "requestBody": {
          "description": "Location object that needs to be edited",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationAddEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Location successfully updated",
            "content": {}
          },
          "400": {
            "description": "Invalid ID supplied",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "tags": [
          "Locations"
        ],
        "summary": "Location",
        "operationId": "deleteLocation",
        "parameters": [
          {
            "name": "locationID",
            "in": "path",
            "description": "ID of location to delete",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Location successfully deleted",
            "content": {}
          },
          "400": {
            "description": "Invalid ID supplied",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/location": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "User Location",
        "description": "Using the token sent in the Authorization header you access the user's location",
        "responses": {
          "200": {
            "description": "Location obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                }
              }
            }
          },
          "500": {
            "description": "Location could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/location/default/{locationID}": {
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Default Location",
        "operationId": "setDefaultLocation",
        "parameters": [
          {
            "name": "locationID",
            "in": "path",
            "description": "ID of location to set as default",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Location successfully set as default"
          },
          "400": {
            "description": "Invalid ID supplied",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/api/v2/config/locations/enabled": {
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Locations Enabled Status",
        "description": "Change enabled status from enabled to disabled or vice versa ",
        "operationId": "updateLocationEnabled",
        "requestBody": {
          "description": "Location object that needs to be edited",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Location status successfully updated",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/api/v2/config/locations/{locationID}/users": {
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Assign users to a location",
        "description": "Assign or remove users to/from a location",
        "operationId": "assignUsersToLocation",
        "parameters": [
          {
            "name": "locationID",
            "in": "path",
            "description": "ID of location to assign or remove users from / to",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "requestBody": {
          "description": "Location object that needs to be edited",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignUsers"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Users successfully assigned or removed from Location",
            "content": {}
          },
          "400": {
            "description": "Invalid ID supplied",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/api/v2/config/roles": {
      "get": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Access Roles",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access roles available for the account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRoles"
                }
              }
            }
          },
          "400": {
            "description": "Autoprovisioning is not enabled in UCP and in Mobile"
          },
          "500": {
            "description": "Codecs could not be obtained."
          }
        }
      }
    },
    "/api/v2/config/storage/{resource}": {
      "get": {
        "tags": [
          "Storage"
        ],
        "summary": "Storage Configuration",
        "description": "Get storage server configuration of a specified resource (CDRs, Recordings, etc.)",
        "parameters": [
          {
            "in": "path",
            "name": "resource",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the resource (cdrs, recordings, etc.)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Storage configuration has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageServerConfig"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Storage"
        ],
        "summary": "Storage Configuration",
        "description": "Update storage server configuration of a specified resource",
        "parameters": [
          {
            "in": "path",
            "name": "resource",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the resource (cdrs, recordings, etc.)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StorageServerConfig"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Storage configuration has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Storage"
        ],
        "summary": "Storage Configuration",
        "description": "Delete storage server configuration of a specified resource",
        "parameters": [
          {
            "in": "path",
            "name": "resource",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the resource (cdrs, recordings, etc.)"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Storage configuration has been deleted successfully",
            "content": {}
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/storage/google/oauth": {
      "get": {
        "tags": [
          "Storage"
        ],
        "summary": "Google OAuth URL",
        "description": "Gets the Google OAuth url needed to start the configuration process",
        "responses": {
          "200": {
            "description": "The Google OAuth url has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "required": true,
                      "description": "Google OAuth url"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The Google OAuth url could not be obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/reports/cdrs/all": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "All CDRs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "cdrs_all ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/cdrs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "CDRs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "cdrs ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/cdrs/upload": {
      "put": {
        "tags": [
          "Reports"
        ],
        "summary": "Upload CDRs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "cdrs_upload ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/cdrs/cdr/{id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "CDR by ID",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "cdr_id ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/recordings": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get a list of call recordings",
        "operationId": "getReconrdings",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start range date for recordings query. Unix timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End range date for recordings query. Unix timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Maximum number of recordings per page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "ID of the first recording of the page",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recordings metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Start date or End date can not be null",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Reports"
        ],
        "summary": "Delete recordings",
        "description": "Delete all recordings from the list",
        "operationId": "deleteRecordings",
        "requestBody": {
          "description": "List of recordings to delete",
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/DeleteRecordings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Recordings successfully deleted",
            "content": {}
          },
          "400": {
            "description": "Invalid body supplied",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/api/v2/reports/recordings/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get a list of call recordings as CSV file",
        "operationId": "getReconrdingsCSV",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start range date for recordings query. Unix timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End range date for recordings query. Unix timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recordings metadata",
            "content": {
              "text/csv": {}
            },
            "headers": {
              "Http-Header-Name": {
                "$ref": "#/components/headers/RecordingsResponse"
              }
            }
          },
          "400": {
            "description": "Start date or End date can not be null",
            "content": {}
          }
        }
      }
    },
    "/api/v2/reports/recordings/{recordingID}/document": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get recording document by ID",
        "description": "Retrieves the full recording document as JSON, excluding private CouchDB fields like \"_rev\", \"_id\", \"_deleted\", \"_revisions\", and \"_attachments\".\n\nThe response includes all recording metadata fields such as call information, timestamps, user data, and other recording properties.\n",
        "operationId": "getRecordingDocument",
        "parameters": [
          {
            "name": "recordingID",
            "in": "path",
            "description": "ID of the recording (format: YYYYMM-{uuid})\n",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "202510-3475fecb3c9ee9fbff6e797975a691da"
          }
        ],
        "responses": {
          "200": {
            "description": "Recording document successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Recording document with all fields except private CouchDB fields",
                  "properties": {
                    "call_id": {
                      "type": "string",
                      "description": "Call ID associated with the recording"
                    },
                    "callee_id_name": {
                      "type": "string",
                      "description": "Callee ID name"
                    },
                    "callee_id_number": {
                      "type": "string",
                      "description": "Callee ID number"
                    },
                    "caller_id_name": {
                      "type": "string",
                      "description": "Caller ID name"
                    },
                    "caller_id_number": {
                      "type": "string",
                      "description": "Caller ID number"
                    },
                    "cdr_id": {
                      "type": "string",
                      "description": "CDR ID associated with the recording"
                    },
                    "content_type": {
                      "type": "string",
                      "description": "Content type of the recording file"
                    },
                    "description": {
                      "type": "string",
                      "description": "Recording description"
                    },
                    "direction": {
                      "type": "string",
                      "description": "Call direction"
                    },
                    "duration": {
                      "type": "integer",
                      "description": "Recording duration in seconds"
                    },
                    "duration_ms": {
                      "type": "integer",
                      "description": "Recording duration in milliseconds"
                    },
                    "from": {
                      "type": "string",
                      "description": "Source number"
                    },
                    "interaction_id": {
                      "type": "string",
                      "description": "Interaction ID"
                    },
                    "media_source": {
                      "type": "string",
                      "description": "Media source"
                    },
                    "media_type": {
                      "type": "string",
                      "description": "Media type"
                    },
                    "name": {
                      "type": "string",
                      "description": "Recording filename"
                    },
                    "origin": {
                      "type": "string",
                      "description": "Call origin"
                    },
                    "owner_id": {
                      "type": "string",
                      "description": "Owner ID"
                    },
                    "request": {
                      "type": "string",
                      "description": "Request information"
                    },
                    "source_type": {
                      "type": "string",
                      "description": "Source type"
                    },
                    "start": {
                      "type": "integer",
                      "description": "Recording start timestamp"
                    },
                    "to": {
                      "type": "string",
                      "description": "Destination number"
                    },
                    "url": {
                      "type": "string",
                      "description": "Recording URL (if stored in GoREC)"
                    },
                    "pvt_account_id": {
                      "type": "string",
                      "description": "Account ID"
                    },
                    "pvt_account_db": {
                      "type": "string",
                      "description": "Account database name"
                    },
                    "pvt_created": {
                      "type": "integer",
                      "description": "Creation timestamp"
                    },
                    "pvt_modified": {
                      "type": "integer",
                      "description": "Modification timestamp"
                    },
                    "pvt_type": {
                      "type": "string",
                      "description": "Document type"
                    },
                    "pvt_node": {
                      "type": "string",
                      "description": "Node information"
                    },
                    "pvt_document_hash": {
                      "type": "string",
                      "description": "Document hash"
                    },
                    "fonoUC": {
                      "type": "object",
                      "description": "QVOICE Platform specific recording data",
                      "properties": {
                        "filename": {
                          "type": "string"
                        },
                        "storage": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "amazon": {
                          "type": "object"
                        },
                        "sftp": {
                          "type": "object"
                        },
                        "transcription": {
                          "type": "object"
                        }
                      }
                    },
                    "custom_channel_vars": {
                      "type": "object",
                      "description": "Custom channel variables"
                    }
                  }
                },
                "example": {
                  "call_id": "791b68a6-a807-4de0-b41b-577dba3c31ce",
                  "callee_id_name": "John Doe",
                  "callee_id_number": "+1234567890",
                  "caller_id_name": "Jane Smith",
                  "caller_id_number": "+0987654321",
                  "cdr_id": "202510-cdr-12345",
                  "content_type": "audio/mpeg",
                  "description": "Call recording",
                  "direction": "inbound",
                  "duration": 120,
                  "duration_ms": 120000,
                  "from": "+1234567890",
                  "interaction_id": "interaction-123",
                  "media_source": "local",
                  "media_type": "audio",
                  "name": "recording_1234567890.mp3",
                  "origin": "internal",
                  "owner_id": "user-123",
                  "request": "call-request",
                  "source_type": "call",
                  "start": 1699123456,
                  "to": "+0987654321",
                  "url": "",
                  "pvt_account_id": "account-123",
                  "pvt_account_db": "account_db",
                  "pvt_created": 1699123456,
                  "pvt_modified": 1699123500,
                  "pvt_type": "recording",
                  "pvt_node": "node1",
                  "pvt_document_hash": "abc123",
                  "fonoUC": {
                    "filename": "recording_1234567890.mp3",
                    "storage": [
                      "local"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid recording ID format",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Invalid media id"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - user not allowed to access this recording due to restriction policy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "You are not allowed to access this recording due to restriction policy."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recording document not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Recording doc not found: [202510-3475fecb3c9ee9fbff6e797975a691da]"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/recordings/{recordingID}/transcription": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "GET if specified recording has a transcription",
        "parameters": [
          {
            "name": "recordingID",
            "in": "path",
            "description": "ID of the recording",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The recording has been checked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "done": {
                      "type": "boolean",
                      "required": true,
                      "description": "Indicates whether the transcription has been made or not"
                    },
                    "provider": {
                      "type": "string",
                      "required": true,
                      "description": "Indicates the provider that made the transcription, it will be empty if the transcription was not made yet"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The recording could not be checked",
            "content": {}
          }
        }
      }
    },
    "/api/v2/reports/recordings/by_call_id/{call_id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get recording by call ID with fallback logic",
        "description": "Retrieves a call recording by call ID with intelligent fallback logic.\n\n**Process:**\n1. Receives call ID as parameter\n2. If call ID doesn't contain YYYYMM prefix, adds current year-month as default\n3. Searches for CDR and checks for multiple recordings in custom_channel_vars.media_recordings array\n4. If multiple recordings are found, returns all recordings as JSON with base64 encoded data\n5. If single recording is found, returns the recording file directly (backward compatible)\n6. If CDR doesn't have media_recording_id or recording doesn't exist or has no attachment,\n   searches for CDR using custom_channel_vars.bridge_id from current CDR\n7. Adds YYYYMM prefix to bridge_id and repeats the process\n\n**Response Format:**\n- **Single recording**: Returns the audio file directly (backward compatible)\n- **Multiple recordings**: Returns JSON with array of recordings, each containing:\n  - `id`: Recording ID\n  - `name`: Filename\n  - `content_type`: MIME type (e.g., \"audio/mpeg\")\n  - `data`: Base64 encoded audio data\n  - `size`: File size in bytes\n  - `caller_id_number`: From number on this recording\n  - `callee_id_number`: To number on this recording\n\n**Examples:**\n- `791b68a6-a807-4de0-b41b-577dba3c31ce` (will add current YYYYMM prefix)\n- `202510-791b68a6-a807-4de0-b41b-577dba3c31ce` (will use existing prefix)\n",
        "operationId": "getRecordingByCallIDWithFallback",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "description": "Call ID to search for recording. Can be with or without YYYYMM prefix.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "without_prefix": {
                "summary": "Call ID without prefix",
                "value": "791b68a6-a807-4de0-b41b-577dba3c31ce"
              },
              "with_prefix": {
                "summary": "Call ID with prefix",
                "value": "202510-791b68a6-a807-4de0-b41b-577dba3c31ce"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recording file(s) successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recordings": {
                      "type": "array",
                      "description": "Array of recordings (when multiple recordings are available)",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Recording ID",
                            "example": "202510-3475fecb3c9ee9fbff6e797975a691da"
                          },
                          "name": {
                            "type": "string",
                            "description": "Recording filename",
                            "example": "recording_1234567890.mp3"
                          },
                          "content_type": {
                            "type": "string",
                            "description": "MIME type of the recording",
                            "example": "audio/mpeg"
                          },
                          "data": {
                            "type": "string",
                            "description": "Base64 encoded audio data",
                            "example": "SUQzBAAAAAA..."
                          },
                          "size": {
                            "type": "integer",
                            "description": "File size in bytes",
                            "example": 1234567
                          },
                          "caller_id_number": {
                            "type": "string",
                            "description": "From number on this recording",
                            "example": "1441"
                          },
                          "callee_id_number": {
                            "type": "string",
                            "description": "To number on this recording",
                            "example": "14168882222"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "content_type",
                          "data",
                          "size"
                        ]
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "Total number of recordings returned",
                      "example": 2
                    }
                  }
                },
                "examples": {
                  "multiple_recordings": {
                    "summary": "Multiple recordings response",
                    "value": {
                      "recordings": [
                        {
                          "id": "202510-3475fecb3c9ee9fbff6e797975a691da",
                          "name": "recording1.mp3",
                          "content_type": "audio/mpeg",
                          "data": "SUQzBAAAAAA...",
                          "size": 1234567,
                          "caller_id_number": "1441",
                          "callee_id_number": "14168882222"
                        },
                        {
                          "id": "202510-6CvnOrrzw9Gno7A3w6te",
                          "name": "recording2.mp3",
                          "content_type": "audio/mpeg",
                          "data": "SUQzBAAAAAA...",
                          "size": 987654,
                          "caller_id_number": "1441",
                          "callee_id_number": "1002"
                        }
                      ],
                      "total": 2
                    }
                  }
                }
              },
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "description": "Single recording file (backward compatible)",
                "example": "Binary audio file content"
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "description": "Single recording file (backward compatible)",
                "example": "Binary audio file content"
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "description": "Single recording file (backward compatible)",
                "example": "Binary file content"
              }
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename (only for single recording)",
                "schema": {
                  "type": "string",
                  "example": "attachment; filename=recording_1234567890.mp3"
                }
              },
              "Content-Type": {
                "description": "MIME type of the recording (only for single recording) or application/json (for multiple recordings)",
                "schema": {
                  "type": "string",
                  "example": "audio/mpeg"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid call ID format",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "missing call_id parameter"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recording not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Recording not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/recordings/by_call_id/{call_id}/storage": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get recording storage servers by call ID with fallback logic",
        "description": "Retrieves storage server information for call recording(s) by call ID with intelligent fallback logic.\n\n**Process:**\n1. Receives call ID as parameter\n2. If call ID doesn't contain YYYYMM prefix, adds current year-month as default\n3. Searches for CDR and checks for multiple recordings in custom_channel_vars.media_recordings array\n4. If multiple recordings are found, returns storage info for all recordings\n5. If single recording is found, returns storage info for that recording (backward compatible)\n6. If CDR doesn't have media_recording_id or recording doesn't exist or has no attachment,\n   searches for CDR using custom_channel_vars.bridge_id from current CDR\n7. Adds YYYYMM prefix to bridge_id and repeats the process\n\n**Response Format:**\n- **Single recording**: `{\"servers\": [\"local\"]}` or `{\"servers\": [\"server1\", \"server2\", ...]}`\n- **Multiple recordings**: Returns JSON with array of recordings, each containing:\n  - `recording_id`: Recording ID\n  - `name`: Filename\n  - `servers`: Array of storage server names\n\n**Note:** If a recording fails to load, it will be skipped and the response will include only the successfully loaded recordings.\n",
        "operationId": "getRecordingStorageByCallID",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "description": "Call ID to search for recording. Can be with or without YYYYMM prefix.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "without_prefix": {
                "summary": "Call ID without prefix",
                "value": "791b68a6-a807-4de0-b41b-577dba3c31ce"
              },
              "with_prefix": {
                "summary": "Call ID with prefix",
                "value": "202510-791b68a6-a807-4de0-b41b-577dba3c31ce"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Storage servers information successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Single recording response (backward compatible)",
                      "properties": {
                        "servers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "List of storage servers where the recording is stored",
                          "examples": {
                            "local": {
                              "summary": "Local storage",
                              "value": [
                                "local"
                              ]
                            },
                            "gorec": {
                              "summary": "GoREC storage",
                              "value": [
                                "server1.example.com",
                                "server2.example.com"
                              ]
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "description": "Multiple recordings response",
                      "properties": {
                        "recordings": {
                          "type": "array",
                          "description": "Array of recordings with storage information",
                          "items": {
                            "type": "object",
                            "properties": {
                              "recording_id": {
                                "type": "string",
                                "description": "Recording ID",
                                "example": "202510-3475fecb3c9ee9fbff6e797975a691da"
                              },
                              "name": {
                                "type": "string",
                                "description": "Recording filename",
                                "example": "recording_1234567890.mp3"
                              },
                              "servers": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "List of storage servers where the recording is stored",
                                "example": [
                                  "local"
                                ]
                              }
                            },
                            "required": [
                              "recording_id",
                              "name",
                              "servers"
                            ]
                          }
                        },
                        "total": {
                          "type": "integer",
                          "description": "Total number of recordings returned",
                          "example": 2
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "single_recording": {
                    "summary": "Single recording (backward compatible)",
                    "value": {
                      "servers": [
                        "local"
                      ]
                    }
                  },
                  "multiple_recordings": {
                    "summary": "Multiple recordings",
                    "value": {
                      "recordings": [
                        {
                          "recording_id": "202510-3475fecb3c9ee9fbff6e797975a691da",
                          "name": "recording1.mp3",
                          "servers": [
                            "local"
                          ]
                        },
                        {
                          "recording_id": "202510-6CvnOrrzw9Gno7A3w6te",
                          "name": "recording2.mp3",
                          "servers": [
                            "server1.example.com",
                            "server2.example.com"
                          ]
                        }
                      ],
                      "total": 2
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid call ID format",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "missing call_id parameter"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recording not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Recording not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/recordings/by_call_id/{call_id}/transcription": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get recording transcription info by call ID with fallback logic",
        "description": "Retrieves transcription information for call recording(s) by call ID with intelligent fallback logic.\n\n**Process:**\n1. Receives call ID as parameter\n2. If call ID doesn't contain YYYYMM prefix, adds current year-month as default\n3. Searches for CDR and checks for multiple recordings in custom_channel_vars.media_recordings array\n4. If multiple recordings are found, returns transcription info for all recordings\n5. If single recording is found, returns transcription info for that recording (backward compatible)\n6. If CDR doesn't have media_recording_id or recording doesn't exist or has no attachment,\n   searches for CDR using custom_channel_vars.bridge_id from current CDR\n7. Adds YYYYMM prefix to bridge_id and repeats the process\n\n**Response Format:**\n- **Single recording**: `{\"done\": true, \"provider\": \"provider_name\"}` or `{\"done\": false, \"provider\": \"\"}`\n- **Multiple recordings**: Returns JSON with array of recordings, each containing:\n  - `recording_id`: Recording ID\n  - `name`: Filename\n  - `done`: Boolean indicating if transcription exists\n  - `provider`: Provider name (empty if no transcription)\n\n**Note:** If a recording fails to load, it will be skipped and the response will include only the successfully loaded recordings.\n",
        "operationId": "getRecordingTranscriptionByCallID",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "description": "Call ID to search for recording. Can be with or without YYYYMM prefix.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "without_prefix": {
                "summary": "Call ID without prefix",
                "value": "791b68a6-a807-4de0-b41b-577dba3c31ce"
              },
              "with_prefix": {
                "summary": "Call ID with prefix",
                "value": "202510-791b68a6-a807-4de0-b41b-577dba3c31ce"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transcription information successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Single recording response (backward compatible)",
                      "properties": {
                        "done": {
                          "type": "boolean",
                          "description": "Indicates whether the transcription has been made or not",
                          "example": true
                        },
                        "provider": {
                          "type": "string",
                          "description": "Indicates the provider that made the transcription, it will be empty if the transcription was not made yet",
                          "example": "deepgram"
                        }
                      },
                      "required": [
                        "done",
                        "provider"
                      ]
                    },
                    {
                      "type": "object",
                      "description": "Multiple recordings response",
                      "properties": {
                        "recordings": {
                          "type": "array",
                          "description": "Array of recordings with transcription information",
                          "items": {
                            "type": "object",
                            "properties": {
                              "recording_id": {
                                "type": "string",
                                "description": "Recording ID",
                                "example": "202510-3475fecb3c9ee9fbff6e797975a691da"
                              },
                              "name": {
                                "type": "string",
                                "description": "Recording filename",
                                "example": "recording_1234567890.mp3"
                              },
                              "done": {
                                "type": "boolean",
                                "description": "Indicates whether the transcription has been made or not",
                                "example": true
                              },
                              "provider": {
                                "type": "string",
                                "description": "Indicates the provider that made the transcription, it will be empty if the transcription was not made yet",
                                "example": "deepgram"
                              }
                            },
                            "required": [
                              "recording_id",
                              "name",
                              "done",
                              "provider"
                            ]
                          }
                        },
                        "total": {
                          "type": "integer",
                          "description": "Total number of recordings returned",
                          "example": 2
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "single_with_transcription": {
                    "summary": "Single recording with transcription (backward compatible)",
                    "value": {
                      "done": true,
                      "provider": "deepgram"
                    }
                  },
                  "single_without_transcription": {
                    "summary": "Single recording without transcription (backward compatible)",
                    "value": {
                      "done": false,
                      "provider": ""
                    }
                  },
                  "multiple_recordings": {
                    "summary": "Multiple recordings",
                    "value": {
                      "recordings": [
                        {
                          "recording_id": "202510-3475fecb3c9ee9fbff6e797975a691da",
                          "name": "recording1.mp3",
                          "done": true,
                          "provider": "deepgram"
                        },
                        {
                          "recording_id": "202510-6CvnOrrzw9Gno7A3w6te",
                          "name": "recording2.mp3",
                          "done": false,
                          "provider": ""
                        }
                      ],
                      "total": 2
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid call ID format",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "missing call_id parameter"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recording not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Recording not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/caller": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Caller Activity Report",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "caller ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/caller_stats": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Caller Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callerStats ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/caller_stats/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Caller Statistics CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/caller_stats/pdf": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Caller Statistics PDF",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/caller/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Caller Activity Report CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/user": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "User Call Recordings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "user ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/user_stats": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "User Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "userStats ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/user_stats/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "User Statistics CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/user_stats/pdf": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "User Statistics PDF",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/user/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "User Activity Report CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/phone_number": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Phone Number Activity Report",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "phoneNumber ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/phone_number_stats": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Phone Number Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "phoneNumberStats ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/phone_number_stats/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Phone Number Statistics CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/phone_number_stats/pdf": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Phone Number Statistics PDF",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/phone_number/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Phone Number Activity Report CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/siplogs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "SIP Logs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/users/mobile": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Users Mobile Data",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "users_mobile ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/dnd": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Users DND Usage Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "dnd ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/dnd/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Users DND Usage Statistics CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/user/{userID}/dnd": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "User DND Usage Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "per_user_dnd ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/campaigns/leads/history": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Campaigns Leads History",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "campaigns_leads_history ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/summary": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Summary",
        "operationId": "getAccountSummaryInformation",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to request info from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account information successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSummary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/address_required": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Address Required",
        "operationId": "getAccountAddressRequired",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to request info from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "True or False",
            "content": {
              "*/*": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied"
          }
        }
      }
    },
    "/api/v2/config/accounts": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Accounts"
        ],
        "summary": "New Account",
        "operationId": "createAccount",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "description": "Account information that needs to be added to the systeem",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCreation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Account successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "copy_failed": {
                      "type": "object",
                      "description": "A new location's copy scopes that failed (scope -> error). The account was created.",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "description": "What was set up only in part, such as location prefix links.",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          }
        }
      }
    },
    "/api/v2/config/accounts_paginated": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Accounts Paginated",
        "parameters": [
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts paginated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "nextStartKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts/summary": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Accounts Summary",
        "operationId": "getAllAccountsSummaryInformation",
        "responses": {
          "200": {
            "description": "Account information successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsSummary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts_own": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Account Descendants",
        "responses": {
          "200": {
            "description": "Account information successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsDescendants"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/accounts/immediate_children": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Account Immediate Children",
        "responses": {
          "200": {
            "description": "Fetch immediate children of an account",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsChildren"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account/valid_address": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Valid Address",
        "operationId": "getAccountValidAddress",
        "responses": {
          "200": {
            "description": "Account valid address successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/edition": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Edition",
        "operationId": "getAccountEdition",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to get information from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account information successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountCreationEdition"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied"
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Account Edition",
        "operationId": "putAccountEdition",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to edit information",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account information successfully edited",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountCreationEdition"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/ucp/v2/voicemail/audio/{mediaID}": {
      "get": {
        "tags": [
          "Voicemail"
        ],
        "summary": "Voicemail Audio",
        "operationId": "getVoicemailAudio",
        "parameters": [
          {
            "name": "mediaID",
            "in": "path",
            "description": "ID of voicemail to get audio",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "audio mp3 file",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/voicemail/audio/{mediaID}/transcription": {
      "get": {
        "tags": [
          "Voicemail"
        ],
        "summary": "Voicemail Transcription Status",
        "parameters": [
          {
            "name": "mediaID",
            "in": "path",
            "description": "ID of the voicemail",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The voicemail has been checked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "done": {
                      "type": "boolean",
                      "required": true,
                      "description": "Indicates whether the transcription has been made or not"
                    },
                    "provider": {
                      "type": "string",
                      "required": true,
                      "description": "Indicates the provider that made the transcription, it will be empty if the transcription was not made yet"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The voicemail could not be checked",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account/trunks": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Trunks",
        "operationId": "getAccountTrunks",
        "responses": {
          "200": {
            "description": "Account information successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Trunks"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/route/{route}": {
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Route to Trunk",
        "operationId": "allow",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to update route to trunk",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          },
          {
            "name": "route",
            "in": "path",
            "description": "local or parent",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account route to trunk successfully updated"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/call_recording": {
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Call Recording Feature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of account to update Call Recording feature status"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true,
                    "description": "Call Recording feature status"
                  },
                  "retention_duration": {
                    "type": "number",
                    "required": false,
                    "description": "Max number of days that the recordings will be stored in local database"
                  },
                  "size_limit": {
                    "type": "number",
                    "required": false,
                    "description": "Max disk size in MB that will be used to store recordings"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Status of Call Recording feature has been updated",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/sms": {
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "SMS Feature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of account to set SMS feature"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true,
                    "description": "SMS Feature Status"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Status of SMS feature has been updated",
            "content": {}
          },
          "500": {
            "description": "Status of SMS feature could not be updated",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/callcenter": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Call Center Feature",
        "operationId": "getCallcenterFeature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to set callcenter feature",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Callcenter feature enabled/disabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Call Center Feature",
        "operationId": "updateCallcenterFeature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to set callcenter feature",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Callcenter feature enabled/disabled"
          },
          "400": {
            "description": "Invalid request"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/integrations": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Integrations Feature",
        "operationId": "getIntegrationsFeatureStatus",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to get integrations feature status",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Integrations feature enabled/disabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "google": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    },
                    "microsoft": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Integrations Feature",
        "operationId": "setIntegrationsFeature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to set callcenter feature",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "google": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  },
                  "microsoft": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Integrations feature enabled/disabled"
          },
          "400": {
            "description": "Invalid request"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/transcription": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Transcription Feature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to get transcription feature status",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account transcription feature configuration has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "recordings": {
                          "type": "object",
                          "properties": {
                            "auto": {
                              "type": "boolean",
                              "required": false,
                              "description": "Indicates whether auto transcription processing for recordings is enabled or not"
                            }
                          }
                        },
                        "voicemails": {
                          "type": "object",
                          "properties": {
                            "auto": {
                              "type": "boolean",
                              "required": false,
                              "description": "Indicates whether auto transcription processing for voicemails is enabled or not"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "There is no transcription provider configured"
          },
          "500": {
            "description": "Account transcription feature status could not be obtained"
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Transcription Feature",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to get transcription feature status",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "recordings": {
                        "type": "object",
                        "properties": {
                          "auto": {
                            "type": "boolean",
                            "required": false,
                            "description": "Indicates whether auto transcription processing for recordings is enabled or not"
                          }
                        }
                      },
                      "voicemails": {
                        "type": "object",
                        "properties": {
                          "auto": {
                            "type": "boolean",
                            "required": false,
                            "description": "Indicates whether auto transcription processing for voicemails is enabled or not"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Account transcription feature status has been updated"
          },
          "403": {
            "description": "There is no transcription provider configured"
          },
          "500": {
            "description": "Account transcription feature status could not be updated"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Complete Information",
        "responses": {
          "200": {
            "description": "Account information has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Account information has not been obtained",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/account": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account Complete Information",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of account to request info from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "No error occurred while trying to get accounts' info.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Account's info"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Account information has not been obtained",
            "content": {}
          }
        }
      }
    },
    "/media": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "Available Media",
        "operationId": "getMedia",
        "responses": {
          "200": {
            "description": "Account information successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of media file"
                    },
                    "name": {
                      "type": "string",
                      "description": "name of media file"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mobile/v2/deeplink/{cloudID}": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "summary": "Mobile App Information",
        "operationId": "mobileDeviceLogin",
        "parameters": [
          {
            "name": "cloudID",
            "in": "path",
            "description": "app cloud ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "username",
            "in": "query",
            "description": "username",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "password",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "description": "Account name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mobile login information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileAppData"
                }
              }
            }
          },
          "400": {
            "description": "Invalid token ID supplied"
          }
        }
      }
    },
    "/mobile/v2/provisioning/cloud_softphone": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "summary": "Get Mobile provisioning information",
        "operationId": "mobileDeviceProvisioning",
        "parameters": [
          {
            "name": "cloud_username",
            "in": "query",
            "description": "username",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cloud_password",
            "in": "query",
            "description": "password",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mobile provisioning information",
            "content": {
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/account"
                }
              }
            }
          },
          "400": {
            "description": "Invalid token ID supplied"
          }
        }
      }
    },
    "/mobile/v2/provisioning/cloud_softphone/directory": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "summary": "Get user directory contact information",
        "operationId": "mobileDirectoryProvisioning",
        "parameters": [
          {
            "name": "cloud_username",
            "in": "query",
            "description": "username",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cloud_password",
            "in": "query",
            "description": "password",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mobile user directory information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileContacts"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          }
        }
      }
    },
    "/mobile/v2/onboard/deeplink": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "summary": "Get Mobile deeplink",
        "operationId": "mobileGetDeepLink",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "description": "user ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cloudId",
            "in": "query",
            "description": "app cloud ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Customer name to allow to authenticate users from another customer DB",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mobile Deeplink"
          },
          "400": {
            "description": "Invalid user ID or cloud ID supplied"
          }
        }
      }
    },
    "/mobile/v2/device/{tokenID}": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "summary": "Get device  information",
        "operationId": "mobileDeviceGet",
        "parameters": [
          {
            "name": "tokenID",
            "in": "path",
            "description": "Token ID of device to get information from",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Device information successfully provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MobileDevice"
                }
              }
            }
          },
          "400": {
            "description": "Invalid token ID supplied"
          }
        }
      }
    },
    "/mobile/v2/device": {
      "put": {
        "tags": [
          "Mobile"
        ],
        "summary": "Allow to update mobile device information",
        "description": "Receives a JSON doc with mobile device information",
        "operationId": "mobileDeviceEdit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileDevice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Mobile device properly updated"
          },
          "400": {
            "description": "Invalid request"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/ucp/v2/did_numbers": {
      "get": {
        "tags": [
          "DidNumbers"
        ],
        "summary": "User DID Numbers",
        "responses": {
          "200": {
            "description": "User DID Numbers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DidNumbers"
                }
              }
            }
          }
        }
      }
    },
    "/api/ucp/v2/main_numbers": {
      "get": {
        "tags": [
          "MainNumbers"
        ],
        "summary": "Account Main Numbers",
        "responses": {
          "200": {
            "description": "Account Main Numbers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MainNumbers"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/numbers/{accountID}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Numbers"
        ],
        "summary": "System Numbers Information",
        "operationId": "getNumbers",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to get numbers from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Numbers information successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Numbers"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied"
          }
        }
      },
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Numbers"
        ],
        "summary": "Add Phone Numbers",
        "operationId": "addNumbers",
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "description": "ID of account to get numbers from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Numbers to be created",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "new numbers"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Numbers successfully created",
            "content": {}
          },
          "400": {
            "description": "Invalid numbers supplied"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/numbers/free": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Free Numbers",
        "operationId": "getFreeNumbers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeNumbers"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/numbers/{number}/sms/free": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Free SMS Number Check",
        "operationId": "CheckIfNumberIsSMSFree",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "number",
            "in": "path",
            "description": "Phone number",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "free": {
                      "type": "boolean",
                      "description": "Indicates if specified phone number is free sms or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Phone number has not been specified",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/numbers": {
      "delete": {
        "tags": [
          "Numbers"
        ],
        "summary": "Delete phone numbers from system",
        "operationId": "deleteNumbers",
        "requestBody": {
          "description": "Numbers to be deleted",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "numbers to delete"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Numbers successfully deleted",
            "content": {}
          },
          "400": {
            "description": "Invalid numbers supplied"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/numbers/db/sync": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Sync phone numbers in system",
        "operationId": "syncNumbers",
        "responses": {
          "204": {
            "description": "Numbers successfully synchronized",
            "content": {}
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/number/{phoneNumber}": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Get system number information",
        "operationId": "getNumber",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "path",
            "description": "phone number to get information from",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Number information successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Number"
                }
              }
            }
          },
          "400": {
            "description": "Invalid number ID supplied"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Edit system number CID information",
        "operationId": "editNumber",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "path",
            "description": "phone number to update",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Number CID information to be edited",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumberCID"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Number CIDinformation successfully updated",
            "content": {}
          },
          "400": {
            "description": "Invalid number ID supplied"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/locations/numbers": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Get system numbers that are not assigned to any location",
        "operationId": "getNumbersLocationsFree",
        "responses": {
          "200": {
            "description": "Numbers successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "available numbers"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied"
          }
        }
      }
    },
    "/api/v2/config/locations/{locationID}/numbers": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Get system numbers that are not assigned to any location besides numbers assigned to this location",
        "operationId": "getNumbersAvailableForThisLocation",
        "parameters": [
          {
            "name": "locationID",
            "in": "path",
            "description": "ID of location requesting information from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Numbers successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "available numbers"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied"
          }
        }
      }
    },
    "/api/v2/onboard/users/sms": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Invite users to system sending a SMS",
        "operationId": "inviteUserSMS",
        "requestBody": {
          "description": "User IDs to be invited",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "User IDs to be invited"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "SMS sent to users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        }
      }
    },
    "/api/v2/users": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "send a email invitation to specified users.",
        "requestBody": {
          "description": "User IDs to be invited",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "User IDs to be invited"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Invitations sent successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Couldn't process request."
          }
        }
      }
    },
    "/api/v2/users/onboardURL/{user_id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "generates the invite URL for an admin to impersonate another user without knowing their password",
        "operationId": "GenerateInviteURL",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "ID of user to impersonate",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "URL successfully provided",
            "content": {
              "text/html": {
                "type": "string"
              }
            }
          },
          "400": {
            "description": "User is disabled, not generating onboard url"
          },
          "500": {
            "description": "Couldn't complete request."
          }
        }
      }
    },
    "/api/v2/config/user/role": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "User Role",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access Role associated to logged in user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRole"
                }
              }
            }
          },
          "500": {
            "description": "The list of associated numbers could not be obtained"
          }
        }
      }
    },
    "/webphone/info": {
      "get": {
        "tags": [
          "Webphone"
        ],
        "summary": "Webphone Information",
        "operationId": "getWebPhoneInformation",
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "description": "User name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "description": "Account name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "WebphoneInformation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webphone"
                }
              }
            }
          },
          "400": {
            "description": "Bad request, username or account name does not exist"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/callflows": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "GET callflows (excluding queues) of specified account",
        "responses": {
          "200": {
            "description": "Callflows has been listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Callflow ID",
                        "required": true
                      },
                      "name": {
                        "type": "string",
                        "required": true,
                        "description": "Callflow Name"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Callflows has not been listed. Internal Server Error",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Callflows"
        ],
        "summary": "CREATE a callflow into specified account",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Callflow"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Callflow has been created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "required": true,
                      "description": "New callflow ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/callflows/{id}": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "GET a single callflow detail (including attached numbers and the top-level flow module)",
        "description": "Returns the full callflow document for the supplied id, including the list of DIDs/extensions attached to it (`numbers`), any matching `patterns`, the top-level routing module (`flow`), and the QVOICE Platform callflow extensions (queue id, omnichannel team, CRM popup config, after-call actions, etc.). Use this to resolve a DID → callflow → destination (queue, user, voicemail, ring group, …) for routing UIs.\n",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Callflow ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Callflow document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "description": "Callflow ID"
                    },
                    "name": {
                      "type": "string",
                      "description": "Callflow name (only present for QVOICE Platform-named callflows; system-generated DID callflows have an empty name)"
                    },
                    "owner_id": {
                      "type": "string",
                      "description": "Owner user id, when the callflow belongs to a user (e.g. main user callflow)"
                    },
                    "numbers": {
                      "type": "array",
                      "description": "DIDs and extensions attached to this callflow",
                      "items": {
                        "type": "string"
                      }
                    },
                    "patterns": {
                      "type": "array",
                      "description": "Regex patterns matched against the dialed number",
                      "items": {
                        "type": "string"
                      }
                    },
                    "type": {
                      "type": "string",
                      "description": "Callflow type. Common values include `mainUserCallflow` (the per-user \"what happens when this user is called\" callflow), `queue` (a contact-center queue callflow, excluded from `GET /config/callflows`), and `\"\"` (a plain account-level routing callflow).\n"
                    },
                    "group_id": {
                      "type": "string",
                      "description": "Group id when the callflow belongs to a ring group"
                    },
                    "contact_list": {
                      "type": "object",
                      "description": "Map of contact lists exposed by this callflow",
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    },
                    "flow": {
                      "type": "object",
                      "description": "Top-level routing module. `module` is the action (`user`, `callflow`, `ring_group`, `voicemail`, `temporal_route`, `menu`, `device`, `cf_capture_group`, etc.); `data` carries module-specific options (typically including the target `id`); `children` maps DTMF / branch keys (often `\"_\"` for \"any\") to nested modules of the same shape.\n",
                      "properties": {
                        "module": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object"
                        },
                        "children": {
                          "type": "object"
                        }
                      }
                    },
                    "fonoUC": {
                      "type": "object",
                      "description": "QVOICE Platform-specific extensions on the callflow (queue id, omnichannel team, CRM popup config, pre-connect and after-call actions, disposition config, etc.). Present on queue callflows and on callflows authored through the QVOICE Platform portal; absent on legacy/system callflows.\n"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Callflow could not be retrieved",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Callflows"
        ],
        "summary": "UPDATE an existing callflow",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Callflow ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Callflow"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Callflow was updated successfully",
            "content": {}
          },
          "400": {
            "description": "Bad request",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Callflows"
        ],
        "summary": "DELETE an existing callflow",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Callflow ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Callflow was removed successfully",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/queues": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "Get a list of all queues of the account",
        "operationId": "getQueues",
        "responses": {
          "200": {
            "description": "Queue list has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queues"
                }
              }
            }
          },
          "500": {
            "description": "Queue list could not be obtained",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Queues"
        ],
        "summary": "Add a new queue to the account",
        "operationId": "createQueue",
        "requestBody": {
          "description": "Queue object that needs to be added to the account",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Queue"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Queue successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Duplicated queue name / Duplicated extension number",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/queue/{queueID}": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "Get an existing queue",
        "operationId": "getQueue",
        "parameters": [
          {
            "name": "queueID",
            "in": "path",
            "description": "ID of queue to get",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Valid queue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queue"
                }
              }
            }
          },
          "404": {
            "description": "Queue not found with ID supplied",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Queues"
        ],
        "summary": "Update an existing queue",
        "operationId": "updateQueue",
        "parameters": [
          {
            "name": "queueID",
            "in": "path",
            "description": "ID of queue to update",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "requestBody": {
          "description": "Queue object that needs to be edited",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Queue"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Queue successfully updated",
            "content": {}
          },
          "400": {
            "description": "Bad request",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "tags": [
          "Queues"
        ],
        "summary": "Delete an existing queue",
        "operationId": "deleteQueue",
        "parameters": [
          {
            "name": "queueID",
            "in": "path",
            "description": "ID of queue to delete",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid4"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue successfully deleted",
            "content": {}
          },
          "400": {
            "description": "Invalid ID supplied",
            "content": {}
          }
        }
      }
    },
    "/api/v2/reports/pins/summary": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "PIN-wise Call Summary Report",
        "description": "Aggregates DISA calls by the PIN used. The `pin` field is always\nserver-masked (e.g. `****45`); raw PIN values never leave the server.\nOnly calls whose CDR carries a non-empty `X-Pin` custom SIP header are\nconsidered; everything else is ignored.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-ACCOUNT-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Start date (Kazoo/Gregorian seconds)."
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "End date (Kazoo/Gregorian seconds)."
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "IANA timezone used to render Date/Time fields. Defaults to UTC."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "pin",
                          "user_name",
                          "total_calls",
                          "outgoing_calls",
                          "total_duration_seconds",
                          "total_cost"
                        ],
                        "properties": {
                          "pin": {
                            "type": "string",
                            "description": "Pre-masked PIN (e.g. '****45'). Raw PIN is never returned."
                          },
                          "user_name": {
                            "type": "string",
                            "description": "Owner of the PIN, or 'Shared' if none, or 'Unknown (<id>)' if owner was deleted."
                          },
                          "total_calls": {
                            "type": "integer"
                          },
                          "outgoing_calls": {
                            "type": "integer"
                          },
                          "total_duration_seconds": {
                            "type": "integer"
                          },
                          "total_cost": {
                            "type": "string",
                            "description": "Decimal representation; computed from CDR base_cost (1/10000ths of currency)."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/pins/summary/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "PIN-wise Call Summary Report (CSV download)",
        "description": "CSV variant of `/reports/pins/summary`. PIN column is pre-masked.",
        "parameters": [
          {
            "in": "header",
            "name": "X-ACCOUNT-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {}
            }
          }
        }
      }
    },
    "/api/v2/reports/pins/calls": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Detailed PIN Call Log",
        "description": "One row per call that used a PIN. The `pin` field is always server-masked.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-ACCOUNT-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "date",
                          "time",
                          "pin",
                          "user_name",
                          "caller_id_name",
                          "caller_id_number",
                          "dialed_number",
                          "call_type",
                          "duration_seconds",
                          "amount",
                          "flat_rate",
                          "note"
                        ],
                        "properties": {
                          "date": {
                            "type": "string",
                            "description": "YYYY-MM-DD, formatted in the request timezone."
                          },
                          "time": {
                            "type": "string",
                            "description": "HH:MM:SS, formatted in the request timezone."
                          },
                          "pin": {
                            "type": "string",
                            "description": "Pre-masked PIN (e.g. '****45')."
                          },
                          "user_name": {
                            "type": "string"
                          },
                          "caller_id_name": {
                            "type": "string",
                            "description": "Caller ID name of the phone the PIN was dialed from; '' when absent."
                          },
                          "caller_id_number": {
                            "type": "string",
                            "description": "Caller ID number of the phone the PIN was dialed from; '' when absent."
                          },
                          "dialed_number": {
                            "type": "string"
                          },
                          "call_type": {
                            "type": "string",
                            "description": "'Outgoing' or 'Incoming' (DISA is always Outgoing)."
                          },
                          "duration_seconds": {
                            "type": "integer"
                          },
                          "amount": {
                            "type": "string",
                            "description": "Call amount, 2 decimals."
                          },
                          "flat_rate": {
                            "type": "boolean"
                          },
                          "note": {
                            "type": "string",
                            "description": "The PIN's current note from Config -> Pins (not the note at call time); '' when none."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/pins/calls/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Detailed PIN Call Log (CSV download)",
        "description": "CSV variant of `/reports/pins/calls`. PIN column is pre-masked.",
        "parameters": [
          {
            "in": "header",
            "name": "X-ACCOUNT-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {}
            }
          }
        }
      }
    },
    "/api/v2/reports/pins/peak": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "PIN Peak Usage Report",
        "description": "For each PIN, the hour-of-day (0-23, in the request timezone) with the\nhighest call count in the range. Ties break to the earliest hour. The\n`pin` field is always server-masked.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-ACCOUNT-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "pin",
                          "user_name",
                          "peak_hour",
                          "number_of_calls",
                          "total_duration_seconds"
                        ],
                        "properties": {
                          "pin": {
                            "type": "string"
                          },
                          "user_name": {
                            "type": "string"
                          },
                          "peak_hour": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                          },
                          "number_of_calls": {
                            "type": "integer"
                          },
                          "total_duration_seconds": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/pins/peak/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "PIN Peak Usage Report (CSV download)",
        "description": "CSV variant of `/reports/pins/peak`. PIN column is pre-masked.",
        "parameters": [
          {
            "in": "header",
            "name": "X-ACCOUNT-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {}
            }
          }
        }
      }
    },
    "/api/v2/reports/outbound": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Outbound CDRs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "outbound ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/outbound/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get outbound CDRs in a CSV file as attachment",
        "operationId": "getCDRsOutboundCSV",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone to get cdrs in",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "text/csv": {}
            },
            "headers": {
              "Http-Header-Name": {
                "$ref": "#/components/headers/CDROutbound"
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/outbound/pdf": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Reports"
        ],
        "summary": "Get outbound CDRs in a PDF file as attachment",
        "operationId": "getCDRsOutboundPDF",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone to get cdrs in",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "columns",
            "in": "query",
            "description": "comma-separated list of columns to include in the PDF. Available columns: call_start_time, user_name, extension, dialed_number, duration, billing, hangup_cause\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided as PDF",
            "content": {
              "application/pdf": {}
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/reports/rates/ledgers": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rated",
        "operationId": "getCallsRated",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "amount of records per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "key from where to start getting records. Used for pagination.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallsRated"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/ledgers/by_extension": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rated",
        "operationId": "getCallsRated",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "amount of records per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "key from where to start getting records. Used for pagination.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallsRatedByNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rated using QVOICE Platform reports",
        "operationId": "getCallsRatedbyfonoUC",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "amount of records per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "key from where to start getting records. Used for pagination.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCCallsRated"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get CSV of Calls rated using QVOICE Platform reports",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "amount of records per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "key from where to start getting records. Used for pagination.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "text/csv": {}
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls/pdf": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Reports"
        ],
        "summary": "Get Usage Charges report as PDF",
        "operationId": "getUsageChargesPDF",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone for date formatting",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extension",
            "in": "query",
            "description": "filter by extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "filter by tag IDs (can be repeated for multiple tags)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "col",
            "in": "query",
            "description": "custom columns to include in the PDF",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "brandPrimary",
            "in": "query",
            "description": "Optional hex color for the primary brand color (e.g. \"#246199\").\nUsed for the table header background and title text.\nWhen omitted, default colors are used.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandSecondary",
            "in": "query",
            "description": "Optional hex color for the secondary brand color (e.g. \"#2bbec1\").\nUsed for the totals row background. Falls back to brandPrimary if omitted.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided as PDF",
            "content": {
              "application/pdf": {}
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/hospitality/cdrs/anonymize": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Anonymize the CDRs of one user in a date window",
        "operationId": "createCdrAnonymizeJob",
        "description": "Starts a background job that removes personal data from the call detail records (CDRs) of every call the user took part in, and deletes the SIP logs of those calls. Typical use: a hotel property management system at guest check-out. Poll `getReportJobStatus` until `status` is `completed` or `failed`.\n\nEvery leg of each call is processed. Party names become `label` (default `Guest`); party numbers (caller, callee, dialed number, E.164 destination, the user part of `to` / `from` / `request` / `presence_id`, the dialed number in `channel_name`) have every digit replaced with `*`. The user's own extension, timing, billing seconds and rates are kept. Call recordings are not changed. Each scrubbed CDR gets a `fonouc_anonymized` object (time, job id, `stay_id`); a later job skips those records.\n\nA call belongs to the window when it ended between `start_date` and `end_date`; calls that started in the month before are included. The job is idempotent: after `failed`, send the same request again. Requires an account admin bearer token or an API key.\n",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyAuth": [],
            "accountIdHeader": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CdrAnonymizeRequest"
              },
              "example": {
                "user_ext": "4440",
                "start_date": 1764547200,
                "end_date": 1764763200,
                "stay_id": "RES-2026-118842"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job is queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportJobAccepted"
                },
                "example": {
                  "job_id": "0c18664e-5171-4256-811e-ccd309984e37",
                  "status": "queued",
                  "estimated_time_seconds": 60,
                  "created_at": 1764763210
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON, no `user_id` / `user_ext`, unknown `user_ext`, `user_ext` not matching `user_id`, missing or reversed dates, window over 93 days, `stay_id` over 128 or `label` over 64 characters.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                },
                "example": {
                  "error": "user_id or user_ext is required"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/reports/jobs/{job_id}/status": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get the status of a background report job",
        "operationId": "getReportJobStatus",
        "description": "Returns the state of a job started by a `.../request` or `createCdrAnonymizeJob` call. Poll every few seconds until `status` is `completed`, `failed` or `cancelled`. Use the same credentials and `X-Account-ID` as the request that started the job. CSV jobs carry `download_url` when completed; rerate jobs carry `rerate_summary`; anonymize jobs carry `anonymize_summary`.\n",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyAuth": [],
            "accountIdHeader": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "description": "The `job_id` returned when the job was queued.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job's current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportJobStatus"
                },
                "example": {
                  "job_id": "0c18664e-5171-4256-811e-ccd309984e37",
                  "status": "completed",
                  "progress": 100,
                  "message": "CDR anonymization complete: 5 scanned, 5 anonymized, 0 already anonymized, 4 SIP logs deleted, 0 errors",
                  "created_at": 1764763210,
                  "anonymize_summary": {
                    "scanned": 5,
                    "anonymized": 5,
                    "skipped": 0,
                    "errors": 0,
                    "dryRun": false,
                    "sipLogsDeleted": 4
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The job belongs to another account."
          },
          "404": {
            "description": "No job with this id in the account."
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls/rerate/request": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Queue CDR rerate for usage charges date range (reseller only)"
      }
    },
    "/api/v2/reports/rates/calls/by_extension": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rated grouped by number",
        "operationId": "getCallsRatedbyNumber",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCCallsRatedByNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls/by_extension/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get CSV with Calls rated grouped by number",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "text/csv": {}
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls/by_extension/pdf": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Reports"
        ],
        "summary": "Get Users Charges report as PDF",
        "operationId": "getUsersChargesPDF",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone for date formatting",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "filter by tag IDs (can be repeated for multiple tags)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "col",
            "in": "query",
            "description": "custom columns to include in the PDF",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "brandPrimary",
            "in": "query",
            "description": "Optional hex color for the primary brand color (e.g. \"#246199\").\nUsed for the table header background and title text.\nWhen omitted, default colors are used.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandSecondary",
            "in": "query",
            "description": "Optional hex color for the secondary brand color (e.g. \"#2bbec1\").\nUsed for the totals row background. Falls back to brandPrimary if omitted.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided as PDF",
            "content": {
              "application/pdf": {}
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls_summary/{id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rates summary",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCCallsRateSummary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls_summary_children": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rates summary of all children",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCCallsRateSummaryForAllChildren"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls_summary_children/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Calls rates summary of all children",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "text/csv": {}
            },
            "headers": {
              "Http-Header-Name": {
                "$ref": "#/components/headers/FonoUCCallsRateSummaryForAllChildren"
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/rates/calls_summary_children/pdf": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Reports"
        ],
        "summary": "Get Total Charges Per Account report as PDF",
        "operationId": "getTotalChargesPerAccountPDF",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone for date formatting",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "col",
            "in": "query",
            "description": "custom columns to include in the PDF",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "brandPrimary",
            "in": "query",
            "description": "Optional hex color for the primary brand color (e.g. \"#246199\").\nUsed for the table header background and title text.\nWhen omitted, default colors are used.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandSecondary",
            "in": "query",
            "description": "Optional hex color for the secondary brand color (e.g. \"#2bbec1\").\nUsed for the totals row background. Falls back to brandPrimary if omitted.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided as PDF",
            "content": {
              "application/pdf": {}
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/active_dnds": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Active DNDs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "active_dnds ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/inbound": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get inbound CDRs",
        "operationId": "getCDRsInbound",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "amount of records per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "key from where to start getting records. Used for pagination.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cdrs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CDRInbound"
                      }
                    },
                    "next_start_key": {
                      "type": "string",
                      "description": "key from where to start getting records. Used for pagination."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/inbound/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get inbound CDRs in a CSV file as attachment",
        "operationId": "getCDRsInboundCSV",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone to get cdrs in",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "text/csv": {}
            },
            "headers": {
              "Http-Header-Name": {
                "$ref": "#/components/headers/CDRInbound"
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/api/v2/reports/inbound/pdf": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Reports"
        ],
        "summary": "Get inbound CDRs in a PDF file as attachment",
        "operationId": "getCDRsInboundPDF",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "range start date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "range end date in UNIX epoch time",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "desired timezone to get cdrs in",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "columns",
            "in": "query",
            "description": "comma-separated list of columns to include in the PDF. Available columns: start_time, caller_id_name, caller_id_number, destination, callee_id_name, callee_id_number, duration, billing, hangup_cause\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report successfully provided as PDF",
            "content": {
              "application/pdf": {}
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Queues CDRs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_queues ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Queues CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/stats": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agents Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_agents_stats ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/activity/events": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agents Activity Events",
        "operationId": "getCCAgentActivityEvents",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start range date. Unix timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End range date. Unix timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timeRange",
            "in": "query",
            "description": "Time range in format like 1d, 1w, 1h, etc.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of records per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startKey",
            "in": "query",
            "description": "Start key for pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent activity events with pagination",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "description": "Array of agent activity events",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event": {
                            "type": "string",
                            "description": "Event type"
                          },
                          "enabled": {
                            "type": "boolean",
                            "description": "Whether the event is enabled"
                          },
                          "user_id": {
                            "type": "string",
                            "description": "User ID"
                          },
                          "ext": {
                            "type": "string",
                            "description": "Extension"
                          },
                          "username": {
                            "type": "string",
                            "description": "Username"
                          },
                          "state": {
                            "type": "string",
                            "description": "Agent state"
                          },
                          "timestamp": {
                            "type": "integer",
                            "description": "Event timestamp"
                          }
                        }
                      }
                    },
                    "next_start_key": {
                      "type": "string",
                      "description": "Timestamp of the last event in the current page. Use this value as startDate in the next request for pagination. Empty string if no more results available.",
                      "example": "1754419492"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {}
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agent": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agent Queues CDRs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_agent ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agent/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agent CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/stats": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Queues Statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_queues_stats ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/stats/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Queues Statistics CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queue": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Queue Activity Report",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_queue ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queue/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Queue CSV",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/status/all": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agents Status Logs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_agents_status_all ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/status/queues": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agents Status by Queues",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_agents_status_queues ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/status/activity": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call Center Agents Status Activity",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "callcenter_agents_status_activity ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/account/custom_routing/enabled": {
      "get": {
        "tags": [
          "Custom Routing"
        ],
        "summary": "Get custom routing status",
        "operationId": "getCustomRoutingEnabled",
        "responses": {
          "200": {
            "description": "Returns true if custom routing is enabled otherwise returns false",
            "content": {
              "*/*": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "400": {
            "description": "Invalid account ID supplied"
          }
        }
      }
    },
    "/callcenter/agent/status/queues": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Agent Queues Status",
        "operationId": "getQueuesStatusForAgent",
        "responses": {
          "200": {
            "description": "Queues status successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentQueuesStatus"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/agent/status/queues/outbound_calls": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "summary": "Agent Outbound Queue",
        "operationId": "SetAgentOutboundCallsQueue",
        "parameters": [
          {
            "in": "query",
            "name": "queueID",
            "description": "Queue ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Agent queue for outbound calls has been set successfully"
          },
          "400": {
            "description": "Bad request. Missing required query param"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/callcenter/agent/{status}": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "summary": "Agent Status",
        "operationId": "setAgentStatusForQueue",
        "parameters": [
          {
            "in": "path",
            "name": "status",
            "required": true,
            "description": "one of login/logout",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "queueID",
            "in": "query",
            "description": "Queue ID to set user status in",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Agent status successfully set"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/agent/{status}/all": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "summary": "Agent Status All Queues",
        "operationId": "setAgentStatusForAllQueues",
        "parameters": [
          {
            "in": "path",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string",
              "description": "one of login/logout"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Agent status successfully set to all queues"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/queues/assigned": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Queue by DID",
        "operationId": "getQueueAssociatedToDid",
        "parameters": [
          {
            "name": "did",
            "in": "query",
            "description": "DID number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue data successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assigned_to_queue": {
                      "type": "boolean",
                      "description": "Flag to indicate if DID is associated to a queue"
                    },
                    "queue_id": {
                      "type": "string",
                      "description": "Associated queue ID"
                    },
                    "queue_name": {
                      "type": "string",
                      "description": "Associated queue name"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/addressbook": {
      "post": {
        "tags": [
          "Addressbook"
        ],
        "summary": "Upload Addressbook CSV",
        "description": "Addressbook will be created from the CSV file the",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "addressbook": {
                    "type": "string",
                    "format": "binary",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The addressbook has been created successfully.",
            "content": {}
          },
          "400": {
            "description": "The addressbook could not be created. The information sent is invalid.",
            "content": {}
          },
          "500": {
            "description": "The addressbook could not be created.",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Addressbook"
        ],
        "summary": "GET Addressbooks List",
        "responses": {
          "200": {
            "description": "The list of addressbooks has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressBook"
                }
              }
            }
          },
          "500": {
            "description": "The list of addressbooks could not be obtained",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Addressbook"
        ],
        "summary": "Delete addressbook for account",
        "responses": {
          "204": {
            "description": "Addressbook has been successfully deleted, or no action was performed if no adderssbook existed."
          },
          "500": {
            "description": "Couldn't access account's database, or some other error occured on addressbook deletion."
          }
        }
      }
    },
    "/api/v2/config/addressbook/csv": {
      "get": {
        "tags": [
          "Addressbook"
        ],
        "summary": "Addressbook CSV download",
        "responses": {
          "200": {
            "description": "Report successfully provided",
            "content": {
              "text/csv": {}
            }
          },
          "204": {
            "description": "No Addressbook in database."
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Couldn't access account's database, or some other error occured on addressbook deletion."
          }
        }
      }
    },
    "/api/v2/config/quotes": {
      "get": {
        "tags": [
          "Quotes"
        ],
        "summary": "All Quotes",
        "description": "Retrieve all quotes for the current account",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of quotes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "New Quote",
        "description": "Create a new quote for the current account",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Quote"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Quote created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/quotes/items": {
      "post": {
        "tags": [
          "Quote Items"
        ],
        "summary": "Create a new quote item",
        "description": "Create a new quote item",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteItem"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Quote item created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteItem"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/quotes/items/{id}": {
      "get": {
        "tags": [
          "Quote Items"
        ],
        "summary": "Get a quote item by ID",
        "description": "Retrieve a specific quote item by its ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Quote Item ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Quote item details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteItem"
                }
              }
            }
          },
          "404": {
            "description": "Quote item not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "put": {
        "tags": [
          "Quote Items"
        ],
        "summary": "Update a quote item",
        "description": "Update an existing quote item",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Quote Item ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteItem"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote item updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteItem"
                }
              }
            }
          },
          "404": {
            "description": "Quote item not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "delete": {
        "tags": [
          "Quote Items"
        ],
        "summary": "Delete a quote item",
        "description": "Delete a specific quote item",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Quote Item ID"
          }
        ],
        "responses": {
          "204": {
            "description": "Quote item deleted successfully"
          },
          "404": {
            "description": "Quote item not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/quotes/{id}/items": {
      "get": {
        "tags": [
          "Quote Items"
        ],
        "summary": "Get all quote items for a quote",
        "description": "Retrieve all quote items associated with a specific quote",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Quote ID"
          }
        ],
        "responses": {
          "200": {
            "description": "List of quote items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuoteItem"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Quote not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/ucp/dashboard/preferences": {
      "put": {
        "tags": [
          "UCP Dashboard"
        ],
        "summary": "Preferences Box Status",
        "description": "This endpoint lets to enable or disable whether the preferences box will be showed or not.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "disabled"
                ],
                "type": "object",
                "properties": {
                  "disabled": {
                    "type": "boolean",
                    "description": "Dashboard preferences status"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Preferences successfully updated.",
            "content": {}
          },
          "400": {
            "description": "An error occurred trying to decode request.",
            "content": {}
          },
          "500": {
            "description": "Dashboard preferences could not be edited.",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "UCP Dashboard"
        ],
        "summary": "Preferences Box Status",
        "description": "This endpoints returns the enable/disable value indicating whether the preferences box will be showed or not.",
        "responses": {
          "200": {
            "description": "Preferences successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "disabled"
                  ],
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "Dashboard preferences status"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An error occurred trying to decode request.",
            "content": {}
          },
          "500": {
            "description": "Dashboard preferences could not be obtained.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/dashboard/preferences/dnd": {
      "put": {
        "tags": [
          "UCP Dashboard"
        ],
        "summary": "DND Visibility Status",
        "description": "This endpoint lets to enable or disable whether the DND option will be showed or not.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "disabled"
                ],
                "type": "object",
                "properties": {
                  "disabled": {
                    "type": "boolean",
                    "description": "DND disability status"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "DND visibility status successfully updated.",
            "content": {}
          },
          "400": {
            "description": "Invalid request body.",
            "content": {}
          },
          "500": {
            "description": "DND visibility status could not be updated.",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "UCP Dashboard"
        ],
        "summary": "DND Visibility Status",
        "description": "This endpoint returns the status indicating whether the DND option will be showed or not.",
        "responses": {
          "200": {
            "description": "DND visibility status successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "disabled"
                  ],
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "DND disability status"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "DND visibility status could not be obtained.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/apps/download": {
      "get": {
        "tags": [
          "UCP Apps"
        ],
        "summary": "UCP Apps Download Visibility",
        "responses": {
          "200": {
            "description": "UCP Apps download links visibility state has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "desktop": {
                      "type": "object",
                      "properties": {
                        "hidden": {
                          "type": "boolean",
                          "description": "Indicates whether the download link for the desktop app should be hidden or not",
                          "required": true
                        }
                      }
                    },
                    "mobile": {
                      "type": "object",
                      "properties": {
                        "hidden": {
                          "type": "boolean",
                          "description": "Indicates whether the download link for the mobile app should be hidden or not",
                          "required": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/apps/{app_name}/download": {
      "put": {
        "tags": [
          "UCP Apps"
        ],
        "summary": "UCP App Download Visibility",
        "parameters": [
          {
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the UCP application [desktop/mobile]"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hide": {
                    "type": "boolean",
                    "description": "Indicates whether the download link for the specified app will be hidden or not"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP App download link visibility state has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/call/caller_id": {
      "get": {
        "tags": [
          "UCP Caller ID Configuration"
        ],
        "summary": "UCP Caller ID Configuration",
        "responses": {
          "200": {
            "description": "UCP caller id config has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbound": {
                      "type": "object",
                      "properties": {
                        "disabled": {
                          "type": "boolean",
                          "description": "Indicates whether caller for inbound calls it's disabled or not",
                          "required": true
                        },
                        "name_mask": {
                          "type": "string",
                          "description": "Indicates the mask for the caller id name"
                        },
                        "number_mask": {
                          "type": "string",
                          "description": "Indicates the mask for the caller id number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Caller ID Configuration"
        ],
        "summary": "UCP Caller ID Configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inbound": {
                    "type": "object",
                    "properties": {
                      "disabled": {
                        "type": "boolean",
                        "description": "Indicates whether caller for inbound calls it's disabled or not",
                        "required": true
                      },
                      "name_mask": {
                        "type": "string",
                        "description": "Indicates the mask for the caller id name"
                      },
                      "number_mask": {
                        "type": "string",
                        "description": "Indicates the mask for the caller id number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP caller id config has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/calls/early_media": {
      "get": {
        "tags": [
          "UCP Calls"
        ],
        "summary": "UCP Calls Early Media Status",
        "responses": {
          "200": {
            "description": "UCP calls early media status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "Indicates if early media is disabled or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Calls"
        ],
        "summary": "UCP Calls Early Media Status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disable": {
                    "type": "boolean",
                    "description": "Indicates whether early media should be disabled or not",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP calls early media status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/settings/profile_image": {
      "get": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Profile Image Settings",
        "responses": {
          "200": {
            "description": "UCP Profile Image Settings has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "gravatar": {
                      "type": "boolean",
                      "description": "Indicates if Gravatar service is enabled or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Profile Image Settings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gravatar": {
                    "type": "boolean",
                    "description": "Indicates if Gravatar service should be enabled or not",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP Profile Image Settings has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/settings/fmfm": {
      "get": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP FMFM Settings Status",
        "responses": {
          "200": {
            "description": "UCP FMFM Settings status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "Indicates if FMFM settings are disabled or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP FMFM Settings Status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disable": {
                    "type": "boolean",
                    "description": "Indicates whether FMFM settings should be disabled or not",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP FMFM Settings status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/settings/logout": {
      "get": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Logout Status",
        "responses": {
          "200": {
            "description": "UCP Logout status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "Indicates if UCP Logout is disabled or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Logout Status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disable": {
                    "type": "boolean",
                    "description": "Indicates whether UCP Logout should be disabled or not",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP Logout status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/contact_center/login_per_queue": {
      "get": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Contact Center Login per Queue Status",
        "responses": {
          "200": {
            "description": "UCP Contact Center Login/Logout per queue status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "Indicates if UCP Contact Center Login/Logout per queue is disabled or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Contact Center Login per Queue Status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disable": {
                    "type": "boolean",
                    "description": "Indicates whether UCP Contact Center Login/Logout per queue should be disabled or not",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP Contact Center Login/Logout per queue status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ucp/contact_center/login_group": {
      "get": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Contact Center Group Login Status",
        "responses": {
          "200": {
            "description": "UCP Contact Center Group Login/Logout status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "disabled": {
                      "type": "boolean",
                      "description": "Indicates if UCP Contact Center Group Login/Logout is disabled or not",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "UCP Settings"
        ],
        "summary": "UCP Contact Center Group Login Status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disable": {
                    "type": "boolean",
                    "description": "Indicates whether UCP Contact Center Group Login/Logout should be disabled or not",
                    "required": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "UCP Contact Center Group Login/Logout status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/system/number_manager/{section}": {
      "put": {
        "tags": [
          "System"
        ],
        "summary": "System Number Preferences",
        "description": "This endpoint lets to add number prefixes.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "string": {
                    "type": "object",
                    "properties": {
                      "prefix": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preferences successfully updated.",
            "content": {}
          },
          "400": {
            "description": "An error occurred trying to decode request.",
            "content": {}
          },
          "500": {
            "description": "An error occurred trying to complete the request.",
            "content": {}
          }
        }
      }
    },
    "/api/ucp/v2/fmfm": {
      "put": {
        "tags": [
          "FMFM State"
        ],
        "summary": "FMFM Enabled State",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "FMFM State"
        ],
        "summary": "FMFM Enabled State"
      }
    },
    "/api/v2/fmfm/profiles": {
      "post": {
        "tags": [
          "FMFM Profile"
        ],
        "summary": "FMFM Profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "devices": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "start": {
                          "type": "string"
                        },
                        "end": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "response": {
          "200": {
            "descripion": "Add FMFM Profile"
          }
        }
      },
      "put": {
        "tags": [
          "FMFM Profile"
        ],
        "summary": "FMFM Profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "devices": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "start": {
                          "type": "string"
                        },
                        "end": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "response": {
          "200": {
            "descripion": "Add FMFM Profile"
          }
        }
      },
      "get": {
        "tags": [
          "FMFM Profiles"
        ],
        "summary": "FMFM Profiles",
        "responses": {
          "200": {
            "description": "Get FMFM Profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "active": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/fmfm/profiles/{id}": {
      "get": {
        "tags": [
          "FMFM Profile"
        ],
        "summary": "FMFM Profile",
        "responses": {
          "200": {
            "description": "Get FMFM Profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FMFMProfile"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "FMFM Profile"
        ],
        "summary": "FMFM Profile",
        "responses": {
          "200": {
            "description": "Delete FMFM Profile"
          }
        }
      }
    },
    "/api/v2/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "Account Tags",
        "responses": {
          "200": {
            "description": "Account's tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tags"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Create Account Tag",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Tag"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/tags/{id}": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "Account Tag",
        "responses": {
          "200": {
            "description": "Account's tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "put": {
        "tags": [
          "Tags"
        ],
        "summary": "Update Account Tag",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Tags"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          },
          "400": {
            "description": "Bad request"
          },
          "409": {
            "description": "Tag with specified Type and Name already exists; can't update, because it'd cause an inconsistent state."
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "delete": {
        "tags": [
          "Tags"
        ],
        "summary": "Account Tag",
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "204": {
            "description": "Nothing found to delete"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/tags/type/{type}": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "Account Tags by Type",
        "responses": {
          "200": {
            "description": "Account's tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/config/webchat": {
      "post": {
        "tags": [
          "Webchat"
        ],
        "summary": "Save / Update Webchat Configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true,
                    "description": "Webchat feature status"
                  },
                  "source": {
                    "type": "string",
                    "required": true,
                    "description": "Webchat source (URL to Javascript script)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webchat configuration has been set successfully!",
            "content": {}
          },
          "204": {
            "description": "Webchat configuration has been updated successfully!",
            "content": {}
          },
          "400": {
            "description": "Invalid request body. Webchat configuration has not been set.",
            "content": {}
          },
          "500": {
            "description": "Internal server error. Webchat configuration has not been set.",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Webchat"
        ],
        "summary": "Webchat Configuration",
        "responses": {
          "200": {
            "description": "Webchat configuration has been obtained successfully!",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true,
                      "description": "Webchat feature status"
                    },
                    "source": {
                      "type": "string",
                      "required": true,
                      "description": "Webchat source (URL to Javascript script)"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. Webchat configuration has not been obtained.",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/webchat": {
      "get": {
        "tags": [
          "Webchat"
        ],
        "summary": "UCP Webchat Configuration",
        "responses": {
          "200": {
            "description": "Webchat configuration has been obtained successfully!",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true,
                      "description": "Webchat feature status"
                    },
                    "source": {
                      "type": "string",
                      "required": true,
                      "description": "Webchat source (URL to Javascript script)"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. Webchat configuration has not been obtained.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies": {
      "put": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Create / Update Security Policies Configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSecurityPolicies"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Security policies configuration has been created successfully",
            "content": {}
          },
          "204": {
            "description": "Security policies configuration has been updated successfully",
            "content": {}
          },
          "401": {
            "description": "No authorization to do this action",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Security Policies Configuration",
        "responses": {
          "200": {
            "description": "Security policies configuration has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetSecurityPolicies"
                }
              }
            }
          },
          "401": {
            "description": "No authorization to do this action",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies/password/length": {
      "get": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Password Length Configuration",
        "responses": {
          "200": {
            "description": "Password length configuration has been obtained successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true,
                      "description": "Security policy status (Enabled or disabled)"
                    },
                    "length": {
                      "type": "integer",
                      "default": 6,
                      "required": true,
                      "description": "Minimum required length of password"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies/password/history": {
      "get": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Password History Validation",
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "description": "Account ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "User ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "Credentials Hashed using MD5 (username:password)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Password validation has been done successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean",
                      "required": true,
                      "description": "Represents is password is valid or not"
                    },
                    "message": {
                      "type": "string",
                      "required": true,
                      "description": "If password is not valid we explain why is not valid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Invalid query params",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies/password/age": {
      "get": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Password Age Check",
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "description": "Account ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "User ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Password age has been checked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "allowed": {
                      "type": "boolean",
                      "required": true,
                      "description": "Represents if its allowed or not to change password after checking password age"
                    },
                    "minimum_age": {
                      "type": "integer",
                      "required": true,
                      "description": "Represents minimum configured age in days for passwords on security policies configuration"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Invalid query params",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies/login/credentials": {
      "get": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Credentials Login Status",
        "parameters": [
          {
            "in": "header",
            "name": "X-User-Agent",
            "schema": {
              "type": "string",
              "description": "User Agent (it could be portal/ucp)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials login status has been checked succesfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true,
                      "description": "Indicates whether if the credentials login is enabled or disabled for the specified app"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Missing X-User-Agent Header",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies/mfa/verification": {
      "post": {
        "tags": [
          "Security Policies"
        ],
        "summary": "MFA Verification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "integer",
                        "required": true,
                        "description": "Verification Code"
                      },
                      "token": {
                        "type": "string",
                        "required": true,
                        "description": "Verification Token"
                      }
                    }
                  },
                  "sms": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "integer",
                        "required": true,
                        "description": "Verification Code"
                      },
                      "token": {
                        "type": "string",
                        "required": true,
                        "description": "Verification Token"
                      }
                    }
                  },
                  "call": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "integer",
                        "required": true,
                        "description": "Verification Code"
                      },
                      "token": {
                        "type": "string",
                        "required": true,
                        "description": "Verification Token"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MFA has been completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "required": true
                    },
                    "refresh_token": {
                      "type": "string",
                      "required": true
                    },
                    "user": {
                      "type": "object",
                      "required": true,
                      "description": "Authenticated user information"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "MFA has not been completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "factor": {
                            "type": "string",
                            "required": true,
                            "description": "2FA Method (email, sms or call)"
                          },
                          "reason": {
                            "type": "string",
                            "required": true,
                            "description": "2FA verification error type"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "MFA has not been completed. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/security/policies/mfa/{method}/new": {
      "post": {
        "tags": [
          "Security Policies"
        ],
        "summary": "Resend MFA Verification Code",
        "parameters": [
          {
            "name": "method",
            "in": "path",
            "description": "Second Factor Auth Method (email, sms, call)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "required": true,
                    "description": "User Email"
                  },
                  "account_name": {
                    "type": "string",
                    "required": true,
                    "description": "User Account Name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "2FA verification code has been sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "required": true,
                      "description": "Verification Token"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "2FA verification code could not be sent. Bad Request",
            "content": {}
          },
          "500": {
            "description": "2FA verification code could not be sent. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/numbers/provider": {
      "put": {
        "tags": [
          "Numbers Provider"
        ],
        "summary": "Numbers Provider Configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "DIDs provider (For instance voip_innovations)",
                    "required": true
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of your integration (descriptive)",
                    "required": true
                  },
                  "note": {
                    "type": "string",
                    "description": "Note of your integration",
                    "required": true
                  },
                  "username": {
                    "type": "string",
                    "description": "DIDs provider account username"
                  },
                  "password": {
                    "type": "string",
                    "description": "DIDs provider account password"
                  },
                  "group_id": {
                    "type": "string",
                    "description": "DIDs provider account specified group_id"
                  },
                  "configuration": {
                    "type": "object",
                    "description": "DIDs provider configuration options",
                    "properties": {
                      "tiers": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "description": "DIDs allowed tiers"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Numbers provider configuration has been updated successfully.",
            "content": {}
          },
          "400": {
            "description": "Numbers provider configuration has not been updated. Bad Request",
            "content": {}
          },
          "500": {
            "description": "Numbers provider configuration has not been updated. Internal Server Error",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Numbers Provider"
        ],
        "summary": "Numbers Provider Configuration",
        "responses": {
          "200": {
            "description": "Numbers provider configuration has been obtained successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "DIDs provider (For instance voip_innovations)",
                      "required": true
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of your integration (descriptive)",
                      "required": true
                    },
                    "note": {
                      "type": "string",
                      "description": "Note of your integration",
                      "required": true
                    },
                    "username": {
                      "type": "string",
                      "description": "DIDs provider account username"
                    },
                    "password": {
                      "type": "string",
                      "description": "DIDs provider account password"
                    },
                    "group_id": {
                      "type": "string",
                      "description": "DIDs provider account specified group_id"
                    },
                    "configuration": {
                      "type": "object",
                      "description": "DIDs provider configuration options",
                      "properties": {
                        "tiers": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          },
                          "description": "DIDs allowed tiers"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Numbers provider configuration has not been obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/fax/{faxID}": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns fax attachment file for specified fax id",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "fax attachment file for specified fax id not found"
          },
          "500": {
            "description": "fax attachment file for specified fax id could not be obtained"
          }
        }
      }
    },
    "/ucp/v2/fax/send": {
      "post": {
        "tags": [
          "Fax"
        ],
        "summary": "Send fax",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from_name": {
                    "type": "string",
                    "description": "sender's Email",
                    "required": true
                  },
                  "from_number": {
                    "type": "string",
                    "description": "sender's number",
                    "required": true
                  },
                  "to_name": {
                    "type": "string",
                    "description": "receiver's Email",
                    "required": true
                  },
                  "to_number": {
                    "type": "string",
                    "description": "receiver's number",
                    "required": true
                  },
                  "url": {
                    "type": "string",
                    "description": "url of the file to send",
                    "required": false
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "required": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fax job created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "attempts": {
                      "type": "int"
                    },
                    "document": {
                      "type": "object",
                      "properties": {
                        "method": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      }
                    },
                    "fax_timezone": {
                      "type": "string"
                    },
                    "from_name": {
                      "type": "string"
                    },
                    "from_number": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "retries": {
                      "type": "int"
                    },
                    "to_name": {
                      "type": "string"
                    },
                    "to_number": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Fax couldn't be sent",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/fax/status/{faxJobID}": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns fax status for specified fax id",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "fax attachment file for specified fax id could not be obtained"
          }
        }
      }
    },
    "/ucp/v2/faxes/status": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns fax status for all faxes",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "description": "List of statuses",
                  "items": {
                    "schema": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "fax status for faxes could not be obtained"
          }
        }
      }
    },
    "/ucp/v2/faxes/{folder}": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns faxes from folders inbox or outbox",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "description": "List of faxes",
                  "items": {
                    "schema": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "faxes could not be obtained"
          }
        }
      }
    },
    "/ucp/v2/fax/faxboxes": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns faxes from folders inbox or outbox",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FaxboxElement"
                  }
                }
              }
            }
          },
          "500": {
            "description": "faxes could not be obtained"
          }
        }
      }
    },
    "/ucp/v2/fax/faxboxes/{faxboxID}": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns faxes from folders inbox or outbox",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaxboxElement"
                }
              }
            }
          },
          "500": {
            "description": "faxes could not be obtained"
          }
        }
      },
      "post": {
        "tags": [
          "Fax"
        ],
        "summary": "Send fax",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FaxboxElement"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Fax job created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaxboxElement"
                }
              }
            }
          },
          "500": {
            "description": "Fax couldn't be sent",
            "content": {}
          }
        }
      }
    },
    "/ucp/v2/call/{id}/toggle_recording": {
      "put": {
        "tags": [
          "Call Recording"
        ],
        "summary": "Toggle recording for a call",
        "description": "This endpoint allows users to toggle recording for a specific call.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The ID of the call to toggle recording for. You should look for the `P-CID` header in the INVITE SIP message.",
            "required": true,
            "type": "string"
          },
          {
            "name": "action",
            "in": "query",
            "description": "The action to perform (start or stop recording)",
            "required": true,
            "type": "string"
          },
          {
            "name": "filename",
            "in": "query",
            "description": "The name of the file to save the recording as. You should look for the `Q-Recording-File-Name` header in the INVITE SIP message.",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully toggled recording"
          },
          "400": {
            "description": "Invalid request format"
          },
          "401": {
            "description": "Unauthorized request"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ]
      }
    },
    "/api/v2/faxes/{folder}": {
      "get": {
        "tags": [
          "Fax"
        ],
        "summary": "returns faxes from folders inbox, outbox or both",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FaxElement"
                  }
                }
              }
            }
          },
          "500": {
            "description": "faxes could not be obtained"
          }
        }
      }
    },
    "/api/v2/config/signup/settings": {
      "put": {
        "tags": [
          "Signup"
        ],
        "summary": "Sets up sign up settings",
        "operationId": "setSignupSettings",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "description": "Set up settings.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Signup settings successfully set."
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/admin/agent/{userID}/{status}": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "summary": "Change agent status in a queue",
        "operationId": "setAdminAgentStatusForQueue",
        "parameters": [
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "description": "user id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "status",
            "required": true,
            "description": "one of login/logout",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "queueID",
            "in": "query",
            "description": "Queue ID to set user status in",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Agent status successfully set"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/queues/status": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Get queues status",
        "responses": {
          "200": {
            "description": "Queue data successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "max_time_caller_in_queue": {
                      "type": "integer"
                    },
                    "strategy": {
                      "type": "string"
                    },
                    "agents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "extension": {
                            "type": "string"
                          },
                          "delay": {
                            "type": "integer"
                          },
                          "timeout": {
                            "type": "integer"
                          },
                          "logged_in": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string"
                          },
                          "registered": {
                            "type": "boolean"
                          },
                          "conference": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "answered": {
                                "type": "boolean"
                              },
                              "participants": {
                                "type": "integer"
                              },
                              "duration": {
                                "type": "integer"
                              },
                              "agent": {
                                "type": "object",
                                "properties": {
                                  "hear": {
                                    "type": "boolean"
                                  },
                                  "speak": {
                                    "type": "boolean"
                                  },
                                  "duration": {
                                    "type": "integer"
                                  }
                                }
                              },
                              "caller": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "number": {
                                    "type": "string"
                                  },
                                  "hear": {
                                    "type": "boolean"
                                  },
                                  "speak": {
                                    "type": "boolean"
                                  },
                                  "duration": {
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "total_agents": {
                      "type": "integer"
                    },
                    "logged_in_agents": {
                      "type": "integer"
                    },
                    "logged_out_agents": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/queues/calls": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Get queues calls",
        "responses": {
          "200": {
            "description": "Queue calls data successfully provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Conference ID (Kazoo)"
                      },
                      "name": {
                        "type": "string",
                        "description": "Queue name"
                      },
                      "answered": {
                        "type": "boolean"
                      },
                      "participants": {
                        "type": "integer"
                      },
                      "duration": {
                        "type": "integer",
                        "description": "Total conference duration (seconds)"
                      },
                      "agent": {
                        "type": "array",
                        "description": "Present when the call is being handled by an agent; empty or absent when the call is only waiting in queue",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "ext": {
                              "type": "integer"
                            },
                            "hear": {
                              "type": "boolean"
                            },
                            "speak": {
                              "type": "boolean"
                            },
                            "duration": {
                              "type": "integer"
                            }
                          }
                        }
                      },
                      "caller": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          },
                          "hear": {
                            "type": "boolean"
                          },
                          "speak": {
                            "type": "boolean"
                          },
                          "duration": {
                            "type": "integer"
                          }
                        }
                      },
                      "wait_time": {
                        "type": "integer",
                        "description": "Time the caller has been waiting (seconds). When answered, time waited before the agent joined; when still in queue, same as caller duration."
                      },
                      "queue_id": {
                        "type": "string",
                        "description": "Queue ID"
                      },
                      "call_id": {
                        "type": "string",
                        "description": "Caller leg call ID; use as stable unique identifier for the call record"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/callcenter/queue/queue_add_agent/{confid}/{ext}/{action}": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "summary": "Spy, barge or whisper into a queue conference",
        "operationId": "queueAddAgent",
        "description": "Patches a supervisor extension into a live queue conference in one of three monitoring modes. The request is forwarded to the queues engine over RabbitMQ. Restricted to account admins and queue supervisors (`UserAdminOrSupervisorMiddleware`).\n\nThe mode is selected by the `action` path parameter:\n\n  * `spy`   — silent monitoring. The supervisor hears the call but is\n              muted to everyone (listen / eavesdrop).\n  * `barge` — the supervisor joins and is audible to both parties.\n  * `coach` — whisper / coaching. The supervisor is audible ONLY to the\n              monitored agent (`ext`), not to the remote party.\n\n\nThis is the queue-conference twin of the live-call endpoint `POST /api/v2/calls/{action}/{uuid}/{extension}`; here the target is identified by the queue conference id rather than a call-leg UUID.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "description": "Kazoo account id that owns the queue conference.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "confid",
            "required": true,
            "description": "Queue conference id of the call to monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ext",
            "required": true,
            "description": "Supervisor extension to patch into the conference.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "action",
            "required": true,
            "description": "Monitoring mode.",
            "schema": {
              "type": "string",
              "enum": [
                "spy",
                "barge",
                "coach"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The supervisor was added to the conference in the requested mode."
          },
          "400": {
            "description": "Missing `X-Account-ID` header, invalid `action`, or the queues engine rejected the request."
          },
          "403": {
            "description": "Caller is neither an account admin nor a queue supervisor."
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/signup/moh/add": {
      "post": {
        "tags": [
          "Call Center"
        ],
        "summary": "Add Music on Hold",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AddMusicOnHold"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Music on hold created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddMusicOnHoldResponse"
                }
              }
            }
          },
          "500": {
            "description": "Music on hold couldn't be added",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/signup/moh": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Get List of Music on Hold elements",
        "responses": {
          "200": {
            "description": "Music on hold list returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOfMusicOnHoldElements"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't get Music on hold list.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/signup/moh/assignment": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "music_on_hold_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Music on hold list successfully set."
          },
          "500": {
            "description": "Couldn't get Music on hold list.",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/campaigns/cleaning": {
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Clean Campaign Numbers",
        "responses": {
          "200": {
            "description": "Operation successful. There shouldn't be any numbers associated to deleted campaigns left.",
            "content": {}
          },
          "400": {
            "description": "X-Account-ID header is missing.",
            "content": {}
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "New Campaign",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "queue_id": {
                    "type": "string",
                    "required": true
                  },
                  "name": {
                    "type": "string",
                    "required": true
                  },
                  "retries": {
                    "type": "integer",
                    "required": true
                  },
                  "note": {
                    "type": "string",
                    "required": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campaign created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "new Campaign id."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Possible issues: X-Account-ID header is missing; campaign name is not unique for account."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      },
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "All Campaigns",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Campaign"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns/{id}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Campaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      },
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Campaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign successfully edited."
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      },
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Delete Campaign by id.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign successfully deleted."
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns/{id}/lead": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Add number to campaign.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "required": true
                  },
                  "retries": {
                    "type": "integer",
                    "description": "Number of retries assigned to number. If omitted, then campaign rules will apply.",
                    "required": false
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "priority": {
                    "type": "integer",
                    "required": true,
                    "description": "range 1 to 100"
                  },
                  "ticket_id": {
                    "type": "string",
                    "description": "custom value"
                  },
                  "note": {
                    "type": "string",
                    "description": "custom value"
                  },
                  "cool_off": {
                    "type": "integer",
                    "description": "in seconds"
                  },
                  "cool_off_2nd": {
                    "type": "integer",
                    "description": "in seconds"
                  },
                  "cool_off_3rd": {
                    "type": "integer",
                    "description": "in seconds"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/campaigns/{id}/leads": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Add numbers to campaign via CSV (Bulk operation).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV file containing numbers to add to the campaign"
                  }
                },
                "required": [
                  "numbers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Leads successfully added to campaign."
          },
          "400": {
            "description": "X-Account-ID header is missing or invalid data format."
          },
          "404": {
            "description": "Campaign not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns/{id}/leads/api": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Add numbers to campaign via API (Bulk operation using CRM API).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "description": "HTTP method to be used (e.g., GET, POST) in the API request"
                  },
                  "url": {
                    "type": "string",
                    "description": "URL of the CRM API endpoint to fetch leads"
                  },
                  "mapping": {
                    "type": "object",
                    "description": "Mapping between CRM response fields and internal lead fields",
                    "properties": {
                      "leads_array": {
                        "type": "string",
                        "description": "Field in the API response containing the array of leads"
                      },
                      "first_name": {
                        "type": "string",
                        "description": "Maps to the lead's first name field"
                      },
                      "last_name": {
                        "type": "string",
                        "description": "Maps to the lead's last name field"
                      },
                      "number": {
                        "type": "string",
                        "description": "Maps to the lead's contact number"
                      },
                      "priority": {
                        "type": "string",
                        "description": "Maps to the lead's priority field"
                      },
                      "ticket_id": {
                        "type": "string",
                        "description": "Maps to the lead's ticket ID"
                      },
                      "dial_retries": {
                        "type": "string",
                        "description": "Maps to the number of retries for dialing the lead"
                      },
                      "first_cooloff": {
                        "type": "string",
                        "description": "Maps to the initial cool-off period before retrying the lead"
                      },
                      "cooloff": {
                        "type": "string",
                        "description": "Maps to the subsequent cool-off period between retries"
                      },
                      "notes": {
                        "type": "string",
                        "description": "Maps to the lead's notes or additional information"
                      }
                    }
                  }
                },
                "required": [
                  "method",
                  "url",
                  "mapping"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Leads successfully added to campaign."
          },
          "400": {
            "description": "X-Account-ID header is missing or invalid data format."
          },
          "404": {
            "description": "Campaign not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      },
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Get all numbers in campaign.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID"
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CampaignNumber"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns/lead/{lead_id}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Get specified number in campaign.",
        "parameters": [
          {
            "name": "lead_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Number ID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignNumber"
                }
              }
            }
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign or number not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns/leads/{lead_id}": {
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Edit campaign number.",
        "parameters": [
          {
            "name": "lead_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Number ID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "required": false
                  },
                  "retries": {
                    "type": "integer",
                    "description": "Number of retries assigned to number. If omitted, then campaign rules will apply.",
                    "required": "false."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Number successfully edited."
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign or number not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      },
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "DeleteCampaignNumbers.",
        "parameters": [
          {
            "name": "lead_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Number ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Number successfully deleted."
          },
          "400": {
            "description": "X-Account-ID header is missing."
          },
          "404": {
            "description": "Campaign or number not found."
          },
          "500": {
            "description": "Internal server error. Please make sure all data (X-Account-ID header + campaign ID) is correct."
          }
        }
      }
    },
    "/api/v2/config/campaigns/follow_ups": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Campaigns"
        ],
        "summary": "List follow-up events within a date range",
        "operationId": "getFollowUpEvents",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Start of the date range as a unix timestamp",
            "example": 1640995200
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "End of the date range as a unix timestamp",
            "example": 1641081600
          }
        ],
        "responses": {
          "200": {
            "description": "List of follow-up events sorted by follow_up_timestamp in ascending order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "call_id": {
                        "type": "string",
                        "description": "The call ID associated with the follow-up"
                      },
                      "cdr_id": {
                        "type": "string",
                        "description": "The CDR ID associated with the follow-up"
                      },
                      "customer_number": {
                        "type": "string",
                        "description": "The customer phone number"
                      },
                      "queue_id": {
                        "type": "string",
                        "description": "The queue ID where the call was handled"
                      },
                      "agent_id": {
                        "type": "string",
                        "description": "The agent ID who handled the call"
                      },
                      "disposition_id": {
                        "type": "string",
                        "description": "The disposition ID applied to the call"
                      },
                      "follow_up_timestamp": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Scheduled follow-up timestamp"
                      },
                      "follow_up_notes": {
                        "type": "string",
                        "description": "Notes for the follow-up"
                      },
                      "follow_up_reason": {
                        "type": "string",
                        "description": "Why the agent scheduled it, for a follow-up scheduled by hand from a number. Absent on one born from a call's wrap-up."
                      },
                      "status": {
                        "type": "string",
                        "description": "Status of the follow-up event (e.g. pending, completed)"
                      },
                      "created": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Timestamp when the follow-up event was created"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid or missing from/to parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Campaigns"
        ],
        "summary": "Schedule a follow-up by hand, from a number, for the signed-in user",
        "description": "A follow-up with no call behind it: no CDR, call, queue or disposition. It belongs to the signed-in\nuser, never to an agent named in the body, and is delivered by the same reminder and Follow-Up\nWebSocket events as a follow-up set in a call's wrap-up. Its cdr_id is `<YYYYMM>-manual-<32 hex>`.\nRefused for an API key, and for a user working in an account other than their own (X-Account-ID).\n",
        "operationId": "createFollowUpEvent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "customer_number",
                  "follow_up_reason",
                  "follow_up_timestamp"
                ],
                "properties": {
                  "customer_number": {
                    "type": "string",
                    "description": "The number to call back. Spaces, dashes, brackets and dots are dropped; what remains must match `^\\+?[0-9*#]{2,32}$`. Stored as dialed.",
                    "example": "+27115550100"
                  },
                  "follow_up_reason": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Why the agent will call back. Required; trimmed; at most 120 characters.",
                    "example": "Send the quote"
                  },
                  "follow_up_timestamp": {
                    "type": "integer",
                    "format": "int64",
                    "description": "When to call back, unix seconds. At least one scheduler pending-check interval ahead (`cron.follow_up_pending_check_task_interval`, 5 minutes by default) and at most 365 days ahead.",
                    "example": 1792500000
                  },
                  "follow_up_notes": {
                    "type": "string",
                    "description": "Optional notes."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The stored follow-up, status pending."
          },
          "400": {
            "description": "Invalid body, number, reason or time. Body: {\"error\": \"<reason>\"}"
          },
          "401": {
            "description": "No signed-in user"
          },
          "403": {
            "description": "An API key, or a user outside the account named by X-Account-ID"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/follow_ups/mine": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Campaigns"
        ],
        "summary": "List the signed-in user's open follow-ups",
        "description": "Pending, reminded, offered and in-progress follow-ups of the signed-in user, from a wrap-up or scheduled by hand, soonest first. Same refusals as the POST.",
        "operationId": "listMyFollowUpEvents",
        "responses": {
          "200": {
            "description": "The follow-ups, sorted by follow_up_timestamp ascending; an empty array when there are none. Same item shape as the list above."
          },
          "401": {
            "description": "No signed-in user"
          },
          "403": {
            "description": "An API key, or a user outside the account named by X-Account-ID"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/follow_ups/{cdr_id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Campaigns"
        ],
        "summary": "Get a specific follow-up event by CDR ID",
        "operationId": "getFollowUpEvent",
        "parameters": [
          {
            "in": "path",
            "name": "cdr_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The CDR ID of the follow-up event"
          }
        ],
        "responses": {
          "200": {
            "description": "Follow-up event details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "call_id": {
                      "type": "string",
                      "description": "The call ID associated with the follow-up"
                    },
                    "cdr_id": {
                      "type": "string",
                      "description": "The CDR ID associated with the follow-up"
                    },
                    "customer_number": {
                      "type": "string",
                      "description": "The customer phone number"
                    },
                    "queue_id": {
                      "type": "string",
                      "description": "The queue ID where the call was handled"
                    },
                    "agent_id": {
                      "type": "string",
                      "description": "The agent ID who handled the call"
                    },
                    "disposition_id": {
                      "type": "string",
                      "description": "The disposition ID applied to the call"
                    },
                    "follow_up_timestamp": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Scheduled follow-up timestamp"
                    },
                    "follow_up_notes": {
                      "type": "string",
                      "description": "Notes for the follow-up"
                    },
                    "follow_up_reason": {
                      "type": "string",
                      "description": "Why the agent scheduled it, for a follow-up scheduled by hand from a number. Absent on one born from a call's wrap-up."
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the follow-up event (e.g. pending, completed)"
                    },
                    "created": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Timestamp when the follow-up event was created"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Follow-up event not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Campaigns"
        ],
        "summary": "Update the status of a specific follow-up event",
        "operationId": "updateFollowUpEventStatus",
        "parameters": [
          {
            "in": "path",
            "name": "cdr_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The CDR ID of the follow-up event"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "The new status for the follow-up event. Allowed transitions: pending → reminded/offered/in_progress/cancelled, reminded → offered/in_progress/cancelled, offered → in_progress/cancelled, in_progress → completed/cancelled",
                    "enum": [
                      "pending",
                      "reminded",
                      "offered",
                      "in_progress",
                      "completed",
                      "cancelled"
                    ],
                    "example": "in_progress"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Follow-up event status updated successfully. If the new status is completed or cancelled, the document is moved to the sharded database."
          },
          "400": {
            "description": "Bad request - invalid request body or missing status"
          },
          "403": {
            "description": "Forbidden - the requested status transition is not allowed from the current status, or the follow-up belongs to another user (only its own agent or an account admin may change it; API keys keep their access)"
          },
          "404": {
            "description": "Follow-up event not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/call/{id}/disposition": {
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Campaigns"
        ],
        "summary": "Edit call disposition for a specific call",
        "operationId": "editCallDisposition",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the call to edit disposition"
          },
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the account for which the call belongs"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disposition": {
                    "type": "string",
                    "description": "The disposition value for the call",
                    "example": "ANSWERED"
                  },
                  "follow_up_timestamp": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Timestamp for follow-up action",
                    "example": 1640995200
                  },
                  "follow_up_notes": {
                    "type": "string",
                    "description": "Notes for follow-up action",
                    "example": "Customer requested callback"
                  },
                  "follow_up_type": {
                    "type": "object",
                    "description": "Type of follow-up action",
                    "properties": {
                      "value": {
                        "type": "string",
                        "description": "Follow-up type value",
                        "example": "callback"
                      },
                      "label": {
                        "type": "string",
                        "description": "Follow-up type label",
                        "example": "Callback"
                      }
                    }
                  },
                  "subdisposition": {
                    "type": "object",
                    "description": "Subdisposition information (optional)",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the subdisposition"
                      },
                      "subdisposition": {
                        "type": "object",
                        "description": "Nested subdisposition object"
                      }
                    }
                  }
                },
                "required": [
                  "disposition"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Call disposition successfully updated"
          },
          "202": {
            "description": "Call disposition accepted for processing (CDR not found, stored for retry)"
          },
          "400": {
            "description": "Bad request - invalid data format"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/omnichannel/inboxes": {
      "post": {
        "tags": [
          "Omnichannel"
        ],
        "summary": "Register a new Inbox",
        "operationId": "registerInbox",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inbox_id": {
                    "type": "string",
                    "description": "ID of the new Inbox"
                  },
                  "sms": {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "description": "SMS Provider Name"
                      },
                      "did": {
                        "type": "string",
                        "description": "Phone Number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Inbox has been registered successfully",
            "content": {}
          },
          "400": {
            "description": "Request body is not valid. Bad Request",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/activation": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Zoho Integration Activation",
        "operationId": "ActivateZohoIntegration",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Authentication code generated by Zoho during the integration process"
                  },
                  "location": {
                    "type": "string",
                    "description": "Geographic location of the user that started the integration process"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Integration has been activated successfully",
            "content": {}
          },
          "400": {
            "description": "Request body is not valid. Bad Request",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/deactivation": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Zoho Integration Deactivation",
        "operationId": "DeactivateZohoIntegration",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Integration has been deactivated successfully",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/status": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Zoho Integration Status",
        "operationId": "GetZohoIntegrationStatus",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status of the integration has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "Status of the integration (activated or deactivated)"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/users/list": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Zoho Integration Users",
        "operationId": "GetZohoIntegrationUsersList",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Users list has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "last_sync": {
                      "type": "integer",
                      "description": "Unix timestamp that indicates the last users synchorization date"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "zohouser": {
                            "type": "string",
                            "description": "Zoho user unique identification"
                          },
                          "email": {
                            "type": "string",
                            "description": "Zoho user email"
                          },
                          "username": {
                            "type": "string",
                            "description": "Zoho username"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Users list could not be obtained. There is no active integration with Zoho",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/users/list/sync": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Sync Zoho users list with system users",
        "operationId": "SyncZohoIntegrationUsersList",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Users list has been synchronized successfully",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/users/{ZohoUserID}/assignment": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Assign Zoho user to a system user",
        "operationId": "AssignZohoUser",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "ZohoUserID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the Zoho user"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "required": true,
                    "description": "System user ID"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Assignation has been completed successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body. Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request body": {
                      "type": "string",
                      "description": "Reason of the invalid request body"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Zoho user is already assigned to other user of the system. Forbidden",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/users/{ZohoUserID}/assignment/auto": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Auto assign Zoho user to a system user",
        "operationId": "AutoAssignZohoUser",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "ZohoUserID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the Zoho user"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "required": true,
                    "description": "Email of the Zoho user"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Assignation has been completed successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body. Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request body": {
                      "type": "string",
                      "description": "Reason of the invalid request body"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Zoho user is already assigned to other user of the system. Forbidden",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/users/{ZohoUserID}/unassignment": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Unassign Zoho user of a system user",
        "operationId": "UnassignZohoUser",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "ZohoUserID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the Zoho user"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Unassignation has been completed successfully",
            "content": {}
          },
          "400": {
            "description": "Zoho user is not assigned to any user of the system. Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request params": {
                      "type": "string",
                      "description": "Reason of the invalid request param"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/zoho/integration/recordings/reupload/single": {
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Reupload a single recording URI to Zoho",
        "description": "Reuploads a single recording's URI to Zoho CRM. This is useful when a recording \nlink needs to be regenerated or updated in Zoho. You can specify the recording \nby either recording_id or call_id.\n",
        "operationId": "ReuploadSingleRecordingToZoho",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Account ID"
          },
          {
            "in": "query",
            "name": "recording_id",
            "schema": {
              "type": "string"
            },
            "description": "ID of the recording (format YYYYMM-xxxxx). Either recording_id or call_id is required.",
            "example": "202512-AJrKOXn30WDcEcvZswGD"
          },
          {
            "in": "query",
            "name": "call_id",
            "schema": {
              "type": "string"
            },
            "description": "ID of the call associated with the recording. Either recording_id or call_id is required.",
            "example": "18241418-4b3c-4d14-9515-df572699c2ad"
          }
        ],
        "responses": {
          "200": {
            "description": "Recording URI successfully uploaded to Zoho",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "recording_id": {
                      "type": "string",
                      "example": "202512-AJrKOXn30WDcEcvZswGD"
                    },
                    "call_id": {
                      "type": "string",
                      "example": "18241418-4b3c-4d14-9515-df572699c2ad"
                    },
                    "voice_uri": {
                      "type": "string",
                      "example": "https://example.com/api/v2/config/crm/zoho/integration/recordings/202512-AJrKOXn30WDcEcvZswGD?authorization=..."
                    },
                    "message": {
                      "type": "string",
                      "example": "Recording URI successfully uploaded to Zoho"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing required parameters or Zoho integration not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "Either recording_id or call_id parameter is required"
                    },
                    "message": {
                      "type": "string",
                      "example": "Missing required parameter"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recording not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "recording_id": {
                      "type": "string"
                    },
                    "call_id": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string",
                      "example": "Recording not found"
                    },
                    "message": {
                      "type": "string",
                      "example": "Could not find the specified recording"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Failed to upload to Zoho",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "recording_id": {
                      "type": "string"
                    },
                    "call_id": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string",
                      "example": "could not update voicemail URI in Zoho"
                    },
                    "message": {
                      "type": "string",
                      "example": "Failed to upload recording URI to Zoho"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/crm/hubspot/integration/status": {
      "put": {
        "tags": [
          "CRM"
        ],
        "summary": "Update Hubspot integration status",
        "operationId": "SetHubspotIntegrationStatus",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "required": true,
                    "description": "Status of the integration"
                  },
                  "code": {
                    "type": "string",
                    "description": "Authorization code obtained through the OAuth authentication process (it is required to enable the integration)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Hubspot integration status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "403": {
            "description": "Forbidden action. The specified integration status is already set",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "GET Hubspot integration status",
        "operationId": "GetHubspotIntegrationStatus",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hubspot integration status has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "required": true,
                      "description": "Status of the integration"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/hubspot/integration/users/list": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "GET Hubspot integration users list",
        "operationId": "GetHubspotIntegrationUsersList",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hubspot integration users list has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Hubspot user id"
                      },
                      "name": {
                        "type": "string",
                        "description": "Hubspot user full name"
                      },
                      "email": {
                        "type": "string",
                        "description": "Hubspot user email"
                      },
                      "user": {
                        "type": "string",
                        "description": "Assigned system user id"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden action. There is no integration with hubspot",
            "content": {}
          },
          "500": {
            "description": "Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/hubspot/integration/users/{userID}/assignment": {
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Assign Hubspot user with a system's user",
        "operationId": "AssignHubspotUser",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Hubspot user id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "required": true,
                    "description": "System user id"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User assignment has been completed successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "403": {
            "description": "Forbidden action. There is no integration with hubspot",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/hubspot/integration/users/{userID}/assignment/auto": {
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Auto assign Hubspot user with a system's user with the same email",
        "operationId": "AutoAssignHubspotUser",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Hubspot user id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "required": true,
                    "description": "Hubspot user email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User assignment has been completed successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "403": {
            "description": "Forbidden action. There is no integration with hubspot",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/crm/hubspot/integration/users/{userID}/unassignment": {
      "delete": {
        "tags": [
          "CRM"
        ],
        "summary": "Unassign Hubspot user of a system's user",
        "operationId": "UnassignHubspotUser",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          },
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Hubspot user id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "User unassignment has been completed successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request params",
            "content": {}
          },
          "403": {
            "description": "Forbidden action. There is no integration with hubspot",
            "content": {}
          },
          "500": {
            "description": "Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/export/tasks/{category}": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Export Tasks Configuration",
        "description": "Get export tasks configuration with a given resource /category",
        "parameters": [
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource category (for instance reports)"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the export method (for instance email)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export tasks configuration has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "export_method": {
                      "type": "object",
                      "properties": {
                        "users_activity": {
                          "allOf": [
                            {
                              "$ref": "#/components/schemas/ExportTaskConfig"
                            },
                            {
                              "example": "users_activity"
                            }
                          ]
                        },
                        "users_charges": {
                          "allOf": [
                            {
                              "$ref": "#/components/schemas/ExportTaskConfig"
                            },
                            {
                              "example": "users_charges"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Export tasks configuration could not be obtained. Invalid resource category or export method",
            "content": {}
          },
          "500": {
            "description": "Export tasks configuration could not be obtained. Internal server error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Export"
        ],
        "summary": "Export Tasks Configuration",
        "description": "Update export tasks configuration with a given resource /category",
        "parameters": [
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource category (for instance reports)"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the export method (for instance email)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "users_activity": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ExportTaskConfig"
                      },
                      {
                        "example": "users_activity"
                      }
                    ]
                  },
                  "users_charges": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ExportTaskConfig"
                      },
                      {
                        "example": "users_charges"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Export tasks configuration has been updated",
            "content": {}
          },
          "400": {
            "description": "Export tasks configuration could not be updated. Invalid resource category, export method or request body",
            "content": {}
          },
          "500": {
            "description": "Export tasks configuration could not be updated. Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Export"
        ],
        "summary": "Export Tasks Configuration",
        "description": "Delete export tasks configuration with a given resource /category/name",
        "parameters": [
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource category (for instance reports)"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the export method (for instance email)"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Export tasks configuration has been deleted",
            "content": {}
          },
          "400": {
            "description": "Export tasks configuration could not be deleted. Invalid resource category or export method",
            "content": {}
          },
          "500": {
            "description": "Export tasks configuration could not be deleted. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/export/tasks/{category}/{name}": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Export Task Configuration",
        "description": "Get export task configuration with a given resource /category/name",
        "parameters": [
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource category (for instance reports)"
            }
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource name (for instance users_activity)"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the export method (for instance email)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export task configuration has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportTaskConfig"
                }
              }
            }
          },
          "400": {
            "description": "Export task configuration could not be obtained. Invalid resource category, name or export method",
            "content": {}
          },
          "500": {
            "description": "Export task configuration could not be obtained. Internal server error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Export"
        ],
        "summary": "Export Task Configuration",
        "description": "Update export task configuration with a given resource /category/name",
        "parameters": [
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource category (for instance reports)"
            }
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource name (for instance users_activity)"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the export method (for instance email)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportTaskConfig"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Export task configuration has been updated",
            "content": {}
          },
          "400": {
            "description": "Export task configuration could not be updated. Invalid resource category, name, export method or request body",
            "content": {}
          },
          "500": {
            "description": "Export task configuration could not be updated. Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Export"
        ],
        "summary": "Export Task Configuration",
        "description": "Delete export task configuration with a given resource /category/name",
        "parameters": [
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource category (for instance reports)"
            }
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource name (for instance users_activity)"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Name of the export method (for instance email)"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Export task configuration has been deleted",
            "content": {}
          },
          "400": {
            "description": "Export task configuration could not be deleted. Invalid resource category, name or export method",
            "content": {}
          },
          "500": {
            "description": "Export task configuration could not be deleted. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/export/methods/{method}": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Export Method Configuration",
        "description": "Get given export method configuration",
        "parameters": [
          {
            "in": "path",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Export method (for instance email)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export method configuration has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportMethodEmailConfig"
                }
              }
            }
          },
          "400": {
            "description": "Export method configuration could not be obtained. Invalid export method param",
            "content": {}
          },
          "500": {
            "description": "Export method configuration could not be obtained. Internal server error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Export"
        ],
        "summary": "Export Method Configuration",
        "description": "Update given export method configuration",
        "parameters": [
          {
            "in": "path",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Export method (for instance email)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportMethodEmailConfig"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Export method configuration has been updated",
            "content": {}
          },
          "400": {
            "description": "Export method configuration could not be updated. Invalid export method param or request body",
            "content": {}
          },
          "500": {
            "description": "Export method configuration could not be updated. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/export/jobs": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Export Jobs",
        "description": "List the export jobs of the account, ordered by name",
        "parameters": [
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name of the export method. Defaults to email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export jobs have been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExportJob"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Export jobs could not be obtained. Invalid export method",
            "content": {}
          },
          "500": {
            "description": "Export jobs could not be obtained. Internal server error",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Export"
        ],
        "summary": "Export Job",
        "description": "Create an export job and schedule its tasks",
        "parameters": [
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name of the export method. Defaults to email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportJob"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Export job has been created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "400": {
            "description": "Export job could not be created. The response body states which field was rejected",
            "content": {}
          },
          "500": {
            "description": "Export job could not be created. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/export/jobs/{id}": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Export Job",
        "description": "Get a single export job",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Export job ID"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name of the export method. Defaults to email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export job has been obtained",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "404": {
            "description": "There is no export job with the given ID",
            "content": {}
          },
          "500": {
            "description": "Export job could not be obtained. Internal server error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Export"
        ],
        "summary": "Export Job",
        "description": "Update an export job and re-schedule its tasks",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Export job ID"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name of the export method. Defaults to email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportJob"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Export job has been updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "400": {
            "description": "Export job could not be updated. The response body states which field was rejected",
            "content": {}
          },
          "404": {
            "description": "There is no export job with the given ID",
            "content": {}
          },
          "500": {
            "description": "Export job could not be updated. Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Export"
        ],
        "summary": "Export Job",
        "description": "Delete an export job and cancel its scheduled tasks",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Export job ID"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name of the export method. Defaults to email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Export job has been deleted",
            "content": {}
          },
          "404": {
            "description": "There is no export job with the given ID",
            "content": {}
          },
          "500": {
            "description": "Export job could not be deleted. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/transcription": {
      "post": {
        "tags": [
          "Transcription"
        ],
        "summary": "Configure transcription settings for the specified account",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptionSettingsBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transcription settings have been updated successfully"
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "500": {
            "description": "Could not update transcription settings. Internal server error",
            "content": {}
          }
        }
      },
      "get": {
        "tags": [
          "Transcription"
        ],
        "summary": "Transcription Settings",
        "responses": {
          "200": {
            "description": "Transcription settings have been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptionSettingsBody"
                }
              }
            }
          },
          "500": {
            "description": "Could not get transcription settings. Internal server error",
            "content": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Transcription"
        ],
        "summary": "Transcription Settings",
        "responses": {
          "200": {
            "description": "Transcription settings have been deleted successfully"
          },
          "500": {
            "description": "Could not delete transcription settings. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/transcription/new": {
      "post": {
        "tags": [
          "Transcription"
        ],
        "summary": "New Transcription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resource_type": {
                    "type": "string",
                    "required": true,
                    "description": "Type of resource (call_recording, voicemail)"
                  },
                  "resource_id": {
                    "type": "string",
                    "required": true,
                    "description": "ID of the specified resource"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The specified audio resource has been transcripted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string",
                      "required": true,
                      "description": "Pre-recorded audio transcriptor"
                    },
                    "transcription": {
                      "type": "object",
                      "properties": {
                        "raw": {
                          "type": "object"
                        },
                        "formatted": {
                          "type": "string",
                          "required": true,
                          "description": "Pre-recorded audio transcription formatted"
                        },
                        "summary": {
                          "type": "string",
                          "required": true,
                          "description": "Pre-recorded audio summarized transcription"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "403": {
            "description": "Pre-recorded audio transcription feature is not available for the specified account",
            "content": {}
          },
          "500": {
            "description": "Could not transcript the specified audio resource. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/transcription/content/formatted": {
      "get": {
        "tags": [
          "Transcription"
        ],
        "summary": "Formatted Transcription",
        "parameters": [
          {
            "in": "query",
            "name": "resource_type",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Type of resource (call_recording, voicemail)"
            }
          },
          {
            "in": "query",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the specified resource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Formatted transcription has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transcription": {
                      "type": "object",
                      "properties": {
                        "formatted": {
                          "type": "string",
                          "required": true,
                          "description": "Formatted transcription of the specified audio resource"
                        },
                        "summary": {
                          "type": "string",
                          "required": true,
                          "description": "Summarized transcription of the specified audio resource"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "403": {
            "description": "Pre-recorded audio transcription feature is not available for the specified account",
            "content": {}
          },
          "500": {
            "description": "Could not get the formatted transcription .txt file. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/transcription/content/raw": {
      "get": {
        "tags": [
          "Transcription"
        ],
        "summary": "Raw Transcription",
        "parameters": [
          {
            "in": "query",
            "name": "resource_type",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Type of resource (call_recording, voicemail)"
            }
          },
          {
            "in": "query",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the specified resource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Raw transcription has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transcription": {
                      "type": "object",
                      "properties": {
                        "raw": {
                          "type": "object",
                          "required": true,
                          "description": "Raw transcription object of the specified audio resource"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {}
          },
          "403": {
            "description": "Pre-recorded audio transcription feature is not available for the specified account",
            "content": {}
          },
          "500": {
            "description": "Could not get raw transcription. Internal server error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/status/registrations": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Current Registrations",
        "parameters": [
          {
            "in": "header",
            "name": "X-Account-ID",
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Registrations has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Registrations"
                }
              }
            }
          },
          "500": {
            "description": "Could not get current registrations. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/config/ip/whitelist": {
      "post": {
        "tags": [
          "IP Whitelisting"
        ],
        "summary": "Add IP to whitelist",
        "description": "Adds an IP address to the whitelist.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/addToWhitelistRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "IP added successfully"
          },
          "400": {
            "description": "Bad request - invalid input"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "get": {
        "tags": [
          "IP Whitelisting"
        ],
        "summary": "Retrieve all whitelisted IP addresses",
        "description": "Retrieves metadata for all whitelisted IP addresses.",
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/whitelistedIPResponse"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/ip/whitelist/{ip}": {
      "put": {
        "tags": [
          "IP Whitelisting"
        ],
        "summary": "Edit whitelisted IP",
        "description": "Edits metadata for a whitelisted IP address.",
        "parameters": [
          {
            "name": "ip",
            "in": "path",
            "description": "IP address to edit",
            "required": true,
            "type": "string"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/editIPInWhitelistRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "IP metadata edited successfully"
          },
          "400": {
            "description": "Bad request - invalid input"
          },
          "404": {
            "description": "IP address not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "delete": {
        "tags": [
          "IP Whitelisting"
        ],
        "summary": "Delete IP from whitelist",
        "description": "Deletes an IP address from the whitelist.",
        "parameters": [
          {
            "name": "ip",
            "in": "path",
            "description": "IP address to delete",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "IP deleted successfully"
          },
          "404": {
            "description": "IP address not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "get": {
        "tags": [
          "IP Whitelisting"
        ],
        "summary": "Get whitelisted IP",
        "description": "Retrieves metadata for a whitelisted IP address.",
        "parameters": [
          {
            "name": "ip",
            "in": "path",
            "description": "IP address to retrieve",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/whitelistedIPResponse"
                }
              }
            }
          },
          "404": {
            "description": "IP address not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/provisioning/mac/{mac}": {
      "get": {
        "tags": [
          "Provisioning"
        ],
        "summary": "Check if MAC address exists",
        "description": "Check if the specified MAC address exists in the database for the given account ID.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "mac",
            "in": "path",
            "description": "MAC address to check",
            "required": true,
            "type": "string"
          },
          {
            "name": "X-Account-ID",
            "in": "header",
            "description": "Account ID header",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns true if MAC address exists, false otherwise",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/provisioning/phones": {
      "post": {
        "summary": "Create a new phone entry",
        "description": "Creates a new phone entry with the provided information.\n",
        "tags": [
          "Provisioning"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "description": "Phone creation request body",
              "required": true,
              "schema": {
                "$ref": "#/components/schemas/CreatePhoneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Phone created successfully",
            "schema": {
              "$ref": "#/definitions/PhoneCreatedResponse"
            }
          },
          "400": {
            "description": "Bad request. Indicates a validation or input error.",
            "schema": {
              "$ref": "#/definitions/BadRequestError"
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/reports/user_stats_for_tenant": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get user activity stats for a tenant",
        "description": "Retrieves user activity statistics for a specific tenant based on the provided parameters.\n\n**Note:** Ensure that the necessary authentication headers are included in the request.\n",
        "parameters": [
          {
            "in": "query",
            "name": "timeRange",
            "description": "Time range for the activity stats (e.g., \"1h\", \"2d\", \"3w\")",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "startDate",
            "description": "Start date in Unix timestamp format",
            "schema": {
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "endDate",
            "description": "End date in Unix timestamp format",
            "schema": {
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "pageSize",
            "description": "Set the page size for results (defaults to 250)",
            "schema": {
              "type": "integer",
              "default": 250
            },
            "required": false
          },
          {
            "in": "query",
            "name": "startKey",
            "description": "Start key for pagination (to fetch results for 2nd page and beyond)",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "description": "Document ID of the next document (to be filled with info from the 1st request)",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with user activity stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "description": "List of user activity summary values",
                      "items": {
                        "$ref": "#/components/schemas/UserActivitySummaryValue"
                      }
                    },
                    "next_start_key": {
                      "type": "any",
                      "description": "Next start key for pagination"
                    },
                    "next_start_doc_id": {
                      "type": "string",
                      "description": "Next start document ID for pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/reports/live_recordings/{call_id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Live Recording Audio",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/feature-bundles/features-list": {
      "get": {
        "summary": "Get Features List",
        "description": "Retrieve the list of features available in the system.",
        "operationId": "getFeaturesList",
        "tags": [
          "Feature Bundles"
        ],
        "responses": {
          "200": {
            "description": "A list of features available in the system.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "features": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "example": {
                        "featureA": "typeA",
                        "featureB": "typeB"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/feature-bundles": {
      "post": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Create a new feature bundle",
        "description": "Creates a new feature bundle with the provided features.",
        "requestBody": {
          "description": "Feature bundle object that needs to be created",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeaturesBundleDocPublicFields"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Feature bundle created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "get": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Get all feature bundles",
        "description": "Retrieves all feature bundles.",
        "responses": {
          "200": {
            "description": "Returns a map of Feature bundles with IDs as keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/FeaturesBundleDocPublicFields"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/feature-bundles/{id}": {
      "get": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Get a feature bundle",
        "description": "Retrieves a feature bundle by its ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature bundle retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeaturesBundleDocPublicFields"
                }
              }
            }
          },
          "404": {
            "description": "Feature bundle not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "put": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Update a feature bundle",
        "description": "Updates an existing feature bundle with new features.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Updated feature bundle object",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeaturesBundleDocPublicFields"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Feature bundle updated"
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Feature bundle not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "delete": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Delete a feature bundle",
        "description": "Deletes a feature bundle by its ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Feature bundle deleted"
          },
          "404": {
            "description": "Feature bundle not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/feature-plans": {
      "post": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "New Feature Plan",
        "description": "Creates a new feature plan with the provided features.",
        "requestBody": {
          "description": "Feature plan object that needs to be created",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeaturesPlanDocPublicFields"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Feature plan created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "get": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "All Feature Plans",
        "description": "Retrieves all feature plans.",
        "responses": {
          "200": {
            "description": "Returns Feature plans mapped by id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/FeaturesPlanDocPublicFields"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/config/feature-plans/{id}": {
      "get": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Feature Plan",
        "description": "Retrieves a feature plan by its ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature bundle retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeaturesPlanDocPublicFields"
                }
              }
            }
          },
          "404": {
            "description": "Feature bundle not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "put": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Feature Plan",
        "description": "Updates an existing feature bundle with new features.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Updated feature bundle object",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeaturesPlanDocPublicFields"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Feature bundle updated"
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Feature bundle not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      },
      "delete": {
        "tags": [
          "Feature Bundles"
        ],
        "summary": "Feature Plan",
        "description": "Deletes a feature bundle by its ID. Feature plan can't be deleted in case there are users assigned to it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Feature bundle deleted"
          },
          "404": {
            "description": "Feature bundle not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/callcenter/destination/{destination}/available": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Check if destination is available",
        "responses": {
          "200": {
            "description": "Successfully checked destination availability.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                },
                "example": {
                  "destination1": true
                }
              }
            }
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/api/v2/system/tasks": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "List tasks of the account",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "description": "Task Status (active or inactive)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account task's have been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tasks"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "401": {
            "description": "Unauthorized (only the super duper admin can access to this resource)",
            "content": {}
          },
          "500": {
            "description": "Account task's could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/system/tasks/group/{group}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "List tasks of the account by group",
        "parameters": [
          {
            "in": "path",
            "name": "group",
            "description": "Task Group",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "description": "Task Status (active or inactive)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account task's have been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tasks"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "401": {
            "description": "Unauthorized (only the super duper admin can access to this resource)",
            "content": {}
          },
          "500": {
            "description": "Account task's could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/system/tasks/group/{group}/category/{category}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "List tasks of the account by group and category",
        "parameters": [
          {
            "in": "path",
            "name": "group",
            "description": "Task Group",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category",
            "description": "Task Category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "description": "Task Status (active or inactive)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account task's have been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tasks"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "401": {
            "description": "Unauthorized (only the super duper admin can access to this resource)",
            "content": {}
          },
          "500": {
            "description": "Account task's could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/system/tasks/group/{group}/category/{category}/name/{name}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Get task by name",
        "parameters": [
          {
            "in": "path",
            "name": "group",
            "description": "Task Group",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category",
            "description": "Task Category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "description": "Task Name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task has been obtained successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "401": {
            "description": "Unauthorized (only the super duper admin can access to this resource)",
            "content": {}
          },
          "500": {
            "description": "Task could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      },
      "put": {
        "tags": [
          "Tasks"
        ],
        "summary": "Update task status",
        "parameters": [
          {
            "in": "path",
            "name": "group",
            "description": "Task Group",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category",
            "description": "Task Category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "description": "Task Name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "required": true,
                    "description": "Action that will affect the task status (schedule, re_schedule or cancel)"
                  },
                  "interval": {
                    "type": "string",
                    "description": "Task execution frequency"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Task status has been updated successfully",
            "content": {}
          },
          "400": {
            "description": "Bad Request",
            "content": {}
          },
          "401": {
            "description": "Unauthorized (only the super duper admin can access to this resource)",
            "content": {}
          },
          "403": {
            "description": "Forbidden",
            "content": {}
          },
          "500": {
            "description": "Task could not be obtained. Internal Server Error",
            "content": {}
          }
        }
      }
    },
    "/api/v2/agents": {
      "get": {
        "summary": "All Agents",
        "operationId": "getAgents",
        "tags": [
          "AI Agents"
        ],
        "responses": {
          "200": {
            "description": "List of agents retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIAgent"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "post": {
        "summary": "Create Agent",
        "operationId": "createAgent",
        "tags": [
          "AI Agents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TAgentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the newly created agent."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/v2/agents/{id}": {
      "get": {
        "summary": "Agent by ID",
        "operationId": "getAgent",
        "tags": [
          "AI Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the agent to retrieve."
          }
        ],
        "responses": {
          "200": {
            "description": "Agent details retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIAgent"
                }
              }
            }
          },
          "404": {
            "description": "Agent not found"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "put": {
        "summary": "Update Agent",
        "operationId": "updateAgent",
        "tags": [
          "AI Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the agent to update."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TAgentRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Agent updated successfully."
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Agent not found"
          },
          "500": {
            "description": "Server error"
          }
        }
      },
      "delete": {
        "summary": "Agent",
        "operationId": "deleteAgent",
        "tags": [
          "AI Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the agent to delete."
          }
        ],
        "responses": {
          "204": {
            "description": "Agent deleted successfully."
          },
          "404": {
            "description": "Agent not found"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/ucp/v2/callcenter/agent/state": {
      "get": {
        "tags": [
          "Call Center"
        ],
        "summary": "Get the current state of the logged-in agent",
        "operationId": "getAgentState",
        "responses": {
          "200": {
            "description": "Agent state successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "description": "Current state of the agent"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/ucp/v2/callcenter/agent/state/{uuid}": {
      "put": {
        "tags": [
          "Call Center"
        ],
        "summary": "Set the state of the logged-in agent",
        "operationId": "setAgentState",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The state UUID to set for the agent"
          }
        ],
        "responses": {
          "200": {
            "description": "Agent state successfully updated"
          },
          "400": {
            "description": "Bad request - invalid state UUID"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v2/presence/message": {
      "post": {
        "tags": [
          "Presence"
        ],
        "summary": "Send message to agent",
        "description": "Sends a message to a specific agent via WebSocket. The agent can be identified by either agent_id or agent_extension. Currently supports pop-up notifications, but can be extended for other message types.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "X-Account-ID",
            "in": "header",
            "required": true,
            "description": "Account identifier",
            "schema": {
              "type": "string"
            },
            "example": "507f1f77bcf86cd799439011"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event",
                  "type",
                  "title"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Unique identifier for the message (optional)",
                    "example": "uuid"
                  },
                  "event": {
                    "type": "string",
                    "description": "Event type identifier",
                    "example": "pop_up"
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of follow-up",
                    "example": "follow_up"
                  },
                  "action": {
                    "type": "object",
                    "description": "Action configuration for the message",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Action type (dial, SMS, HTTP link, default is dial)",
                        "example": "dial"
                      },
                      "label": {
                        "type": "string",
                        "description": "Custom button label (default is the type value)",
                        "example": "Call customer"
                      },
                      "allow_dismiss": {
                        "type": "boolean",
                        "description": "Whether to allow dismissing the message",
                        "example": true
                      }
                    }
                  },
                  "title": {
                    "type": "string",
                    "description": "Title of the pop-up notification",
                    "example": "Follow UP"
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "Phone number associated with the follow-up",
                    "example": "+14798798797"
                  },
                  "follow_up_type": {
                    "type": "string",
                    "description": "Type of follow-up action",
                    "example": "2"
                  },
                  "follow_up_note": {
                    "type": "string",
                    "description": "Additional notes for the follow-up",
                    "example": "follow up note"
                  },
                  "message": {
                    "type": "string",
                    "description": "Custom message to display",
                    "example": "Some custom message: we need to call this customer. He wants a Premium subscription"
                  },
                  "agent_id": {
                    "type": "string",
                    "description": "Agent ID to target (optional if agent_extension is provided)",
                    "example": "507f1f77bcf86cd799439012"
                  },
                  "agent_extension": {
                    "type": "string",
                    "description": "Agent extension to target (optional if agent_id is provided)",
                    "example": "003"
                  },
                  "ui": {
                    "type": "object",
                    "description": "UI configuration for the message",
                    "properties": {
                      "colour": {
                        "type": "string",
                        "description": "Color of the UI element",
                        "example": "#465421"
                      },
                      "height": {
                        "type": "integer",
                        "description": "Height of the UI element",
                        "example": 120
                      },
                      "width": {
                        "type": "integer",
                        "description": "Width of the UI element",
                        "example": 120
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "uuid",
                "event": "pop_up",
                "type": "follow_up",
                "action": {
                  "type": "dial",
                  "label": "Call customer",
                  "allow_dismiss": true
                },
                "title": "Follow UP",
                "phone_number": "+14798798797",
                "follow_up_type": "2",
                "follow_up_note": "follow up note",
                "message": "Some custom message: we need to call this customer. He wants a Premium subscription",
                "agent_id": "",
                "agent_extension": "003",
                "ui": {
                  "colour": "#465421",
                  "height": 120,
                  "width": 120
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pop-up notification sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "example": {
                  "status": "success"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required fields or invalid data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - user does not have permission to send pop-ups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/config/account/simple": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns a list of descendant accounts for the given account ID",
        "operationId": "getSimpleDescendantAccounts",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/webhook/callevents": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns Call event webhooks configuration",
        "operationId": "getCallEventWebhooks",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCCallEventWebHook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Handles HTTP subscription requests",
        "operationId": "webhookSubscriptionHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionInfo"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/webhook/debug": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Debug webhook received handler",
        "operationId": "debugWebhookReceivedHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Debug webhook received handler",
        "operationId": "debugWebhookReceivedHandlerConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Debug webhook received handler",
        "operationId": "debugWebhookReceivedHandlerPut",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/agent_state": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Feature Agent State",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAgentStateFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set agent state feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setAgentStateFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/ai": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get portal ai feature",
        "operationId": "getPortalAIFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/portalModuleEnabledBody"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set portal ai feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setPortalAIFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/portalModuleEnabledBody"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/ai_assist": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get feature ai assist",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getFeatureAIAssist",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set feature ai assist",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setFeatureAIAssist",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/auto_answer_c2c": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Feature Auto Answer C2C",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAutoAnswerC2CFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set auto answer c2c feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setAutoAnswerC2CFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/auto_logout_queues": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Feature Auto Logout Queues On Unavailable GET returns the DISABLED state (bare bool), mirroring GetAgentSta...",
        "description": "Feature Auto Logout Queues On Unavailable GET returns the DISABLED state (bare bool), mirroring GetAgentStateFeature: disabled == !account.GetUCPAutoLogoutQueuesOnUnavailable(). The disabled ↔ stored-positive negation is owned solely here (contract: Mapping ownership).\n\nRequires an account admin (or an API key).",
        "operationId": "getAutoLogoutQueuesFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "PUT body: { \"disabled\": bool }",
        "description": "PUT body: { \"disabled\": bool }. The stored field is the negation: AutoLogoutQueuesOnUnavailable = !body.Disabled.\n\nRequires an account admin (or an API key).",
        "operationId": "setAutoLogoutQueuesFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/autoprovision": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get autoprovision feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAutoprovisionFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCAutoProvision"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set autoprovision feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setAutoprovisionFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/call_rate": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Feature Call Rate",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getCallRateFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set call rate feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setCallRateFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/calls": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Feature Calls",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getCallsFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCCallsSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set calls feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setCallsFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/chat": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get chat feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getChatFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set chat feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setChatFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/collaboration": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get collaboration feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getCollaborationFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set collaboration feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setCollaborationFeatureConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/contact_center": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get contact center feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getContactCenterFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set contact center feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setContactCenterFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/crm": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get portal crm feature",
        "operationId": "getPortalCRMFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/portalModuleEnabledBody"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set portal crm feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setPortalCRMFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/portalModuleEnabledBody"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/desk_center": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get desk center feature",
        "operationId": "getDeskCenterFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deskCenterBody"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set desk center feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setDeskCenterFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deskCenterBody"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/desk_center/storage": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Answers how full one child account's Desk Center is",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getDeskStorage",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deskStorageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/did_assignment": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Enable did assignment",
        "operationId": "enableDidAssignment",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/did_management": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get did management feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getDIDManagementFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/google": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get google feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getGoogleFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/mcp": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Answers the account's portal MCP settings",
        "description": "Answers the account's portal MCP settings. On unless turned off, like the portal modules.",
        "operationId": "getMCPFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/mcpFeatureBody"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Turns the portal MCP on or off for the account and, when users is sent, replaces its per-user limits",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setMCPFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/mcpFeatureBody"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/meetings": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get meetings feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getMeetingsFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meetings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set meetings feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setMeetingsFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Meetings"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/microsoft": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get microsoft feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getMicrosoftFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/queues": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set queues feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setQueuesFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/reports": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns the Analytics reporting preferences of an account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getReportsFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agent_name_format": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Stores the Analytics reporting preferences of an account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setReportsFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_name_format": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/reseller_billing": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get reseller billing feature",
        "operationId": "getResellerBillingFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set reseller billing feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setResellerBillingFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/resellerBillingFeatureBody"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/ucp_click2call": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Feature UCP click2call",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getUCPClickToCallFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Set ucp click to call feature",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setUCPClickToCallFeature",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{accountID}/feature/wholesale_provider": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns a reseller's settings, the platform providers it can be set to, and what it inherits when none is set",
        "operationId": "getWholesaleProvider",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Sets a reseller's provider",
        "description": "Sets a reseller's provider. provider_id names a platform provider and empty inherits from above; id is the older catalog-only form. A request with neither leaves the provider as it is.",
        "operationId": "setWholesaleProvider",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "core_locations": {
                    "type": "boolean"
                  },
                  "id": {
                    "type": "string"
                  },
                  "provider_id": {
                    "type": "string"
                  },
                  "show_carrier": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{account_id}/location_prefix": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Gives an organization or a location its prefix and links it with the rest of the organization, so its membe...",
        "description": "Gives an organization or a location its prefix and links it with the rest of the organization, so its members dial each other by prefix + extension. Only the reseller above it (or a super admin) may.",
        "operationId": "setLocationPrefixConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/locationPrefixRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/locationPrefixResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{account_id}/location_prefixes": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Lists the organization and its locations with their prefix and whether location dialing is on",
        "operationId": "getLocationPrefixes",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Saves the table",
        "description": "Saves the table. Every problem is found before anything is written: a refused save changes nothing. An accepted one runs as a job, one visit per account, and answers with the job to follow.",
        "operationId": "putLocationPrefixes",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/locationPrefixesBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{account_id}/location_prefixes/job": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Reports the last save's progress",
        "operationId": "getLocationPrefixesJob",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/account/{account_id}/service_plans": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Adds or deletes services to an account",
        "description": "Requires the X-Account-ID header.",
        "operationId": "editAccountServices",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/children": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns a list with account and children accounts of account",
        "description": "Returns a list with account and children accounts of account. Not grandchildren.",
        "operationId": "getAccountsChildren",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/childrenAccount"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/desk_center/storage": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Answers for several accounts at once",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getDeskStorageBulk",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deskStorageBulkBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/enabled": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns whether the current user has admin privileges",
        "operationId": "getAccountsEnabled",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/import": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Checks the account, user and number files of an import and, unless dry_run is set or a file has a problem, ...",
        "description": "Checks the account, user and number files of an import and, unless dry_run is set or a file has a problem, starts creating them. It answers the check and, when started, the job id to follow it with.",
        "operationId": "importAccountsConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/accountImportCheck"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/import/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Reports an import's progress",
        "operationId": "getAccountImportConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/service_plans/reconcile": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Reconciliates services for all descendant accounts",
        "description": "Requires the X-Account-ID header.",
        "operationId": "reconciliateAllAccountServices",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/start_disa": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Enables DISA process on server",
        "operationId": "startDisaProcess",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get account",
        "operationId": "getAccount",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "_id": {
                      "type": "string"
                    },
                    "_rev": {
                      "type": "string"
                    },
                    "billing_mode": {
                      "type": "string"
                    },
                    "call_recording": {
                      "$ref": "#/components/schemas/CallRecording"
                    },
                    "call_restriction": {
                      "$ref": "#/components/schemas/CallRestriction"
                    },
                    "caller_id": {
                      "$ref": "#/components/schemas/DatabaseCallerID"
                    },
                    "cdr": {
                      "$ref": "#/components/schemas/AccountCDRSettings"
                    },
                    "contact": {
                      "$ref": "#/components/schemas/DatabaseContact"
                    },
                    "created": {
                      "type": "integer"
                    },
                    "dial_plan": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "dial_plan_rules_list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/dialPlanRuleInput"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "fonoUC": {
                      "$ref": "#/components/schemas/FonoUCAccount"
                    },
                    "interaccount": {
                      "$ref": "#/components/schemas/Interaccount"
                    },
                    "is_reseller": {
                      "type": "boolean"
                    },
                    "metaflows": {
                      "$ref": "#/components/schemas/Metaflows"
                    },
                    "music_on_hold": {
                      "$ref": "#/components/schemas/MusicOnHold"
                    },
                    "notifications": {
                      "$ref": "#/components/schemas/Notifications"
                    },
                    "numbers_features": {
                      "$ref": "#/components/schemas/NumbersFeatures"
                    },
                    "prefer_onnet": {
                      "type": "boolean",
                      "description": "PreferOnnet routes a call to a number on this platform locally instead of through the carrier."
                    },
                    "preflow": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "pvt_account_db": {
                      "type": "string"
                    },
                    "pvt_account_id": {
                      "type": "string"
                    },
                    "pvt_alphanum_name": {
                      "type": "string"
                    },
                    "pvt_deleted": {
                      "type": "boolean",
                      "description": "Kazoo's soft delete: the document stays in `accounts`, marked"
                    },
                    "pvt_enabled": {
                      "type": "boolean"
                    },
                    "pvt_reseller": {
                      "type": "boolean"
                    },
                    "pvt_superduper_admin": {
                      "type": "boolean"
                    },
                    "pvt_tree": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "pvt_wnm_allow_additions": {
                      "type": "boolean"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "reseller_id": {
                      "type": "string"
                    },
                    "ringtones": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "topup": {
                      "$ref": "#/components/schemas/Topup"
                    },
                    "ui_restrictions": {
                      "$ref": "#/components/schemas/UIRestrictions"
                    },
                    "wnm_allow_additions": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "summary": "Deletes a specified account through crossbar api",
        "operationId": "deleteAccount",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/billing": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get account billing",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAccountBilling",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FonoUCAccountBilling"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/call_response": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Lists every cause for a tenant: inherited (cluster) value, tenant override if any, and the effective value",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAccountCallResponses",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/callResponseListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/call_response/reset": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Removes the tenant override for one cause, or the whole overlay when {cause} is absent (the /reset route), ...",
        "description": "Removes the tenant override for one cause, or the whole overlay when {cause} is absent (the /reset route), so the tenant inherits the cluster value again.\n\nRequires an account admin (or an API key).",
        "operationId": "resetAccountCallResponse",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/call_response/{cause}": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Sets a tenant override for one cause",
        "description": "Requires an account admin (or an API key).",
        "operationId": "updateAccountCallResponse",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cause",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "summary": "Removes the tenant override for one cause, or the whole overlay when {cause} is absent (the /reset route), ...",
        "description": "Removes the tenant override for one cause, or the whole overlay when {cause} is absent (the /reset route), so the tenant inherits the cluster value again.\n\nRequires an account admin (or an API key).",
        "operationId": "resetAccountCallResponseConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cause",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/limits": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get account limits",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAccountLimits",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitsData"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Will modify trunk limits of specified account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "editAccountLimits",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/APILimits"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/number_manager": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Returns tenant reconcile_regex overlay vs cluster inherit",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAccountNumberManager",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/accountNumberManagerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Sets or clears the tenant reconcile_regex overlay",
        "description": "Requires an account admin (or an API key).",
        "operationId": "updateAccountNumberManager",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/accounts/{id}/service_plan": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get account service plan",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getAccountServicePlan",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/addressbook/convert": {
      "post": {
        "tags": [
          "Addressbook"
        ],
        "summary": "Creates a CRM contact in Desk from a speed dial entry and links them",
        "description": "Creates a CRM contact in Desk from a speed dial entry and links them. An account without Desk Center has no CRM.",
        "operationId": "convertToContact",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entry_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/agents": {
      "post": {
        "tags": [
          "Queues"
        ],
        "summary": "Create agent",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "createAgentConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "persona_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/agents/{agent_id}": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "Get agents",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "getAgentsConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Queues"
        ],
        "summary": "Remove agent",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "removeAgent",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/blacklists": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "Lists all blacklists of the account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getBlacklists",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Blacklist"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/call_rating_reasons": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "Get call rating reasons",
        "operationId": "getCallRatingReasons",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Queues"
        ],
        "summary": "Create call rating reason",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "createCallRatingReason",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/callRatingReasonRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/call_rating_reasons/{id}": {
      "get": {
        "tags": [
          "Queues"
        ],
        "summary": "Get call rating reason",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "getCallRatingReason",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Queues"
        ],
        "summary": "Edit call rating reason",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "editCallRatingReason",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/callRatingReasonRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Queues"
        ],
        "summary": "Delete call rating reason",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "deleteCallRatingReason",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/call/{id}/attended-transfer": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Records an attended transfer UI confirmation for a call (monthly account DB)",
        "operationId": "attendedTransferHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q_headers": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "user_id": {
                    "type": "string"
                  },
                  "uuid_a": {
                    "type": "string"
                  },
                  "uuid_b": {
                    "type": "string"
                  },
                  "uuid_c": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/call/{id}/conference-transfer": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Records a 3-way / conference merge confirmation for a call (monthly account DB)",
        "operationId": "conferenceTransferHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q_headers": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "user_id": {
                    "type": "string"
                  },
                  "uuid_a": {
                    "type": "string"
                  },
                  "uuid_b": {
                    "type": "string"
                  },
                  "uuid_c": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/call/{id}/disposition-render": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Disposition render handler",
        "operationId": "dispositionRenderHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disposition_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "disposition_render": {
                    "type": "boolean"
                  },
                  "q_headers": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "user_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/dispositions": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Get dispositions",
        "operationId": "getDispositions",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create disposition",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "createDisposition",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/newDispositionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Delete disposition",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "deleteDisposition",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "title",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/dispositions/cache/preload": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Preloads all dispositions for the current account",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "preloadDispositions",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/dispositions/cache/stats": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Returns cache statistics for monitoring",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "getDispositionCacheStats",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v2/config/campaigns/dispositions/{id}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Get disposition",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "getDisposition",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Edit disposition",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "editDisposition",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/newDispositionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/dispositions/{id}/desk-target": {
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Writes ONLY the Desk Center target",
        "description": "Writes ONLY the Desk Center target. Load, change one field, store. Every other field arrives from the stored document and leaves unread — which is the property, and the one that EditDisposition cannot offer.\n\nRequires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "setDispositionDeskTarget",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deskTargetBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/leads/{leadID}/reset": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Reset campaign lead",
        "operationId": "resetCampaignLead",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "leadID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/leads/{leadID}/status/{status}": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Set lead status",
        "description": "Requires the X-Account-ID header.",
        "operationId": "setLeadStatus",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "leadID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/{id}/greeting/tts": {
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Synthesizes text to an MP3 and stores it as the campaign greeting",
        "description": "Synthesizes text to an MP3 and stores it as the campaign greeting. A running campaign is stopped and started so the dialer reloads the new file.",
        "operationId": "replaceCampaignGreetingTTS",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "voice": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/campaigns/{id}/leads/csv": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Get all campaign leads csv",
        "operationId": "getAllCampaignLeadsCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "next_start_key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "next_start_key_doc_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "number",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/conferences": {
      "get": {
        "tags": [
          "Conferences"
        ],
        "summary": "Lists all conferences of the account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getConferences",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/conferenceItem"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/devices": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get devices",
        "operationId": "getDevices",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "include_docs",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/directories": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "Lists all directories of the account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getDirectories",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/directoryData"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/extension/free": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Generate valid extensions",
        "operationId": "generateValidExtensions",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "408": {
            "description": "Request Timeout"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/locations/global": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Returns the working account's main E911, read only",
        "description": "Returns the working account's main E911, read only. It is edited through its Location.",
        "operationId": "getGlobalE911",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalE911"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/locations/global/confirm": {
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Marks the working account's Global E911 as set up at its carrier, or clears the mark",
        "description": "Marks the working account's Global E911 as set up at its carrier, or clears the mark. Account and reseller admins, and superadmins.",
        "operationId": "confirmGlobalE911",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalE911"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/locations/validate_address": {
      "post": {
        "tags": [
          "Locations"
        ],
        "summary": "Checks a Location's E911 address at BulkVS while it is being typed, before the save registers it",
        "description": "Checks a Location's E911 address at BulkVS while it is being typed, before the save registers it. It answers the address as BulkVS will store it (\"validated\"), the reason BulkVS refused it (\"invalid\"), or \"unavailable\" when the working account does not buy its numbers on BulkVS. It writes nothing.",
        "operationId": "validateLocationAddress",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "$ref": "#/components/schemas/DatabaseAddress"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/menus": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "Lists all menus of the account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getMenus",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Menu"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/moh": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "List",
        "description": "Requires an account admin (or an API key).",
        "operationId": "list",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MOH"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/moh/tts": {
      "post": {
        "tags": [
          "Callflows"
        ],
        "summary": "Creates MOH media via Kazoo TTS (same payload as Monster UI media_source=tts)",
        "description": "Requires an account admin (or an API key).",
        "operationId": "createTTS",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "voice": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/moh/{id}": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "Get",
        "description": "Requires an account admin (or an API key).",
        "operationId": "get",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Callflows"
        ],
        "summary": "Create",
        "description": "Requires an account admin (or an API key).",
        "operationId": "create",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Callflows"
        ],
        "summary": "Remove",
        "description": "Requires an account admin (or an API key).",
        "operationId": "remove",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/number/search/{phone_number}": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Request number information to crossbar and if it exists returns it",
        "operationId": "searchNumber",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "phone_number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/numberSearchAPI"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/available": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Search wholesale numbers",
        "operationId": "searchWholesaleNumbers",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "area_code",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "beta",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contains",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "distance",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exclude_address_required",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exclude_foreign_address_required",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exclude_local_address_required",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fax",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lata",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locality",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mms",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "near_lat_long",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "near_number",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "number_type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "postal_code",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "rate_center",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sms",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voice",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/numbers/buy/status": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Reports whether this caller can open Buy Numbers",
        "operationId": "buyNumbersStatus",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/db/sync/{id}": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Receives and order to synchronize phone numbers in account",
        "operationId": "syncNumbersConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/main": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Return main numbers available for x-account-id",
        "operationId": "getMainNumbers",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns every numbers provider of the account",
        "description": "Returns every numbers provider of the account. A superadmin-only provider is left out for anyone else.\n\nRequires an account admin (or an API key).",
        "operationId": "listNumbersProviders",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NumbersProviderAPIResponse"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Adds a numbers provider to the account",
        "description": "Adds a numbers provider to the account. The first provider becomes the active one; adding a second keeps the existing one active.\n\nRequires an account admin (or an API key).",
        "operationId": "createNumbersProvider",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumbersProviderAPI"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumbersProviderAPIResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/backfill": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Records the provider on existing wholesale numbers, superadmin only",
        "description": "Records the provider on existing wholesale numbers, superadmin only. ?apply=true writes; otherwise it only reports.\n\nRequires an account admin (or an API key).",
        "operationId": "backfillNumberStamps",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "apply",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackfillResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/cnam": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Lists the BulkVS numbers in reach with their CNAM add-on",
        "description": "Lists the BulkVS numbers in reach with their CNAM add-on. It never calls the carrier.\n\nRequires an account admin (or an API key).",
        "operationId": "getCNAM",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/cnam/{number}": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Turns a number's CNAM add-on on with a name, or off",
        "description": "Turns a number's CNAM add-on on with a name, or off. BulkVS bills the change.\n\nRequires an account admin (or an API key).",
        "operationId": "setCNAM",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberCNAM"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/cnam/{number}/check": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Reads the caller name BulkVS holds for a number",
        "description": "Reads the caller name BulkVS holds for a number. Free.\n\nRequires an account admin (or an API key).",
        "operationId": "checkCNAM",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberCNAM"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/e911": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Lists BulkVS numbers with their E911 and the cached carrier record: every one for the superadmin, its tree ...",
        "description": "Lists BulkVS numbers with their E911 and the cached carrier record: every one for the superadmin, its tree for a reseller. It never calls the carrier.\n\nRequires an account admin (or an API key).",
        "operationId": "getE911Checks",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/E911Check"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/e911/check": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Reads every BulkVS number's record at the carrier and caches it: every number for the superadmin, its tree'...",
        "description": "Reads every BulkVS number's record at the carrier and caches it: every number for the superadmin, its tree's for a reseller.\n\nRequires an account admin (or an API key).",
        "operationId": "checkAllE911",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/E911Check"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/e911/{number}/check": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Reads one BulkVS number's record at the carrier and caches it",
        "description": "Reads one BulkVS number's record at the carrier and caches it. A reseller reaches only its tree's numbers.\n\nRequires an account admin (or an API key).",
        "operationId": "checkOneE911",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E911Check"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/history": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns ?number= history, newest first, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getNumberHistory",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "number",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NumberEvent"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/inventory": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns the newest run, or null, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "latestInventory",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryReport"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Begins an inventory review, superadmin only",
        "description": "Begins an inventory review, superadmin only. It reads the carriers and Kazoo and changes no number.\n\nRequires an account admin (or an API key).",
        "operationId": "startInventory",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryReport"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/inventory/{id}": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns a run, or its rows with ?format=csv, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getInventory",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/inventory/{id}/apply": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Fixes a finished run's rows, or only {\"numbers\": [...]}, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "applyInventory",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApplied"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/inventory/{id}/rows": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns one page of a run's rows, superadmin only",
        "description": "Returns one page of a run's rows, superadmin only. ?bucket= and ?number= filter them, ?offset= picks the page.\n\nRequires an account admin (or an API key).",
        "operationId": "getInventoryRows",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "bucket",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "number",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/locations": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Lists accounts by Locations mode, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getLocationsSummary",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Summary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/locations/{accountID}/preflight": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Shows what an upgrade would do, superadmin only",
        "description": "Shows what an upgrade would do, superadmin only. It writes nothing.\n\nRequires an account admin (or an API key).",
        "operationId": "getLocationsPreflight",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preflight"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/locations/{accountID}/revert": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Puts one account back on Pivot, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "revertLocations",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/locations/{accountID}/upgrade": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Moves one account to Core Locations, superadmin only",
        "description": "Requires an account admin (or an API key).",
        "operationId": "upgradeLocations",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "accountID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NumberResult"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/summary": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Counts DIDs per carrier and per account: every one for the superadmin, its tree's for a reseller",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getDIDSummary",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DIDSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/usage": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns how many numbers are on each provider the caller can see",
        "description": "Returns how many numbers are on each provider the caller can see. It reads every numbers database, so the page loads it apart from the list.\n\nRequires an account admin (or an API key).",
        "operationId": "numbersProviderUsage",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/{id}": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Changes one numbers provider of the account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "updateNumbersProvider",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumbersProviderAPI"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Numbers"
        ],
        "summary": "Removes a numbers provider that is not the working one",
        "description": "Requires an account admin (or an API key).",
        "operationId": "deleteNumbersProvider",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/providers/{id}/active": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Makes one numbers provider the account's working provider and clears the flag on the others",
        "description": "Requires an account admin (or an API key).",
        "operationId": "setActiveNumbersProvider",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/purchase": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Purchase wholesale number",
        "operationId": "purchaseWholesaleNumber",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "provider_ref": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/config/numbers/{account_id}/csv": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Returns numbers information in CSV format",
        "operationId": "getNumbersCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/{number}/ai-provider": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "It will modify the specified number by assigning it an AI provider",
        "operationId": "assignAIProviderToNumber",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "ai_provider_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/numbers/{number}/outbound_cid_selectable": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Sets a boolean flag in the number's fonouc section to make it selectable as outbound CID",
        "operationId": "setNumberOutboundCIDSelectable",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/permissions": {
      "post": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Creates new permissions template document in database of admin",
        "description": "Requires an account admin (or an API key).",
        "operationId": "createPermissionsTemplate",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PermissionsBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/permissions/registry": {
      "get": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Returns the permissions registry",
        "operationId": "getPermissionsRegistry",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PermissionsRegistryData"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v2/config/queues/desk-missed-calls": {
      "put": {
        "tags": [
          "Queues"
        ],
        "summary": "Set desk missed calls",
        "description": "Requires the X-Account-ID header.\n\nRequires an account admin (or an API key).",
        "operationId": "setDeskMissedCalls",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/roles/v2": {
      "get": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Returns all roles in V2 format Only accessible by global admin account",
        "operationId": "getAllRolesV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccessRoleV2PublicFields"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Creates a new custom role Only accessible by global admin account",
        "operationId": "createRoleV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/roles/v2/{role_id}": {
      "get": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Returns a specific role by ID in V2 format Only accessible by global admin account",
        "operationId": "getRoleByIDV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "role_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRoleV2PublicFields"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Updates an existing custom role",
        "operationId": "updateRoleV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "role_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Delete role v2",
        "operationId": "deleteRoleV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "role_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteRoleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/roles/v2/{role_id}/clone": {
      "post": {
        "tags": [
          "Access Roles"
        ],
        "summary": "Creates a copy of an existing role",
        "operationId": "cloneRoleV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "role_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRoleV2PublicFields"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/temporal_rules": {
      "get": {
        "tags": [
          "Callflows"
        ],
        "summary": "Lists all temporal rules of the account",
        "description": "Requires an account admin (or an API key).",
        "operationId": "getTemporalRules",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemporalRule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/user/role/v2": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Returns the current user's role in V2 format If the user's role doesn't exist (was deleted), fallback to ac...",
        "description": "Returns the current user's role in V2 format If the user's role doesn't exist (was deleted), fallback to activation_only",
        "operationId": "getUserRoleV2",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/bulk/enabled": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Starts an async cascade to enable or disable all listed users in Crossbar",
        "description": "Starts an async cascade to enable or disable all listed users in Crossbar. Returns a taskID immediately; progress is polled via the taskservice endpoint.\n\nRequires the X-Account-ID header.",
        "operationId": "bulkUsersSetEnabled",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUsersSetEnabledBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/csv": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get users summary csv",
        "operationId": "getUsersSummaryCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "tags",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/desktop": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get users desktop version",
        "operationId": "getUsersDesktopVersion",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Save users desktop version",
        "operationId": "saveUsersDesktopVersion",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsersDesktopVersionInfoPublicFields"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/desktop/all": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get desktop version for all users",
        "operationId": "getDesktopVersionForAllUsers",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/sessions": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Stores one session event reported by ucp or softphone-embed (SUP-644): session_start when the client create...",
        "description": "Stores one session event reported by ucp or softphone-embed (SUP-644): session_start when the client creates its SIP user agent, and session_replaced when a ucp session logs out because a newer session of the same user registered (\"New session detected\"). The user and account come from the token, the IP from the request; the client supplies only what it knows about itself. Cost: see userservice.RecordUCPSessionEvent (one event write, the middleware's audit_log write, and a debounced non-blocking index refresh). The body has already been read whole by the logging middleware, so the LimitReader below only bounds what is decoded.",
        "operationId": "saveUCPSessionEvent",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UCPSessionEventPublicFields"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorsErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/skills": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get users skills",
        "description": "Requires the X-Account-ID header.",
        "operationId": "getUsersSkills",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/skills/bulk": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update bulk user skills",
        "operationId": "updateBulkUserSkillsConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "skills": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/user/is_admin": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Returns whether the current user has admin privileges",
        "operationId": "userIsAdmin",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/user/is_superadmin": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Returns whether the current user has superadmin privileges",
        "operationId": "userIsSuperAdmin",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/{id}/disable": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Execute a PATCH request to Kazoo to disable the user sent by URL parameters",
        "operationId": "disableUser",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Creation"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/{id}/enable": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Execute a PATCH request to Kazoo to enable the user sent by URL parameters",
        "operationId": "activateUser",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Creation"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/{id}/skills": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Handles GET requests to retrieve a user's skills",
        "operationId": "getUserSkillsConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update user skills",
        "operationId": "updateUserSkillsConfig",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateSkillsRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/config/users/{id}/unblock-login": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Clears credential login lockout (QVOICE Platform.login_blocked) without disabling SIP",
        "operationId": "unblockUserLogin",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/account_summary": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the Account Summary report as JSON",
        "operationId": "getAccountSummary",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportsAccountSummary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns aggregated per-user call activity across queue and direct calls",
        "operationId": "getAllCallsStatsReport",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "class",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter_groups",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue_count",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip_calls_answered_by_another",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls/by_call": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the All Calls report counted by customer call rather than by agent",
        "description": "Returns the All Calls report counted by customer call rather than by agent. Takes the same query params as the per-agent view.",
        "operationId": "getAllCallsByCallReport",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "class",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter_groups",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue_count",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls/by_call/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the by-call view as a CSV attachment, through the same sources and filter as the on-screen report s...",
        "description": "Returns the by-call view as a CSV attachment, through the same sources and filter as the on-screen report so the two agree.",
        "operationId": "getAllCallsByCallReportCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "class",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter_groups",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue_count",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the All Calls report as a CSV attachment",
        "operationId": "getAllCallsStatsReportCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "class",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter_groups",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue_count",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip_calls_answered_by_another",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls/follow_ups": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the per-agent follow-up counts of a range, keyed by the agent's extension — the key All Calls' By ...",
        "description": "Serves the per-agent follow-up counts of a range, keyed by the agent's extension — the key All Calls' By user rows carry.",
        "operationId": "getAllCallsUserFollowUpCounts",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "class",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter_groups",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue_count",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls/pdf": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the All Calls report as a PDF attachment",
        "operationId": "getAllCallsStatsReportPDF",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "brandPrimary",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "brandSecondary",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "columns",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/all_calls/user_calls": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the calls behind one user's row of the All Calls report",
        "description": "Returns the calls behind one user's row of the All Calls report. It takes the same query params as the report itself plus the `extension` whose row was opened, so the list is the row's own material rather than a second opinion about it.",
        "operationId": "getAllCallsUserCallsReport",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "class",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter_groups",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue_count",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip_calls_answered_by_another",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/audit_logs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get logs",
        "operationId": "getLogs",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/call_ratings": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the calls an agent rated in the requested range, with the score, the reasons and the note, for the ...",
        "description": "Returns the calls an agent rated in the requested range, with the score, the reasons and the note, for the Call Rating report.",
        "operationId": "getCallRatings",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/adherence": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get adherence",
        "operationId": "getAdherence",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "graceSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/availability/timeline": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Handles Report A / C",
        "operationId": "getAgentAvailabilityTimeline",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "detailed",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/roster": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "It takes no interval and no grace: a roster is the plan itself, not a measurement of it, so it has nothing ...",
        "description": "It takes no interval and no grace: a roster is the plan itself, not a measurement of it, so it has nothing to bucket and nothing to forgive.",
        "operationId": "getRoster",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/staffing_plan": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "It PROPOSES; it does not store and it does not publish",
        "description": "It PROPOSES; it does not store and it does not publish. The result is a plan in the proposed state, which is inert by construction — the caller decides whether to keep it, and a human decides whether to release it. A GET rather than a POST for exactly that reason: nothing changes. An admin can ask the same question with a different stability and compare the two answers without leaving a trail of drafts behind.",
        "operationId": "getStaffingPlan",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "agentIds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "maxAgents",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "patternIds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkageMeasured",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "stability",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/staffing_plan/evaluation": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "It re-scores a roster the admin edited, and like the proposal it stores NOTHING: the answer is a plan in th...",
        "description": "It re-scores a roster the admin edited, and like the proposal it stores NOTHING: the answer is a plan in the proposed state, and keeping it is still a separate POST to the plans collection. It exists because a proposal that can be edited and not re-scored is worse than one that cannot be edited at all. The concessions the planner shipped describe the assignment the PLANNER made — the hours below contract, the preferences broken — and one swap later that panel describes a roster that no longer exists, while still being the thing a reviewer signs the plan on. A POST because it carries the roster, which does not fit in a query string, and not because it changes anything. The same query parameters as the GET, because it has to be scored over the same inputs: re-reading the account with a different range or a different shrinkage would answer about a slightly different week than the one on screen.",
        "operationId": "postStaffingPlanEvaluation",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "agentIds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "maxAgents",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "patternIds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkageMeasured",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "stability",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan": {
                    "$ref": "#/components/schemas/StaffingPlanPublicFields"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/state/series": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get agent state series",
        "operationId": "getAgentStateSeries",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/stats/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns aggregated CDR information from agent received calls in queues in a CSV file",
        "operationId": "getQueuesCallsByAgentStatsReportCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/agents/stats/request": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the POST handler that enqueues reportType",
        "description": "Returns the POST handler that enqueues reportType. The request carries exactly the same query string as the synchronous GET endpoint, so the frontend can reuse its existing URL building unchanged.",
        "operationId": "requestAsyncReportJob",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/cx/channels": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the activity of every CX channel of the working account over the requested period",
        "operationId": "getCXChannels",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/channelsReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/cx/channels/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the same report as a CSV download",
        "operationId": "getCXChannelsCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/cx/conversations": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns all Chatwoot conversations for the working account created within the requested date range",
        "operationId": "getCXConversations",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/cx/conversations/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the same report as GetCXConversations as a CSV download",
        "description": "Serves the same report as GetCXConversations as a CSV download. It shares buildCXConversationsReport and BuildCXConversationsCSV with the report itself, so what a user downloads and what the screen shows can never describe the conversations differently.",
        "operationId": "getCXConversationsCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "assignee",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contact",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "inbox",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/cx/conversations/{id}/messages": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the transcript (messages) of a single CX conversation so the report can render it read-only",
        "operationId": "getCXConversationMessages",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/cx/conversations/{id}/messages/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Downloads a single conversation transcript",
        "description": "Downloads a single conversation transcript. The messages are already in the browser when the transcript is open, but the file is built here: message content is free text, and the frontend CSV helper joins values with a comma without quoting them, so a message carrying a comma, a quote or a newline would produce a broken file.",
        "operationId": "getCXConversationMessagesCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/agents/occupancy": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Handles Report B",
        "operationId": "getQueueAgentOccupancy",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "bucketSec",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/agents/status/activity": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns login logout status activity grouped by queues and agents",
        "operationId": "getQueuesAgentStatusActivity",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/availability": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "One row per interval for the selected queues as one group",
        "description": "One row per interval for the selected queues as one group. Queues Waiting counts each Queue Calls CDR in the slice where it started, and in every later slice until an agent answered (agent_history) or, if nobody answered, until hangup. Agents Available is who was idle at the start of the slice.",
        "operationId": "getQueuesAvailability",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/calls": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "The calls behind one Queues Activity row, each with its follow-up (SUP-653)",
        "description": "The calls behind one Queues Activity row, each with its follow-up (SUP-653). Query: startDate, endDate, timezone, queue (required, one queue name) and uniqueNumbers (\"true\" lists only each number's latest queue call, matching the row it was opened from). Cost: one list_queue_cdr read over the range (the stats read, paginated, no per-document loads) plus one Missed Calls scan bounded by the follow-ups request timeout — the same two reads the Queues Activity page already makes. A scan that fails or times out degrades to calls without follow-ups; it never fails the list.",
        "operationId": "getQueueCalls",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "uniqueNumbers",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/capacity": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get capacity",
        "operationId": "getCapacity",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/capacity/breakdown": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "The same range answered twice — as one pool and as separate queues — because those are two different nu...",
        "description": "The same range answered twice — as one pool and as separate queues — because those are two different numbers and the difference between them is a decision, not a rounding. Its own endpoint rather than fields on the capacity response: it forecasts once per queue, and folding that into every capacity request would make the ordinary screen pay for a comparison it is not showing.",
        "operationId": "getCapacityBreakdown",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/capacity/shrinkage": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Answers \"what shrinkage does this account actually run at\", measured over the requested window",
        "description": "Answers \"what shrinkage does this account actually run at\", measured over the requested window. A SEPARATE endpoint, not a field on the capacity response. Two reasons, and the first is the important one: - The suggestion must never be silently applied. A forecast that changed because measured shrinkage moved would be unauditable, which is the one thing this module cannot be. Making it its own request means the admin asks for the figure, sees it, and chooses. - It costs an adherence run — the availability timeline over the window. Folding that into every capacity request would make the forecast pay for a number the admin has usually already decided.",
        "operationId": "getShrinkageSuggestion",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/follow_ups": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the per-queue follow-up counts of a range, keyed by queue name",
        "description": "Serves the per-queue follow-up counts of a range, keyed by queue name. Both Queues Activity tables read this endpoint to fill their three Missed Follow columns. The Analytics table used to page the entire Missed Calls list into the browser (500 CDRs a request) and count it there, which the portal table could not repeat cheaply — so the two could not show the same columns. The counting moved here; the wire now carries one small object per queue.",
        "operationId": "getQueuesFollowUpCounts",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "uniqueNumbers",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/intraday": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Answers \"are we short right now, and for the rest of today\"",
        "description": "Answers \"are we short right now, and for the rest of today\". The range comes from the request like every other report, so a supervisor can look at yesterday's shape or tomorrow's roster with the same screen. Only the interval containing `now` carries the live figure — see Interval.AtPost.",
        "operationId": "getIntraday",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/intraday/breakdown": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "The same day answered once per queue rather than pooled",
        "description": "The same day answered once per queue rather than pooled. A pooled answer is the wrong one wherever agents cannot cross queues — it asks for fewer people than the queues need — and, more to the point for a supervisor, it cannot say WHICH queue is short. \"The centre is two down\" sends nobody anywhere. No queue parameter: it answers all of them. Filtering to one is the caller's job and costs nothing, while asking the server for one at a time would pay for a fresh pass over the history shards on every request.",
        "operationId": "getIntradayByQueue",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "historyWeeks",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelTargetPercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceLevelThresholdSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "shrinkagePercent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/stats/request": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the POST handler that enqueues reportType",
        "description": "Returns the POST handler that enqueues reportType. The request carries exactly the same query string as the synchronous GET endpoint, so the frontend can reuse its existing URL building unchanged.",
        "operationId": "requestAsyncReportJobReport",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/callcenter/queues/volume/series": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get queue volume series",
        "operationId": "getQueueVolumeSeries",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "intervalSeconds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/calls/{call_id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Answers month is optional: without it the call is searched from the current month back; the answer's month ...",
        "description": "Answers month is optional: without it the call is searched from the current month back; the answer's month makes the next lookup of the same call one read.",
        "operationId": "getCallByCallID",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "call_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ai_device_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "month",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/campaigns/b_legs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "It returns the account's campaign call-detail records (b_legs) over the date range, paginated",
        "description": "It returns the account's campaign call-detail records (b_legs) over the date range, paginated. This feeds the Analytics \"Campaign Event Log\" report with the agent-leg attempts that leave NO lead-history record — e.g. an agent that never answered a preview/progressive dial (hangup_cause NO_USER_RESPONSE), which is invisible to /api/v2/reports/campaigns/leads/history. The consumer keys these off the b_leg's custom_sip_headers (q_campaign / q_ticketid / q_agent_ext) and surfaces the ones with no matching call-leg as the \"CDR Only — No Response\" event category. The data comes from the b_legs_by_timestamp view, which is already scoped to campaign CDRs (custom_sip_headers.q_campaign + QVOICE Platform.cc_campaign). The very same view backs the queues Call reports, so the sharded, paginated read is reused from the queues package with no queue filter (an empty queue set matches every campaign — see matchesSelectedQueues). No new view or migration is required.\n\nRequires the X-Account-ID header.",
        "operationId": "getCampaignBLegsReportHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/campaigns/leads/history/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get leads history report csv handler",
        "description": "Requires the X-Account-ID header.",
        "operationId": "getLeadsHistoryReportCSVHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/campaigns/leads/status": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get leads status for all campaigns",
        "description": "Requires the X-Account-ID header.",
        "operationId": "getLeadsStatusForAllCampaigns",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/leadStatusResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/campaigns/{campaign_id}/leads/status": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get leads status for campaign",
        "description": "Requires the X-Account-ID header.",
        "operationId": "getLeadsStatusForCampaign",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/leadStatusResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/cdrs/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get interactions csv",
        "operationId": "getInteractionsCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/inbound_breakdown": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the Inbound Breakdown report as JSON",
        "operationId": "getInboundBreakdown",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "ai_device_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundBreakdown"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/inbound_breakdown/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Downloads the report: section=summary (default), ai_calls, ai_missed_calls or ai_sessions",
        "operationId": "getInboundBreakdownCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "ai_device_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "section",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/inbound_breakdown/devices": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Lists the account's devices for the AI device picker",
        "operationId": "getInboundBreakdownDevices",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/jobs/{job_id}/download": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Download job csv",
        "operationId": "downloadJobCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/missed_call_follow_backs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Answers, for each number the caller asks about, when anyone in the account last reached that person inside ...",
        "description": "Answers, for each number the caller asks about, when anyone in the account last reached that person inside the window. What counts as reaching them is the same pair of events the portal's Missed Calls report counts as a follow-up, and the pair the customer named: - an OUTBOUND leg that connected — IsConnectedFollowUpOutbound, i.e. billed at least FollowUpOutboundBillingMin seconds. A colleague's ringing-out attempt is deliberately NOT enough: the agent reading the widget cannot know it happened, and clearing on it would drop a caller nobody spoke to. (This is where the rule differs from the agent's OWN outbound attempt, which the widget still clears on: they made that call themselves.) - an INBOUND leg that a PERSON answered — isInboundAnsweredFromRow, minus two cases that look answered and reached nobody: a queue call the caller abandoned (the platform answers it to play music) and a call that landed in voicemail. Either would let a caller clear themselves off the list by ringing back and not reaching anyone. - an INTERNAL leg that connected, for the party that was RUNG. A queue caller can be an extension, and neither offnet view carries an internal call: both filter on resource_type.",
        "operationId": "getMissedCallFollowBacks",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "numbers",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/missed_calls": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns paginated missed-call report (JSON)",
        "operationId": "getMissedCalls",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/missed_calls/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns CSV download for missed calls",
        "operationId": "getMissedCallsCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/missed_calls/pdf": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns PDF download for missed calls",
        "operationId": "getMissedCallsPDF",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "brandPrimary",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "brandSecondary",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "columns",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/missed_calls/voicemail_play": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns vmbox_id and message_id for a missed-call voicemail so the client can fetch raw media from Crossbar",
        "description": "Returns vmbox_id and message_id for a missed-call voicemail so the client can fetch raw media from Crossbar. Resolves by owner_id and start_time: finds the voicemail message whose timestamp is nearest to start_time (within a time window).",
        "operationId": "getVoicemailPlayback",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "owner_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "start_time",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/voicemailPlaybackResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/outbound_breakdown": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Serves the Outbound Breakdown report as JSON",
        "operationId": "getOutboundBreakdown",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundBreakdown"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/outbound_breakdown/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Downloads the report: section=summary (default) or calls",
        "operationId": "getOutboundBreakdownCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "net",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "section",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/queues_cdrs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns queues CDRs for specified interaction time",
        "operationId": "getQueuesCDRsHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/queues_cdrs/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns queues cdrs for specified interaction time as csv file",
        "operationId": "getQueuesCDRsHandlerCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/queues_cdrs/queue/{id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns queues CDRs for specified interaction time",
        "operationId": "getQueuesCDRsHandlerReport",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/queues_cdrs/queue/{id}/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns queues cdrs for specified interaction time as csv file",
        "operationId": "getQueuesCDRsHandlerCSVReport",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/queues_outbound_cdrs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get queues cd rs outbound handler",
        "operationId": "getQueuesCDRsOutboundHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/queues_outbound_cdrs/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get queues cd rs outbound handler csv",
        "operationId": "getQueuesCDRsOutboundHandlerCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/recordings/restore": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Restores a recording by filename",
        "operationId": "restoreRecordingByFilenameHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "filename",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/recordings/{recordingID}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Proves access to downloading a specific media file",
        "operationId": "getRecordingHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "recordingID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/recordings/{recordingID}/storage": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Access to specified recording in order to get where it is stored",
        "operationId": "getRecordingStorageServers",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "recordingID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/siplog": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Generate a file with sip dialog messages for callid",
        "operationId": "generateCDRSIPLog",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "callID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "interaction_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "yearMonth",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/technical_details": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns per-leg device/IP/codec plus a resolved summary for one call, backing the per-call Technical Detail...",
        "description": "Returns per-leg device/IP/codec plus a resolved summary for one call, backing the per-call Technical Details view on the report rows. Cost: exactly one crossbar cdrs/legs/{cdrID} call per request and zero CouchDB queries — it is invoked on a user click, never per report row. Two identifiers are required, and they are not interchangeable: - cdrID is the CDR *document* id (\"YYYYMM-<call_id>\") and is the only identifier crossbar's cdrs/legs accepts. Its YYYYMM prefix is what makes crossbar resolve the account MODB holding the CDR; passing a bare call_id instead leaves the query pointed at the main account database, whose design doc has no interaction_listing_by_id view, and crossbar answers 503 \"datastore missing view\". - callID is the raw call_id, used only to pick the anchor leg in resolveSummary — legs carry call_ids, not document ids.",
        "operationId": "getCallTechnicalDetails",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "callID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cdrID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/reports/transcripts/search": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Searches what was said across the account's transcribed call recordings in a date range",
        "operationId": "getTranscriptSearchHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/transcripts/{recordingID}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns every line of one recording's transcript, timed and split by speaker the same way the search reads it",
        "operationId": "getTranscriptHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "recordingID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/transcripts/{recordingID}/translate": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Translates one recording's transcript line by line",
        "description": "Translates one recording's transcript line by line. The result is saved on the recording, so asking again for the same language is free.",
        "operationId": "translateTranscriptHandler",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "recordingID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslateTranscriptReqBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslatedTranscriptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "502": {
            "description": "Bad Gateway"
          }
        }
      }
    },
    "/api/v2/reports/user/{userID}/agent_states": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the custom-state (not-available) history of one agent inside the requested timeframe, newest first",
        "operationId": "getAgentStatesReportForUser",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorsErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/user/{userID}/dnd/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns a detailed dnd usage report of the specified users within the specified timeframe",
        "operationId": "getDndReportForUserCSV",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/user/{userID}/sessions": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Returns the session start / replaced events of one agent inside the requested timeframe, newest first",
        "description": "Returns the session start / replaced events of one agent inside the requested timeframe, newest first. Admins and supervisors only. Unlike the sibling state histories, these rows carry personal data — the IP addresses, devices and host pages an agent logged in from — so an agent's token must not read a colleague's. The check is made here because auth.UserAdminOrSupervisorMiddleware writes its 401 and then calls the handler anyway.",
        "operationId": "getUCPSessionsReportForUser",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "path",
            "name": "userID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "col[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "extension",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "external",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "internal",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lean",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queueID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKey",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startKeyDocId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag[]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "voicemail",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/user_cdrs": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get user interactions",
        "operationId": "getUserInteractions",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "start_key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-User-Agent",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v2/reports/user_cdrs/call_path": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Answers the call path of one of the user's own calls, read across the call's other legs",
        "description": "Answers the call path of one of the user's own calls, read across the call's other legs. {id} is the user_cdrs row id. A call that is not the user's is answered 404, the same as one that does not exist.",
        "operationId": "getUserCDRCallPath",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "accountIdHeader": [],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/XAccountID"
          },
          {
            "in": "header",
            "name": "X-User-Agent",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Conflict"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Token from POST /api/v2/login."
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key created with POST /api/v2/apikeys. Send X-Account-ID with it; a reseller key may name one of its sub-accounts. The key acts as an account admin."
      },
      "accountIdHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Account-ID",
        "description": "Account the request works on. Required with X-API-Key."
      }
    },
    "parameters": {
      "XAccountID": {
        "in": "header",
        "name": "X-Account-ID",
        "required": false,
        "description": "Account the request works on. Required with X-API-Key; with a bearer token it selects a sub-account (defaults to the user's own account).",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "QuickcallRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "target_ext",
          "route_to"
        ],
        "properties": {
          "target_ext": {
            "type": "string",
            "pattern": "^[0-9]{1,16}$",
            "description": "Extension to ring. Its callflow must belong to a user or a device (a user's find-me/follow-me main callflow rings the user); a ring group, queue or IVR is refused.",
            "example": "4440"
          },
          "route_to": {
            "type": "string",
            "pattern": "^[0-9*#]{1,32}$",
            "description": "Extension (callflow number) the answered call is sent to.",
            "example": "7100"
          },
          "timeout": {
            "type": "integer",
            "minimum": 5,
            "maximum": 300,
            "default": 30,
            "description": "How long to ring, in seconds."
          },
          "caller_id": {
            "type": "object",
            "description": "What the rung phone displays. Validated by the PBX.",
            "properties": {
              "name": {
                "type": "string"
              },
              "number": {
                "type": "string"
              }
            }
          },
          "custom_sip_headers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Headers added to the INVITE sent to the rung phones."
          },
          "no_voicemail": {
            "type": "boolean",
            "default": false,
            "description": "Ring only the target's own phones (no call forward, failover or external numbers), so no voicemail can answer."
          },
          "custom_application_vars": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Variables carried on the call (visible to the route_to callflow and pivot) and echoed in status callbacks."
          },
          "status_callback": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Absolute http or https URL that receives the status events (see the statusCallback callback)."
          }
        }
      },
      "QuickcallResponse": {
        "type": "object",
        "required": [
          "call_ids",
          "target"
        ],
        "properties": {
          "call_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Call-ID of every rung leg; the same value is `call_id` in the CDRs."
          },
          "target": {
            "type": "object",
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "users",
                  "devices"
                ]
              },
              "id": {
                "type": "string",
                "description": "The user or device id the extension resolved to."
              }
            }
          }
        }
      },
      "SimpleError": {
        "description": "Error body of the integration endpoints.",
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable reason."
          }
        }
      },
      "QuickcallStatusEvent": {
        "type": "object",
        "required": [
          "event",
          "status",
          "call_ids",
          "target_ext",
          "route_to",
          "talk_seconds",
          "timestamp"
        ],
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "answered",
              "completed"
            ],
            "description": "`answered` when a leg answers; `completed` once every leg has ended."
          },
          "status": {
            "type": "string",
            "enum": [
              "answered",
              "no_answer",
              "busy",
              "failed",
              "unknown"
            ],
            "description": "Outcome. Always `answered` on an `answered` event."
          },
          "call_id": {
            "type": "string",
            "description": "The leg that answered (answered events)."
          },
          "call_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "target_ext": {
            "type": "string"
          },
          "route_to": {
            "type": "string"
          },
          "hangup_cause": {
            "type": "string",
            "description": "SIP/FreeSWITCH hangup cause (completed events), for example NORMAL_CLEARING."
          },
          "talk_seconds": {
            "type": "integer"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "Unix time in seconds when the event was sent."
          },
          "custom_application_vars": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "FaxConfig": {
        "type": "object",
        "properties": {
          "cover_page_enabled": {
            "type": "boolean",
            "description": "Indicates whether cover page is enabled for fax."
          }
        },
        "required": [
          "cover_page_enabled"
        ]
      },
      "BillingAccounts": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "account_id": {
              "type": "string",
              "description": "ID of Account"
            },
            "account_name": {
              "type": "string",
              "description": "Account Name"
            },
            "users": {
              "type": "array",
              "description": "Account users list",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "User ID"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string",
                    "description": "User email"
                  },
                  "extension": {
                    "type": "string",
                    "description": "User extension"
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "User activation status"
                  },
                  "created": {
                    "type": "integer",
                    "description": "User creation date in UNIX"
                  }
                }
              }
            }
          }
        }
      },
      "PaymentGateway": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of Payment gateway document"
          },
          "name": {
            "type": "string",
            "description": "Payment gateway name"
          },
          "note": {
            "type": "string",
            "description": "Payment gateway note"
          },
          "api_key": {
            "type": "string",
            "description": "Payment gateway api_key of Stripe"
          },
          "publishable_key": {
            "type": "string",
            "description": "Payment gateway publishable_key of Stripe"
          }
        }
      },
      "SMSProviderAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Provider ID",
            "required": true
          },
          "name": {
            "type": "string",
            "description": "Provider Name",
            "required": true
          },
          "type": {
            "type": "string",
            "description": "Provider Type",
            "required": true
          },
          "note": {
            "type": "string",
            "description": "Provider Note",
            "required": true
          },
          "token": {
            "type": "string",
            "description": "Provider Account Token",
            "required": true
          },
          "provider_number_id": {
            "type": "string",
            "required": true
          }
        }
      },
      "SMSProviderAccountForm": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Provider Name",
            "required": true
          },
          "type": {
            "type": "string",
            "description": "Provider Type",
            "required": true
          },
          "note": {
            "type": "string",
            "description": "Provider Note",
            "required": true
          },
          "token": {
            "type": "string",
            "description": "Provider Account Token",
            "required": true
          },
          "provider_number_id": {
            "type": "string",
            "required": true
          }
        }
      },
      "SMSProvidersAccountsList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/SMSProviderAccount"
        }
      },
      "Contact": {
        "type": "object",
        "description": "Source contact",
        "properties": {
          "id": {
            "type": "string",
            "description": "Source contact ID"
          },
          "name": {
            "type": "string",
            "description": "Source Contact Name"
          },
          "phone_number": {
            "type": "array",
            "description": "List of contact phone numbers",
            "items": {
              "type": "string"
            }
          },
          "companies": {
            "type": "array",
            "description": "List of contact companies",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Contacts": {
        "type": "array",
        "description": "List of source contacts",
        "items": {
          "$ref": "#/components/schemas/Contact"
        }
      },
      "ErrorResponse": {
        "description": "Error response payload",
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "description": "error code",
                "type": "integer"
              },
              "message": {
                "description": "error message",
                "type": "string"
              }
            }
          }
        }
      },
      "VMBoxesList": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "VMBox ID"
            },
            "name": {
              "type": "string",
              "description": "VMBox Name"
            },
            "owner_id": {
              "type": "string",
              "description": "User ID"
            },
            "mailbox": {
              "type": "string"
            },
            "messages": {
              "type": "number"
            }
          }
        }
      },
      "Rate": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Rate ID",
            "required": true
          },
          "name": {
            "type": "string",
            "description": "Rate Name"
          },
          "rate_name": {
            "type": "string",
            "description": "Rate Name"
          },
          "rate_cost": {
            "type": "string",
            "description": "Rate Cost",
            "required": true
          },
          "prefix": {
            "type": "string",
            "required": true
          },
          "weight": {
            "type": "number"
          },
          "ratedeck_id": {
            "type": "string",
            "description": "Ratedeck Assigned",
            "required": true
          },
          "iso_country_code": {
            "type": "string"
          },
          "routes": {
            "type": "array",
            "description": "Regexes to match calls",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          }
        }
      },
      "RatesList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Rate"
        }
      },
      "AddRate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Rate Name"
          },
          "rate_name": {
            "type": "string",
            "description": "Rate Name"
          },
          "rate_cost": {
            "type": "number",
            "format": "float",
            "description": "Rate Cost",
            "required": true
          },
          "prefix": {
            "type": "number",
            "required": true
          },
          "weight": {
            "type": "number"
          },
          "iso_country_code": {
            "type": "string"
          },
          "routes": {
            "type": "array",
            "description": "Regexes to match calls",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          }
        }
      },
      "UsersNumbersList": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "User ID",
              "required": true
            },
            "numbers": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "Associated Number"
              }
            }
          }
        }
      },
      "BulkUsersCreationResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "number",
            "description": "Number of users has been created successfully",
            "required": true
          },
          "failed": {
            "type": "number",
            "description": "Number of users has not been created",
            "required": true
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "number",
                  "required": true,
                  "description": "Index of Row in CSV file"
                },
                "first_name": {
                  "type": "string",
                  "required": true,
                  "description": "First Name of user"
                },
                "last_name": {
                  "type": "string",
                  "required": true,
                  "description": "Last Name of user"
                },
                "reason": {
                  "type": "string",
                  "required": true,
                  "description": "Description of what failed in the creation of the user"
                }
              }
            }
          }
        }
      },
      "UsersSummary": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "User ID",
              "required": true
            },
            "first_name": {
              "type": "string",
              "description": "User First Name",
              "required": true
            },
            "last_name": {
              "type": "string",
              "description": "User Last Name",
              "required": true
            },
            "email": {
              "type": "string",
              "description": "User Email",
              "required": true
            },
            "presence_id": {
              "type": "number",
              "description": "User Extension",
              "required": true
            },
            "enabled": {
              "type": "boolean",
              "description": "User Status (Enabled / Disabled)",
              "required": true
            },
            "has_cellphones": {
              "type": "boolean",
              "description": "Indicates if the user has associated cellphones",
              "required": true,
              "default": false
            },
            "role": {
              "type": "string",
              "required": true,
              "description": "Indicates the level of permissions the user has"
            },
            "cellphones": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "required": false
            },
            "invited": {
              "type": "boolean",
              "description": "Indicates if the user has been invited to the system usgin onboarding links",
              "default": false
            },
            "accepted": {
              "type": "boolean",
              "description": "Indicates if the user has logged in to the system after receiveing an invitation",
              "default": false
            }
          }
        }
      },
      "UsersHistoricalDataSummary": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "User ID",
              "required": true
            },
            "first_name": {
              "type": "string",
              "description": "User First Name",
              "required": true
            },
            "last_name": {
              "type": "string",
              "description": "User Last Name",
              "required": true
            },
            "email": {
              "type": "string",
              "description": "User Email",
              "required": true
            },
            "presence_id": {
              "type": "number",
              "description": "User Extension",
              "required": true
            },
            "created": {
              "type": "number",
              "description": "Datetime of user creation",
              "required": true
            },
            "updated": {
              "type": "number",
              "description": "Datetime of user last edition",
              "required": true
            },
            "last_login": {
              "type": "object",
              "properties": {
                "portal": {
                  "type": "number",
                  "description": "Datetime of user last authentication in Portal"
                },
                "ucp": {
                  "type": "number",
                  "description": "Datetime of user last authentication in UCP"
                }
              }
            }
          }
        }
      },
      "CallRecordingData": {
        "type": "object",
        "required": [
          "enabled",
          "account_mode",
          "retention_duration",
          "size_limit",
          "service",
          "is_filename_custom",
          "custom_filename"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Call Recording status (enabled or disabled)"
          },
          "account_mode": {
            "type": "boolean",
            "description": "Call Recording account mode"
          },
          "retention_duration": {
            "type": "number"
          },
          "size_limit": {
            "type": "number"
          },
          "service": {
            "type": "string",
            "description": "Service used for recording"
          },
          "is_filename_custom": {
            "type": "boolean",
            "description": "Flag indicating whether custom filename is used",
            "example": true
          },
          "custom_filename": {
            "type": "string",
            "description": "Custom filename template",
            "example": "%call_id-%caller_id_number-%caller_id_name"
          },
          "encryption": {
            "type": "object",
            "description": "HIPAA compliant encryption configuration for recordings",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Whether encryption is enabled",
                "default": false
              },
              "algorithm": {
                "type": "string",
                "description": "Encryption algorithm to use",
                "default": "AES-256-GCM"
              },
              "key_version": {
                "type": "integer",
                "description": "Version of the encryption key",
                "default": 1
              },
              "key_id": {
                "type": "string",
                "description": "Unique identifier for the encryption key",
                "default": "key_1234567890"
              },
              "salt": {
                "type": "string",
                "description": "Base64 encoded salt for encryption",
                "default": "base64-encoded-salt"
              },
              "encrypted_key": {
                "type": "string",
                "description": "Encrypted account-specific key",
                "default": "encrypted-account-specific-key"
              }
            }
          }
        }
      },
      "EditCallRecordingUserData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "required": true,
            "description": "User ID"
          },
          "outbound_onnet": {
            "type": "boolean",
            "required": true
          },
          "outbound_offnet": {
            "type": "boolean",
            "required": true
          },
          "inbound_onnet": {
            "type": "boolean",
            "required": true
          },
          "inbound_offnet": {
            "type": "boolean",
            "required": true
          }
        }
      },
      "CallRecordingAccountModeData": {
        "type": "object",
        "properties": {
          "outbound_onnet": {
            "type": "boolean",
            "required": true
          },
          "outbound_offnet": {
            "type": "boolean",
            "required": true
          },
          "inbound_onnet": {
            "type": "boolean",
            "required": true
          },
          "inbound_offnet": {
            "type": "boolean",
            "required": true
          }
        }
      },
      "CallRecordingUsersData": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "User ID"
            },
            "username": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "outbound_onnet": {
              "type": "boolean"
            },
            "outbound_offnet": {
              "type": "boolean"
            },
            "inbound_onnet": {
              "type": "boolean"
            },
            "inbound_offnet": {
              "type": "boolean"
            }
          }
        }
      },
      "AccountAutoprovisionCodecs": {
        "type": "object",
        "properties": {
          "ucp": {
            "type": "object",
            "properties": {
              "audio": {
                "type": "array",
                "description": "UCP Audio codecs list",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "ucp_mobile": {
            "type": "object",
            "properties": {
              "audio": {
                "type": "array",
                "description": "UCP Mobile Audio codecs list",
                "items": {
                  "type": "string"
                }
              },
              "video": {
                "type": "array",
                "description": "UCP Mobile Video codecs list",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AccountAutoprovisionStatus": {
        "type": "object",
        "properties": {
          "ucp": {
            "type": "boolean",
            "description": "Enable status for autoprovisioning in UCP"
          },
          "ucp_mobile": {
            "type": "boolean",
            "description": "Enable status for autoprovisioning in UCP Mobile"
          }
        }
      },
      "Internal": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "number": {
            "type": "string"
          }
        }
      },
      "External": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          }
        }
      },
      "Address": {
        "type": "object",
        "description": "Address settings",
        "properties": {
          "postal_code": {
            "type": "string",
            "description": "Address postal code",
            "nullable": false
          },
          "street_address": {
            "type": "string",
            "description": "Street Address Line 1",
            "nullable": false
          },
          "extended_address": {
            "type": "string",
            "description": "Street Address Line 2",
            "nullable": true
          },
          "locality": {
            "type": "string",
            "description": "City",
            "nullable": false
          },
          "region": {
            "type": "string",
            "description": "State",
            "nullable": false
          },
          "country": {
            "type": "string",
            "description": "Country",
            "nullable": false
          }
        }
      },
      "Emergency": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "account_address": {
            "type": "boolean",
            "description": "Use same address as account"
          },
          "address": {
            "type": "object",
            "$ref": "#/components/schemas/Address"
          }
        }
      },
      "CallerID": {
        "type": "object",
        "properties": {
          "internal": {
            "$ref": "#/components/schemas/Internal"
          },
          "external": {
            "$ref": "#/components/schemas/External"
          },
          "emergency": {
            "$ref": "#/components/schemas/Emergency"
          }
        }
      },
      "AccountFonoUCCollaboration": {
        "type": "object",
        "description": "Collaboration settings",
        "properties": {
          "id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "webrtc": {
            "type": "boolean"
          }
        }
      },
      "AccountFonoUCCallRecording": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "size_limit": {
            "type": "number"
          },
          "retention_duration": {
            "type": "number"
          }
        }
      },
      "AccountFonoUCCustomRouting": {
        "type": "object"
      },
      "Location": {
        "required": [
          "name",
          "timezone"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string"
          },
          "caller_id": {
            "$ref": "#/components/schemas/CallerID"
          }
        }
      },
      "Locations": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false
          },
          "default": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          }
        }
      },
      "AccountFonoUCAutoProvision": {
        "type": "object"
      },
      "AccountFonoUCCallcenter": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AccountFonoUCDesktop": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AccountFonoUCFixedDestination": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "destination": {
            "type": "number"
          }
        }
      },
      "AccountFonoUC": {
        "type": "object",
        "properties": {
          "collaboration": {
            "$ref": "#/components/schemas/AccountFonoUCCollaboration"
          },
          "call_recording": {
            "$ref": "#/components/schemas/AccountFonoUCCallRecording"
          },
          "custom_routing": {
            "$ref": "#/components/schemas/AccountFonoUCCustomRouting"
          },
          "locations": {
            "$ref": "#/components/schemas/Locations"
          },
          "auto_provision": {
            "$ref": "#/components/schemas/AccountFonoUCAutoProvision"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "callcenter": {
            "$ref": "#/components/schemas/AccountFonoUCCallcenter"
          },
          "desktop": {
            "$ref": "#/components/schemas/AccountFonoUCDesktop"
          },
          "fixed_destination": {
            "$ref": "#/components/schemas/AccountFonoUCFixedDestination"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "realm": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "is_reseller": {
            "type": "boolean"
          },
          "pvt_account_db": {
            "type": "string"
          },
          "pvt_account_id": {
            "type": "string"
          },
          "pvt_alphanum_name": {
            "type": "string"
          },
          "pvt_superduper_admin": {
            "type": "boolean"
          },
          "pvt_tree": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "caller_id": {
            "$ref": "#/components/schemas/CallerID"
          },
          "fonoUC": {
            "$ref": "#/components/schemas/AccountFonoUC"
          }
        }
      },
      "PinGroup": {
        "type": "object",
        "required": [
          "group",
          "name",
          "pattern"
        ],
        "properties": {
          "group": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UsersCallerID": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "_id": {
              "type": "string",
              "description": "User ID"
            },
            "username": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "presence_id": {
              "type": "string",
              "description": "User Extension"
            },
            "callerid_name": {
              "type": "string",
              "description": "Custom Caller ID Name"
            },
            "callerid_number": {
              "type": "string",
              "description": "Custom Caller ID Number"
            }
          }
        }
      },
      "EditUsersCallerID": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "ID of User"
            },
            "callerid_name": {
              "type": "string",
              "nullable": true,
              "description": "Edited Caller ID Name of User"
            },
            "callerid_number": {
              "type": "string",
              "nullable": true,
              "description": "Edited Caller ID Number of User"
            }
          }
        }
      },
      "UserLocationData": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "User ID"
          },
          "username": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "presence_id": {
            "type": "string",
            "description": "User Extension"
          },
          "in_this_location": {
            "type": "boolean",
            "description": "User belongs to the location"
          }
        }
      },
      "UsersLocationData": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/UserLocationData"
        }
      },
      "LocationAddEdit": {
        "type": "object",
        "properties": {
          "default": {
            "type": "boolean"
          },
          "location": {
            "required": [
              "name",
              "timezone"
            ],
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "note": {
                "type": "string",
                "nullable": true
              },
              "timezone": {
                "type": "string"
              },
              "allowed_sip_trunks": {
                "type": "array",
                "description": "IDs of allowed SIP trunks",
                "items": {
                  "type": "string"
                }
              },
              "outbound_calls_disabled": {
                "type": "boolean",
                "description": "Flag to indicate if outbound calls are disabled"
              },
              "access_list": {
                "type": "array",
                "description": "Access List",
                "items": {
                  "type": "string"
                }
              },
              "caller_id": {
                "$ref": "#/components/schemas/CallerID"
              }
            }
          }
        }
      },
      "AssignUsers": {
        "type": "object",
        "properties": {
          "add": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "delete": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AccessRole": {
        "type": "object",
        "description": "Log information for cc agent login session",
        "properties": {
          "name": {
            "type": "string",
            "description": "Access role name"
          },
          "role_id": {
            "type": "string",
            "description": "Access Role ID"
          },
          "permissions": {
            "type": "object",
            "description": "Permissions schema",
            "properties": {
              "reports": {
                "type": "object",
                "description": "Reports section",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              },
              "provision": {
                "type": "object",
                "description": "Provision section",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              },
              "status": {
                "type": "object",
                "description": "Status section",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              },
              "config": {
                "type": "object",
                "description": "Config section",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              },
              "smart_pbx": {
                "type": "object",
                "description": "Smart PBX section",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              },
              "users": {
                "type": "object",
                "description": "Users section",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "user": {
                    "type": "object",
                    "description": "User actions permissions",
                    "properties": {
                      "read": {
                        "type": "boolean"
                      },
                      "create": {
                        "type": "boolean"
                      },
                      "delete": {
                        "type": "boolean"
                      },
                      "edit": {
                        "type": "boolean"
                      },
                      "disable": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "AccessRoles": {
        "type": "array",
        "description": "List of access roles",
        "items": {
          "$ref": "#/components/schemas/AccessRole"
        }
      },
      "StorageServerConfig": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "Name of storage server (local, amazon, refract, sftp or api)"
          },
          "local_storage": {
            "type": "boolean",
            "description": "Store resource using local server"
          },
          "local_storage_path": {
            "type": "string",
            "description": "Local server path where the resource is going to be saved"
          },
          "single_file": {
            "type": "boolean",
            "description": "Create a single JSON file to save the resource"
          },
          "single_file_upload_interval": {
            "type": "string",
            "description": "Interval of time to upload JSON File"
          },
          "single_file_array": {
            "type": "boolean",
            "description": "Put objects inside an array into JSON File"
          },
          "single_csv_file": {
            "type": "boolean",
            "description": "Create a single CSV file to save the resource"
          },
          "single_csv_file_upload_interval": {
            "type": "string",
            "description": "Interval of time to upload CSV File"
          },
          "auth": {
            "type": "object",
            "properties": {
              "amazon": {
                "type": "object",
                "description": "AWS S3 Auth Credentials",
                "properties": {
                  "access_key": {
                    "type": "string"
                  },
                  "secret_access_key": {
                    "type": "string"
                  },
                  "bucket": {
                    "type": "string"
                  },
                  "bucket_directory": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  }
                }
              },
              "refract": {
                "type": "object",
                "description": "Refract Auth Credentials",
                "properties": {
                  "account_key": {
                    "type": "string"
                  },
                  "integration_type": {
                    "type": "string"
                  },
                  "shared_secret": {
                    "type": "string"
                  }
                }
              },
              "sftp": {
                "type": "object",
                "description": "Custom SFTP Server Auth Credentials",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "port": {
                    "type": "integer"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "directory": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "RecordingFile": {
        "type": "object",
        "properties": {
          "filename.mp3": {
            "type": "object",
            "properties": {
              "content_type": {
                "type": "string"
              },
              "revpos": {
                "type": "number"
              },
              "digest": {
                "type": "string"
              },
              "length": {
                "type": "number"
              },
              "stub": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "UserRecordingData": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          }
        }
      },
      "Recording": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "owner_id": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          },
          "callee_id_name": {
            "type": "string"
          },
          "callee_id_number": {
            "type": "string"
          },
          "caller_id_name": {
            "type": "string"
          },
          "caller_id_number": {
            "type": "string"
          },
          "cdr_id": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "custom_channel_vars": {
            "type": "object",
            "properties": {
              "Media-Name": {
                "type": "string"
              },
              "Media-Recording-ID": {
                "type": "string"
              }
            }
          },
          "description": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "duration_ms": {
            "type": "number"
          },
          "from": {
            "type": "string"
          },
          "interaction_id": {
            "type": "string"
          },
          "media_source": {
            "type": "string"
          },
          "media_type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "request": {
            "type": "string"
          },
          "source_type": {
            "type": "string"
          },
          "start": {
            "type": "number"
          },
          "to": {
            "type": "string"
          },
          "_attachments": {
            "$ref": "#/components/schemas/RecordingFile"
          },
          "user": {
            "$ref": "#/components/schemas/UserRecordingData"
          }
        }
      },
      "RecordingsResponse": {
        "type": "object",
        "properties": {
          "next_start_key": {
            "type": "string"
          },
          "recordings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recording"
            }
          }
        }
      },
      "DeleteRecordings": {
        "type": "object",
        "properties": {
          "recordings": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "ID of the recording to delete"
            }
          }
        }
      },
      "AccountSummary": {
        "type": "object",
        "properties": {
          "doc_count": {
            "type": "number",
            "description": "Total number of docs in all account DBs related"
          },
          "disk_size": {
            "type": "number",
            "description": "in Kilobytes"
          },
          "data_size": {
            "type": "number",
            "description": "in Kilobytes"
          },
          "size_limit": {
            "type": "number",
            "description": "Account size limit as set from portal"
          },
          "last_update": {
            "type": "number",
            "description": "Last time the calculation was done in UNIX epoch"
          }
        }
      },
      "UserAdd": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "User email (used for username too)",
            "nullable": false
          },
          "level": {
            "type": "string",
            "description": "User level (user or admin)",
            "nullable": true
          },
          "first_name": {
            "type": "string",
            "description": "User first name",
            "nullable": false
          },
          "last_name": {
            "type": "string",
            "description": "User last name",
            "nullable": false
          },
          "number": {
            "type": "string",
            "description": "User phone number",
            "nullable": false
          },
          "password": {
            "type": "string",
            "description": "User password",
            "nullable": false
          },
          "send_email_on_creation": {
            "type": "boolean",
            "description": "Flag that indicates if system sends an email to user to notify about account creation",
            "nullable": false
          }
        }
      },
      "AccountCreation": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Account Name",
            "nullable": false
          },
          "timezone": {
            "type": "string",
            "description": "Account timezone",
            "nullable": false
          },
          "is_reseller": {
            "type": "boolean",
            "description": "Flag to indicate if account is reseller"
          },
          "service_plans": {
            "type": "array",
            "nullable": false,
            "items": {
              "type": "string",
              "description": "Service Plans IDs"
            }
          },
          "collaboration": {
            "type": "object",
            "description": "Collaboration settings",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Flag to indicate if collaboration is enabled",
                "nullable": true
              },
              "webrtc": {
                "type": "boolean",
                "description": "Flag to indicate if webrtc is enabled",
                "nullable": true
              }
            }
          },
          "address": {
            "type": "object",
            "$ref": "#/components/schemas/Address"
          },
          "overrides": {
            "type": "object",
            "description": "Values to override service plans",
            "nullable": true,
            "properties": {
              "service_plan_id": {
                "type": "object",
                "description": "ID of the service plan to override",
                "properties": {
                  "users": {
                    "type": "object",
                    "description": "Values to override users values",
                    "properties": {
                      "user": {
                        "type": "object",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override user type rate"
                          }
                        }
                      },
                      "admin": {
                        "type": "object",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override admin user type rate"
                          }
                        }
                      },
                      "_all": {
                        "type": "object",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override all user types rate"
                          }
                        }
                      }
                    }
                  },
                  "phone_numbers": {
                    "type": "object",
                    "description": "Values to override phone_numbers values",
                    "properties": {
                      "caribbean": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "did_us": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "emergency": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "international": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "local": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "sri_lanka": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "string",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "toll_us": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "tollfree_us": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "unknown": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "_all": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override all call restrictions rates"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "limits": {
            "type": "object",
            "description": "Account limits",
            "nullable": true,
            "properties": {
              "inbound_trunks": {
                "type": "number",
                "description": "Amount of inbound trunks for the account",
                "nullable": true
              },
              "outbound_trunks": {
                "type": "number",
                "description": "Amount of outbound trunks for the account",
                "nullable": true
              },
              "twoway_trunks": {
                "type": "number",
                "description": "Amount of two way trunks for the account",
                "nullable": true
              }
            }
          },
          "call_recording": {
            "type": "object",
            "description": "Call recording information",
            "nullable": true,
            "properties": {
              "enabled": {
                "type": "boolean",
                "nullable": true,
                "description": "Enables call recording at account level"
              },
              "retention_duration": {
                "type": "number",
                "description": "Amount of days to retain call recordings",
                "nullable": true
              }
            }
          },
          "credit": {
            "type": "object",
            "description": "Credit information",
            "nullable": true,
            "properties": {
              "add": {
                "type": "number",
                "description": "Credit to add to account",
                "nullable": true
              },
              "treshold_alert": {
                "type": "number",
                "description": "Send notification to user when balance falls below this amount",
                "nullable": true
              },
              "recharge_treshold": {
                "type": "number",
                "description": "Auto recharge credit when balance falls below this amount",
                "nullable": true
              },
              "recharge_amount": {
                "type": "number",
                "description": "Amount of credit to auto recharge",
                "nullable": true
              }
            }
          },
          "users": {
            "type": "array",
            "description": "Users to add on account creation",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/UserAdd"
            }
          },
          "auto_provision": {
            "type": "object",
            "description": "Autoprovisioning parameters for UCP and UCP mobile",
            "properties": {
              "ucp": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "codecs": {
                    "type": "object",
                    "properties": {
                      "audio": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "ucp_mobile": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "codecs": {
                    "type": "object",
                    "properties": {
                      "audio": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "video": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "contact": {
            "type": "object",
            "properties": {
              "technical": {
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Full name of contact"
                  },
                  "number": {
                    "type": "string",
                    "description": "Phone number of  contact"
                  }
                }
              }
            }
          }
        }
      },
      "AccountsSummary": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The account ID"
                },
                "doc_count": {
                  "type": "number",
                  "description": "Total number of docs in all account DBs related"
                },
                "disk_size": {
                  "type": "number",
                  "description": "in Kilobytes"
                },
                "data_size": {
                  "type": "number",
                  "description": "in Kilobytes"
                },
                "size_limit": {
                  "type": "number",
                  "description": "Account size limit as set from portal"
                },
                "last_update": {
                  "type": "number",
                  "description": "Last time the calculation was done in UNIX epoch"
                }
              }
            }
          },
          "global_last_update": {
            "type": "number",
            "description": "Last time the calculation was done in UNIX epoch for all accounts\nThis may be older than one individual account in the case of the account being \"Location object that needs to be added\nafter the all account summary calculation process takes place AND a user asks for the new account summary prior to it being\nproperly accounted for in the global process\n"
          }
        }
      },
      "AccountsDescendants": {
        "type": "object",
        "properties": {
          "auth_token": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Account' ID"
                },
                "name": {
                  "type": "string",
                  "description": "Account's name"
                },
                "realm": {
                  "type": "string",
                  "description": "Accounts'realm"
                },
                "tree": {
                  "type": "array",
                  "description": "Array of Account's antecesors",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "page_size": {
            "type": "number"
          },
          "request_id": {
            "type": "string"
          },
          "revision": {
            "type": "string"
          },
          "start_key": {
            "type": "string"
          },
          "status": "type:string"
        }
      },
      "AccountsChildren": {
        "type": "object",
        "properties": {
          "auth_token": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Account' ID"
                },
                "name": {
                  "type": "string",
                  "description": "Account's name"
                },
                "realm": {
                  "type": "string",
                  "description": "Accounts'realm"
                },
                "tree": {
                  "type": "array",
                  "description": "Array of Account's antecesors",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "page_size": {
            "type": "number"
          },
          "request_id": {
            "type": "string"
          },
          "revision": {
            "type": "string"
          },
          "start_key": {
            "type": "string"
          },
          "status": "type:string"
        }
      },
      "AccountCreationEdition": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Account Name",
            "nullable": false
          },
          "timezone": {
            "type": "string",
            "description": "Account timezone",
            "nullable": false
          },
          "realm": {
            "type": "string",
            "description": "Account realm",
            "nullable": true
          },
          "is_reseller": {
            "type": "boolean",
            "description": "Flag to indicate if account is reseller"
          },
          "service_plans": {
            "type": "array",
            "nullable": false,
            "items": {
              "type": "string",
              "description": "Service Plans IDs"
            }
          },
          "collaboration": {
            "type": "object",
            "description": "Collaboration settings",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Flag to indicate if collaboration is enabled",
                "nullable": true
              },
              "webrtc": {
                "type": "boolean",
                "description": "Flag to indicate if webrtc is enabled",
                "nullable": true
              }
            }
          },
          "address": {
            "type": "object",
            "$ref": "#/components/schemas/Address"
          },
          "override": {
            "type": "object",
            "description": "Values to override service plans",
            "nullable": true,
            "properties": {
              "service_plan_id": {
                "type": "object",
                "description": "ID of the service plan to override",
                "properties": {
                  "users": {
                    "type": "object",
                    "description": "Values to override users values",
                    "properties": {
                      "user": {
                        "type": "object",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override user type rate"
                          }
                        }
                      },
                      "admin": {
                        "type": "object",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override admin user type rate"
                          }
                        }
                      },
                      "_all": {
                        "type": "object",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override all user types rate"
                          }
                        }
                      }
                    }
                  },
                  "phone_numbers": {
                    "type": "object",
                    "description": "Values to override phone_numbers values",
                    "properties": {
                      "caribbean": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "did_us": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "emergency": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "international": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "local": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "sri_lanka": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "string",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "toll_us": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "tollfree_us": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "unknown": {
                        "type": "object",
                        "nullable": true,
                        "description": "Call restriction to override",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override call restriction rate"
                          }
                        }
                      },
                      "_all": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                          "rate": {
                            "type": "number",
                            "description": "value to override all call restrictions rates"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "limits": {
            "type": "object",
            "description": "Account limits",
            "nullable": true,
            "properties": {
              "inbound_trunks": {
                "type": "number",
                "description": "Amount of inbound trunks for the account",
                "nullable": true
              },
              "outbound_trunks": {
                "type": "number",
                "description": "Amount of outbound trunks for the account",
                "nullable": true
              },
              "twoway_trunks": {
                "type": "number",
                "description": "Amount of two way trunks for the account",
                "nullable": true
              }
            }
          },
          "call_recording": {
            "type": "object",
            "description": "Call recording information",
            "nullable": true,
            "properties": {
              "enabled": {
                "type": "boolean",
                "nullable": true,
                "description": "Enables call recording at account level"
              },
              "retention_duration": {
                "type": "number",
                "description": "Amount of days to retain call recordings",
                "nullable": true
              }
            }
          },
          "credit": {
            "type": "object",
            "description": "Credit information",
            "nullable": true,
            "properties": {
              "treshold_alert": {
                "type": "number",
                "description": "Send notification to user when balance falls below this amount",
                "nullable": true
              },
              "recharge_treshold": {
                "type": "number",
                "description": "Auto recharge credit when balance falls below this amount",
                "nullable": true
              },
              "recharge_amount": {
                "type": "number",
                "description": "Amount of credit to auto recharge",
                "nullable": true
              }
            }
          },
          "users": {
            "type": "array",
            "description": "Users to add on account creation",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/UserAdd"
            }
          },
          "auto_provision": {
            "type": "object",
            "description": "Autoprovisioning parameters for UCP and UCP mobile",
            "properties": {
              "ucp": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "codecs": {
                    "type": "object",
                    "properties": {
                      "audio": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "ucp_mobile": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "codecs": {
                    "type": "object",
                    "properties": {
                      "audio": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "video": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "contact": {
            "type": "object",
            "properties": {
              "technical": {
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "Full name of contact"
                  },
                  "number": {
                    "type": "string",
                    "description": "Phone number of  contact"
                  }
                }
              }
            }
          }
        }
      },
      "Trunk": {
        "description": "SIP trunk",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "grace_period": {
            "type": "number"
          },
          "emergency": {
            "type": "boolean"
          },
          "rules": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "weight_cost": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gateways": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Trunks": {
        "description": "Account SIP trunks",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Trunk"
        }
      },
      "MobileAppData": {
        "type": "object",
        "properties": {
          "cloud_id": {
            "type": "string",
            "description": "Mobile app ID"
          },
          "username": {
            "type": "string",
            "description": "Mobile app username"
          },
          "password": {
            "type": "string",
            "description": "Mobile app password"
          }
        }
      },
      "account": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "SIP username"
          },
          "password": {
            "type": "string",
            "description": "SIP password"
          },
          "host": {
            "type": "string",
            "description": "SIP server IP"
          },
          "codecOrder": {
            "type": "string",
            "description": "List of enabled codecs"
          },
          "codecOrder3G": {
            "type": "string",
            "description": "List of enabled codecs for 3G"
          }
        }
      },
      "MobileContact": {
        "type": "object",
        "properties": {
          "entryID": {
            "type": "string",
            "description": "unique ID for this contact"
          },
          "label": {
            "type": "string",
            "description": "Label for this contact"
          },
          "type": {
            "type": "string",
            "description": "one of tel, email, url"
          },
          "URI": {
            "type": "string",
            "description": "The value of contact entry. The value depends on type, it is either a phone number, email or URL."
          }
        }
      },
      "MobileContacts": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "user ID"
          },
          "displayname": {
            "type": "string",
            "description": "First Name Last Name"
          },
          "fname": {
            "type": "string",
            "description": "First name"
          },
          "lname": {
            "type": "string",
            "description": "Last name"
          },
          "contactEntries": {
            "type": "array",
            "description": "List of contacts",
            "items": {
              "$ref": "#/components/schemas/MobileContact"
            }
          }
        }
      },
      "MobileDevice": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Mobile device name"
          },
          "token_id": {
            "type": "string",
            "description": "Device TOKEN ID. Unique key"
          },
          "platform": {
            "type": "string",
            "description": "android / ios"
          },
          "user": {
            "type": "string",
            "description": "username associated to device"
          },
          "extension": {
            "type": "string",
            "description": "extension associated to device"
          },
          "model_name": {
            "type": "string",
            "description": "Device model name"
          },
          "model_number": {
            "type": "string",
            "description": "Device model number"
          },
          "os_version": {
            "type": "string",
            "description": "Device Operative system version"
          },
          "registered": {
            "type": "boolean",
            "description": "Flag that indicates if device is registered or not"
          },
          "last_registered": {
            "type": "number",
            "description": "UNIX epoch with last registered time"
          },
          "last_push": {
            "type": "number",
            "description": "UNIX epoch with last time push sent to device"
          }
        }
      },
      "DidNumbers": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "MainNumbers": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "Number": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "phone number"
          },
          "in_use": {
            "type": "boolean",
            "description": "Indicates if number is being used by any object in system"
          },
          "used_by": {
            "type": "string",
            "description": "Indicates what is using this number"
          },
          "created": {
            "type": "number",
            "description": "UNIX epoch with created time"
          },
          "updated": {
            "type": "number",
            "description": "UNIX epoch with updated time"
          },
          "outbound_cid": {
            "type": "string",
            "description": "Oubound Caller ID number"
          },
          "inbound_cid": {
            "type": "boolean",
            "description": "Indicates if caller ID nummber must be showed for incoming calls"
          }
        }
      },
      "Numbers": {
        "type": "object",
        "properties": {
          "number": {
            "type": "object",
            "$ref": "#/components/schemas/Number"
          }
        }
      },
      "FreeNumbers": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "NumberCID": {
        "type": "object",
        "properties": {
          "outbound_cid": {
            "type": "string",
            "description": "Oubound Caller ID number"
          },
          "inbound_cid": {
            "type": "boolean",
            "description": "Indicates if caller ID nummber must be showed for incoming calls"
          }
        }
      },
      "Device": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Device name"
          },
          "enabled": {
            "type": "boolean",
            "description": "Boolean to indicate if device is enabled"
          },
          "owner_id": {
            "type": "string",
            "description": "ID of the user that owns the device"
          },
          "sip": {
            "type": "object",
            "description": "SIP device information",
            "properties": {
              "username": {
                "type": "string",
                "description": "SIP username"
              },
              "password": {
                "type": "string",
                "description": "SIP password"
              },
              "expire_seconds": {
                "type": "string",
                "description": "Registration expire seconds"
              },
              "invite_format": {
                "type": "string",
                "description": "SIP INVITE format"
              },
              "method": {
                "type": "string",
                "description": "SIP method"
              }
            }
          }
        }
      },
      "Webphone": {
        "type": "object",
        "properties": {
          "account": {
            "type": "object",
            "description": "Account information",
            "properties": {
              "id": {
                "type": "string",
                "description": "Account ID"
              },
              "name": {
                "type": "string",
                "description": "Account name"
              },
              "realm": {
                "type": "string",
                "description": "Account realm"
              }
            }
          },
          "user": {
            "type": "object",
            "description": "User Information",
            "properties": {
              "id": {
                "type": "string",
                "description": "User ID"
              },
              "username": {
                "type": "string",
                "description": "User name"
              },
              "extension": {
                "type": "string",
                "description": "User extension number"
              },
              "device": {
                "type": "object",
                "$ref": "#/components/schemas/Device"
              }
            }
          }
        }
      },
      "Callflow": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Callflow Name",
            "required": true
          },
          "type": {
            "type": "string",
            "description": "Callflow Type",
            "required": true
          },
          "numbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Callflow Numbers",
            "required": true
          },
          "patterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Callflow Patterns",
            "required": true
          },
          "modules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Callflow module type (user, callflow, ring_group, temporal_route, etc)",
                  "required": true
                },
                "data": {
                  "type": "object",
                  "description": "Callflow module data",
                  "required": true
                }
              }
            },
            "description": "Callflow Modules list",
            "required": true
          }
        }
      },
      "Queue": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Queue name"
          },
          "max_time_caller_remains": {
            "type": "number",
            "description": "Maximum time (in minutes) that a caller will remain in a queue if call is not answered"
          },
          "call_only_if_registered_agents": {
            "type": "boolean",
            "description": "Calls will be routed to agents only if at least one agent is registered"
          },
          "strategy": {
            "type": "string",
            "description": "One of simultaneous, single, or weighted_random"
          },
          "timeout": {
            "type": "number",
            "description": "Maximum time (in seconds)"
          },
          "moh": {
            "type": "string",
            "description": "ID of media to reproduce as music on hold"
          },
          "extensions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "extension",
                "prepend",
                "emergency_mode"
              ],
              "properties": {
                "extension": {
                  "type": "string",
                  "description": "Extension Number"
                },
                "prepend": {
                  "type": "string",
                  "description": "Prepend Action"
                },
                "emergency_mode": {
                  "type": "boolean",
                  "description": "Emergency mode for extension"
                }
              }
            }
          },
          "dids": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "did",
                "prepend",
                "emergency_mode"
              ],
              "properties": {
                "did": {
                  "type": "string",
                  "description": "DID Number"
                },
                "prepend": {
                  "type": "string",
                  "description": "Prepend Action"
                },
                "emergency_mode": {
                  "type": "boolean",
                  "description": "Emergency mode for DID"
                }
              }
            }
          },
          "pre_connect": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "action"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Pre Connect action type"
                },
                "action": {
                  "type": "string",
                  "description": "Pre Connect action"
                },
                "media_id": {
                  "type": "string",
                  "description": "ID of media file to reproduce"
                },
                "time": {
                  "type": "number",
                  "description": "Time in seconds"
                }
              }
            }
          },
          "agents": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "One of user, device, group"
                },
                "id": {
                  "type": "string",
                  "description": "ID of element user, device, or group"
                },
                "delay": {
                  "type": "number",
                  "description": "Delay before calling this agent",
                  "nullable": true
                },
                "timeout": {
                  "type": "number",
                  "description": "Max time to ring agent before retry",
                  "nullable": true
                }
              }
            }
          },
          "next_actions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "The type of next action (e.g., queue, voicemail, send_email)"
                },
                "data": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "IDs of the users (for send_email action)"
                      }
                    }
                  ],
                  "description": "For queue or voicemail actions, contains the ID of the queue or voicemail."
                }
              }
            }
          },
          "after_actions": {
            "type": "array",
            "description": "A list of actions to execute after the call ends",
            "items": {
              "type": "object",
              "required": [
                "type",
                "enabled"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "The type of after action (e.g., api_call)"
                },
                "enabled": {
                  "type": "boolean",
                  "description": "Indicates if the action is enabled"
                },
                "api_call_action": {
                  "type": "object",
                  "required": [
                    "url",
                    "method"
                  ],
                  "description": "Action to make an API call",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "The URL to call"
                    },
                    "method": {
                      "type": "string",
                      "description": "HTTP method to use (GET, POST, etc.)"
                    },
                    "headers": {
                      "type": "object",
                      "description": "HTTP headers to include in the API call",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "body": {
                      "type": "string",
                      "description": "The body content to send in the API call"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Queues": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Queue"
        }
      },
      "CallRated": {
        "type": "object",
        "description": "Call and billing information about a call",
        "properties": {
          "start_time": {
            "type": "integer",
            "description": "Initial call time in Unix timestamp"
          },
          "caller_id_name": {
            "type": "string",
            "description": "Caller ID Name"
          },
          "caller_id_number": {
            "type": "string",
            "description": "Caller ID Number"
          },
          "callee_id_name": {
            "type": "string",
            "description": "Callee ID Name"
          },
          "callee_id_number": {
            "type": "string",
            "description": "Callee ID Number"
          },
          "to": {
            "type": "string",
            "description": "Destination number"
          },
          "from": {
            "type": "string",
            "description": "CDR from field"
          },
          "account_id": {
            "type": "string",
            "description": "Account ID"
          },
          "account_name": {
            "type": "string",
            "description": "Account name"
          },
          "minutes": {
            "type": "integer",
            "description": "Billable minutes"
          },
          "amount": {
            "type": "number",
            "description": "Amount charged for this call"
          }
        }
      },
      "CallsRated": {
        "type": "object",
        "description": "Call and billing information about all calls",
        "properties": {
          "total_ammount": {
            "type": "number",
            "description": "Total billable amount"
          },
          "total_minutes": {
            "type": "integer",
            "description": "Total billable minutes"
          },
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallRated"
            }
          }
        }
      },
      "CallsRatedByNumber": {
        "type": "object",
        "description": "Call and billing information about all calls",
        "properties": {
          "totals": {
            "type": "object",
            "description": "Totals for all calls",
            "properties": {
              "minutes": {
                "type": "integer",
                "description": "Total billable minutes"
              },
              "amount": {
                "type": "number",
                "description": "Total charge amount"
              },
              "total_calls": {
                "type": "integer",
                "description": "Total calls rated"
              },
              "inbound_calls": {
                "type": "integer",
                "description": "Total inbound calls rated"
              },
              "outbound_calls": {
                "type": "integer",
                "description": "Total outbound calls rated"
              }
            }
          },
          "summary_by_number": {
            "type": "object",
            "description": "Totals per number",
            "properties": {
              "number": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Extension/number name"
                  },
                  "minutes": {
                    "type": "integer",
                    "description": "Total billable minutes"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Total charge amount"
                  },
                  "total_calls": {
                    "type": "integer",
                    "description": "Total calls rated"
                  },
                  "inbound_calls": {
                    "type": "integer",
                    "description": "Total inbound calls rated"
                  },
                  "outbound_calls": {
                    "type": "integer",
                    "description": "Total outbound calls rated"
                  }
                }
              }
            }
          }
        }
      },
      "FonoUCCallRated": {
        "type": "object",
        "description": "Call and billing information about a call",
        "properties": {
          "start_time": {
            "type": "integer",
            "description": "Initial call time in Unix timestamp"
          },
          "extension": {
            "type": "string",
            "description": "Extension number if an extension was envolved on call"
          },
          "caller_id_name": {
            "type": "string",
            "description": "Caller ID Name"
          },
          "caller_id_number": {
            "type": "string",
            "description": "Caller ID Number"
          },
          "callee_id_name": {
            "type": "string",
            "description": "Callee ID Name"
          },
          "callee_id_number": {
            "type": "string",
            "description": "Callee ID Number"
          },
          "Destination": {
            "type": "string",
            "description": "Destination number"
          },
          "call_id": {
            "type": "string",
            "description": "Call ID"
          },
          "account_id": {
            "type": "string",
            "description": "Account ID"
          },
          "minutes": {
            "type": "integer",
            "description": "Billable minutes"
          },
          "amount": {
            "type": "number",
            "description": "Amount charged for this call"
          },
          "account_name": {
            "type": "string",
            "description": "Account name"
          },
          "duration_seconds": {
            "type": "integer",
            "description": "duration seconds"
          },
          "billing_seconds": {
            "type": "number",
            "description": "billing_seconds"
          },
          "direction": {
            "type": "string",
            "description": "Inbound/Outbound"
          },
          "hangup_cause": {
            "type": "string",
            "description": "hangup cause"
          },
          "flat_rate": {
            "type": "boolean",
            "description": "True if call is flat rate rated"
          }
        }
      },
      "FonoUCCallsRated": {
        "type": "object",
        "description": "Call and billing information about all calls",
        "properties": {
          "total_ammount": {
            "type": "number",
            "description": "Total billable amount"
          },
          "total_minutes": {
            "type": "integer",
            "description": "Total billable minutes"
          },
          "total_calls": {
            "type": "integer",
            "description": "Total calls rated"
          },
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FonoUCCallRated"
            }
          }
        }
      },
      "CdrAnonymizeRequest": {
        "type": "object",
        "required": [
          "start_date",
          "end_date"
        ],
        "description": "Send `user_id` or `user_ext` (or both, for the same user).",
        "properties": {
          "user_id": {
            "type": "string",
            "description": "The user's id. A disabled or deleted user still works, because the CDRs keep the user id."
          },
          "user_ext": {
            "type": "string",
            "description": "The user's extension (presence id).",
            "example": "4440"
          },
          "start_date": {
            "type": "integer",
            "format": "int64",
            "description": "Start of the window, Unix time in seconds (UTC)."
          },
          "end_date": {
            "type": "integer",
            "format": "int64",
            "description": "End of the window, Unix time in seconds (UTC). At most 93 days after start_date."
          },
          "stay_id": {
            "type": "string",
            "maxLength": 128,
            "description": "Your reference (reservation, ticket), saved on every scrubbed record."
          },
          "label": {
            "type": "string",
            "maxLength": 64,
            "default": "Guest",
            "description": "Text that replaces party names."
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Count what would change and write nothing."
          }
        }
      },
      "ReportJobAccepted": {
        "type": "object",
        "required": [
          "job_id",
          "status",
          "created_at"
        ],
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued"
            ]
          },
          "estimated_time_seconds": {
            "type": "integer"
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CdrRerateSummary": {
        "type": "object",
        "properties": {
          "scanned": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "errors": {
            "type": "integer"
          },
          "dryRun": {
            "type": "boolean"
          }
        }
      },
      "CdrAnonymizeSummary": {
        "type": "object",
        "properties": {
          "scanned": {
            "type": "integer",
            "description": "Call records found in the window (all legs)."
          },
          "anonymized": {
            "type": "integer",
            "description": "Records scrubbed by this job (dry run - records that would be)."
          },
          "skipped": {
            "type": "integer",
            "description": "Records already anonymized by an earlier job."
          },
          "errors": {
            "type": "integer",
            "description": "Records or SIP logs that could not be read, saved or deleted. Above 0 means the job ends failed."
          },
          "dryRun": {
            "type": "boolean"
          },
          "sipLogsDeleted": {
            "type": "integer",
            "description": "SIP logs deleted (dry run - that would be deleted)."
          }
        }
      },
      "ReportJobStatus": {
        "type": "object",
        "required": [
          "job_id",
          "status",
          "progress",
          "created_at"
        ],
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "Only `completed` means the work is done. After `failed`, send the same request again."
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "message": {
            "type": "string"
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "started_at": {
            "type": "integer",
            "format": "int64"
          },
          "completed_at": {
            "type": "integer",
            "format": "int64"
          },
          "job_error": {
            "type": "string",
            "description": "Why the job failed."
          },
          "download_url": {
            "type": "string",
            "description": "CSV jobs only, when completed."
          },
          "rerate_summary": {
            "$ref": "#/components/schemas/CdrRerateSummary"
          },
          "anonymize_summary": {
            "$ref": "#/components/schemas/CdrAnonymizeSummary"
          }
        }
      },
      "FonoUCCallsRatedByNumber": {
        "type": "object",
        "description": "Call and billing information about calls",
        "properties": {
          "totals": {
            "type": "object",
            "description": "Totals for all calls",
            "properties": {
              "minutes": {
                "type": "integer",
                "description": "Total billable minutes"
              },
              "amount": {
                "type": "number",
                "description": "Total charge amount"
              },
              "total_calls": {
                "type": "integer",
                "description": "Total calls rated"
              },
              "inbound_calls": {
                "type": "integer",
                "description": "Total inbound calls rated"
              },
              "outbound_calls": {
                "type": "integer",
                "description": "Total outbound calls rated"
              }
            }
          },
          "summary_by_number": {
            "type": "object",
            "description": "Totals per number",
            "properties": {
              "number": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Extension/number name"
                  },
                  "minutes": {
                    "type": "integer",
                    "description": "Total billable minutes"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Total charge amount"
                  },
                  "total_calls": {
                    "type": "integer",
                    "description": "Total calls rated"
                  },
                  "inbound_calls": {
                    "type": "integer",
                    "description": "Total inbound calls rated"
                  },
                  "outbound_calls": {
                    "type": "integer",
                    "description": "Total outbound calls rated"
                  }
                }
              }
            }
          }
        }
      },
      "FonoUCCallsRateSummary": {
        "type": "object",
        "description": "Call and billing information about calls",
        "properties": {
          "total_amount": {
            "type": "number",
            "description": "Total charge amount"
          },
          "total_minutes": {
            "type": "number",
            "description": "Total minutes"
          },
          "total_calls": {
            "type": "number",
            "description": "Total calls"
          }
        }
      },
      "FonoUCCallsRateSummaryForAllChildren": {
        "type": "array",
        "description": "Call and billing information about calls for all children",
        "items": {
          "type": "object",
          "properties": {
            "account_id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "total_amount": {
              "type": "number",
              "description": "Total charge amount"
            },
            "total_minutes": {
              "type": "number",
              "description": "Total minutes"
            },
            "total_calls": {
              "type": "number",
              "description": "Total calls"
            }
          }
        }
      },
      "CDRInbound": {
        "type": "object",
        "description": "CDR information for inbound reports",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of CDR in database"
          },
          "start_time": {
            "type": "integer",
            "description": "Initial call time in Unix timestamp"
          },
          "caller_id_name": {
            "type": "string",
            "description": "Caller ID Name"
          },
          "caller_id_number": {
            "type": "string",
            "description": "Caller ID Number"
          },
          "destination": {
            "type": "string",
            "description": "DID number"
          },
          "callee_id_name": {
            "type": "string",
            "description": "Callee ID Name"
          },
          "callee_id_number": {
            "type": "string",
            "description": "Callee ID Number"
          },
          "duration_seconds": {
            "type": "string",
            "description": "Call duration in seconds"
          },
          "billing_seconds": {
            "type": "string",
            "description": "Billable seconds of call"
          },
          "hangup_cause": {
            "type": "string",
            "description": "Text indicating hangup cause"
          }
        }
      },
      "AgentQueuesStatus": {
        "type": "object",
        "description": "Agent information",
        "properties": {
          "id": {
            "type": "string",
            "description": "User ID"
          },
          "name": {
            "type": "string",
            "description": "Username"
          },
          "extension": {
            "type": "string",
            "description": "User extension"
          },
          "queues": {
            "type": "array",
            "description": "Queues Information",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Queue ID"
                },
                "name": {
                  "type": "string",
                  "description": "Queue name"
                },
                "logged_in": {
                  "type": "boolean",
                  "description": "True if Agent logged-in in queue"
                },
                "total_agents": {
                  "type": "integer",
                  "description": "Ammount of agents in this queue"
                },
                "logged_in_agents": {
                  "type": "integer",
                  "description": "Ammount of logged in agents in this queue"
                },
                "logged_out_agents": {
                  "type": "integer",
                  "description": "Ammount of logged out agents in this queue"
                },
                "did": {
                  "type": "string",
                  "description": "DID number assigned to this queue"
                },
                "callers_in_queue": {
                  "type": "integer",
                  "description": "Amount of callers waiting in queue"
                },
                "last_status_change": {
                  "type": "integer",
                  "description": "Unix timestamp with last time that agent status changed"
                }
              }
            }
          }
        }
      },
      "AddressbookContact": {
        "type": "object",
        "description": "contact to be stored in the addressbook",
        "properties": {
          "name": {
            "type": "string",
            "description": "contact name"
          },
          "phones": {
            "type": "array",
            "description": "contact's phone numbers",
            "items": {
              "type": "string"
            }
          },
          "companies": {
            "type": "array",
            "description": "companies to which the contact belongs",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AddressBook": {
        "type": "object",
        "properties": {
          "company": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressbookContact"
            }
          },
          "pvtType": {
            "type": "string"
          }
        }
      },
      "QuoteContact": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Contact name"
          },
          "phone_number": {
            "type": "string",
            "description": "Contact phone number"
          },
          "notes": {
            "type": "string",
            "description": "Additional contact notes"
          }
        }
      },
      "QuoteAddress": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street address"
          },
          "city": {
            "type": "string",
            "description": "City"
          },
          "state": {
            "type": "string",
            "description": "State/Province"
          },
          "zip_code": {
            "type": "string",
            "description": "ZIP/Postal code"
          },
          "country": {
            "type": "string",
            "description": "Country"
          }
        }
      },
      "QuoteItemApplied": {
        "type": "object",
        "properties": {
          "quote_item_id": {
            "type": "string",
            "description": "ID of the quote item"
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity of items"
          },
          "amount": {
            "type": "number",
            "format": "float",
            "description": "Amount before tax and discount"
          },
          "discount": {
            "type": "number",
            "format": "float",
            "description": "Discount amount"
          },
          "tax": {
            "type": "number",
            "format": "float",
            "description": "Tax amount"
          },
          "total": {
            "type": "number",
            "format": "float",
            "description": "Total amount"
          }
        }
      },
      "Quote": {
        "type": "object",
        "properties": {
          "company": {
            "type": "string",
            "description": "Company name"
          },
          "title": {
            "type": "string",
            "description": "Quote title"
          },
          "subject": {
            "type": "string",
            "description": "Quote subject"
          },
          "stage": {
            "type": "string",
            "description": "Quote stage"
          },
          "deal_name": {
            "type": "string",
            "description": "Deal name"
          },
          "valid_until": {
            "type": "integer",
            "description": "Valid until timestamp"
          },
          "pay_terms": {
            "type": "string",
            "description": "Payment terms"
          },
          "contact": {
            "$ref": "#/components/schemas/QuoteContact"
          },
          "account_name": {
            "type": "string",
            "description": "Account name"
          },
          "billing_address": {
            "$ref": "#/components/schemas/QuoteAddress"
          },
          "quote_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuoteItemApplied"
            }
          },
          "sub_total": {
            "type": "number",
            "format": "float",
            "description": "Subtotal amount"
          },
          "discount": {
            "type": "number",
            "format": "float",
            "description": "Discount amount"
          },
          "tax": {
            "type": "number",
            "format": "float",
            "description": "Tax amount"
          },
          "adjustment": {
            "type": "number",
            "format": "float",
            "description": "Adjustment amount"
          },
          "total": {
            "type": "number",
            "format": "float",
            "description": "Total amount"
          },
          "terms": {
            "type": "string",
            "description": "Terms and conditions"
          },
          "notes": {
            "type": "string",
            "description": "Additional notes"
          }
        }
      },
      "QuoteItem": {
        "type": "object",
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Name of the product"
          },
          "description": {
            "type": "string",
            "description": "Product description"
          },
          "price": {
            "type": "number",
            "format": "float",
            "description": "Product price"
          }
        }
      },
      "FMFMProfileDevice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "start": {
            "type": "string"
          },
          "end": {
            "type": "string"
          },
          "not_ring": {
            "type": "boolean"
          }
        }
      },
      "FMFMProfile": {
        "type": "object",
        "description": "FMFM Profile",
        "properties": {
          "id": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FMFMProfileDevice"
            }
          }
        }
      },
      "Tag": {
        "type": "object",
        "description": "Tag",
        "properties": {
          "category": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Tags": {
        "type": "array",
        "description": "List of Tags",
        "items": {
          "$ref": "#/components/schemas/Tag"
        }
      },
      "SecurityPoliciesMultifactorMethodApps": {
        "type": "object",
        "properties": {
          "ucp": {
            "type": "boolean"
          },
          "portal": {
            "type": "boolean"
          }
        }
      },
      "SetSecurityPolicies": {
        "type": "object",
        "description": "This object is used to create / update security policies",
        "properties": {
          "credentials_login": {
            "type": "object",
            "properties": {
              "portal": {
                "type": "object",
                "properties": {
                  "disabled": {
                    "type": "boolean",
                    "required": false,
                    "description": "Indicates whether the credentials login will be disabled in Portal"
                  }
                }
              },
              "ucp": {
                "type": "object",
                "properties": {
                  "disabled": {
                    "type": "boolean",
                    "required": false,
                    "description": "Indicates whether the credentials login will be disabled in UCP"
                  }
                }
              }
            }
          },
          "inactivity_period": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "required": true
              },
              "duration": {
                "type": "integer",
                "required": true
              }
            }
          },
          "lockout_threshold": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "required": true
              },
              "invalid_logins": {
                "type": "integer",
                "required": true
              }
            }
          },
          "password_age": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "required": true
              },
              "minimum_age": {
                "type": "integer",
                "required": true
              },
              "maximum_age": {
                "type": "integer",
                "required": true
              }
            }
          },
          "password_length": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "required": true
              },
              "minimum_length": {
                "type": "integer",
                "required": true
              },
              "maximum_length": {
                "type": "integer",
                "required": true
              }
            }
          },
          "password_history": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "required": true
              },
              "previous_passwords": {
                "type": "integer",
                "required": true
              }
            }
          },
          "mfa": {
            "type": "object",
            "properties": {
              "methods": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Authentication methods"
              },
              "email": {
                "$ref": "#/components/schemas/SecurityPoliciesMultifactorMethodApps"
              },
              "sms": {
                "$ref": "#/components/schemas/SecurityPoliciesMultifactorMethodApps"
              },
              "call": {
                "$ref": "#/components/schemas/SecurityPoliciesMultifactorMethodApps"
              }
            }
          }
        }
      },
      "FaxboxElement": {
        "type": "object",
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "caller_id": {
            "type": "string"
          },
          "caller_name": {
            "type": "string"
          },
          "fax_header": {
            "type": "string"
          },
          "fax_identity": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "media": {
            "type": "object",
            "properties": {
              "fax_option": {
                "type": "boolean"
              }
            }
          },
          "name": {
            "type": "string"
          },
          "owner_id": {
            "type": "string"
          },
          "retries": {
            "type": "integer"
          },
          "smtp_email_address": {
            "type": "string"
          },
          "smtp_permission_list": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "FaxElement": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "source_type": {
            "type": "string"
          },
          "folder": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer"
          },
          "created": {
            "type": "integer"
          },
          "faxbox_id": {
            "type": "string"
          },
          "media_type": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          },
          "cdr_doc_id": {
            "type": "string"
          },
          "_attachments": {
            "type": "object"
          },
          "result": {
            "type": "object",
            "properties": {
              "fax_bad_rows": {
                "type": "integer"
              },
              "fax_error_correction": {
                "type": "boolean"
              },
              "fax_receiver_id": {
                "type": "string"
              },
              "fax_speed": {
                "type": "integer"
              },
              "pages_sent": {
                "type": "integer"
              },
              "result_code": {
                "type": "integer"
              },
              "result_text": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "time_elapsed": {
                "type": "integer"
              }
            }
          }
        }
      },
      "SignupSettings": {
        "type": "object",
        "properties": {
          "free_numbers": {
            "type": "object",
            "properties": {
              "assign_free_number": {
                "type": "boolean"
              },
              "free_number_prefix": {
                "type": "string"
              }
            }
          },
          "otp": {
            "type": "object",
            "properties": {
              "cellphone_val": {
                "type": "boolean",
                "description": "Enable unique cellphone validation to complete OTP SMS verification"
              }
            }
          }
        }
      },
      "AddMusicOnHold": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "mp3",
              "x-wav"
            ]
          },
          "description": {
            "type": "string"
          }
        }
      },
      "AddMusicOnHoldResponse": {
        "type": "object",
        "properties": {
          "streamable": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "prompt_id": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "tts": {
            "type": "object",
            "properties": {
              "voice": {
                "type": "string"
              }
            }
          },
          "media_source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "ListOfMusicOnHoldElements": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "is_prompt": {
              "type": "boolean"
            },
            "language": {
              "type": "string"
            },
            "media_source": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        }
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "queue_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "retries": {
            "type": "integer"
          }
        }
      },
      "CampaignNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "campaign_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "retries": {
            "type": "string"
          }
        }
      },
      "ExportTaskConfig": {
        "type": "object",
        "properties": {
          "single_json_file": {
            "type": "boolean",
            "required": true,
            "description": "Indicates if the single json file task is scheduled or not"
          },
          "single_csv_file": {
            "type": "boolean",
            "required": true,
            "description": "Indicates if the single csv file task is scheduled or not"
          },
          "interval": {
            "type": "string",
            "required": true,
            "description": "Indicates the execution interval configured for the task"
          },
          "settings": {
            "type": "object",
            "properties": {
              "recipients": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "Email that will receive the exportable resource"
                }
              }
            }
          }
        }
      },
      "ExportMethodEmailConfig": {
        "type": "object",
        "properties": {
          "server": {
            "type": "string",
            "required": true,
            "description": "Domain of the SMTP Server (for instance smtp.gmail.com)"
          },
          "port": {
            "type": "number",
            "required": true,
            "description": "Port number of the SMTP Server (for instance 587)"
          },
          "username": {
            "type": "string",
            "required": true,
            "description": "Email address that will be the sender of the emails"
          },
          "password": {
            "type": "string",
            "required": true,
            "description": "Password of the account"
          }
        }
      },
      "ExportJob": {
        "type": "object",
        "description": "A named export of a single report. Unlike the per-report configuration under /config/export/tasks, which holds at most one export per report for the whole account, an account may have any number of jobs, including several of the same report with different recipients or intervals.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/ExportTaskConfig"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The job document id, assigned on creation; ignored in a request body"
              },
              "method": {
                "type": "string",
                "description": "Delivery method the job was filed under. Taken from the route, ignored in a request body"
              },
              "name": {
                "type": "string",
                "required": true,
                "description": "Name shown in the exportables list"
              },
              "description": {
                "type": "string",
                "description": "Optional free text saying what the export is for"
              },
              "report": {
                "type": "string",
                "required": true,
                "description": "Exported report (for instance all_calls)"
              },
              "enabled": {
                "type": "boolean",
                "description": "A disabled job keeps its configuration but is not scheduled. Defaults to true"
              }
            }
          }
        ]
      },
      "TranscriptionSettingsBody": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "required": true,
            "description": "Transcription provider"
          },
          "credentials": {
            "type": "object",
            "properties": {
              "api_key": {
                "type": "string",
                "required": true,
                "description": "API key"
              },
              "api_secret": {
                "type": "string",
                "description": "API secret"
              }
            }
          },
          "params": {
            "type": "object",
            "description": "Additional parameters for the transcription provider",
            "properties": {
              "language": {
                "type": "string",
                "description": "Language of the transcription"
              },
              "model": {
                "type": "string",
                "description": "Model of the transcription"
              }
            }
          },
          "account": {
            "type": "object",
            "properties": {
              "recordings": {
                "type": "object",
                "properties": {
                  "auto": {
                    "type": "boolean",
                    "description": "Automatically transcribe recordings"
                  }
                }
              },
              "voicemails": {
                "type": "object",
                "properties": {
                  "auto": {
                    "type": "boolean",
                    "description": "Automatically transcribe voicemails"
                  }
                }
              }
            }
          }
        }
      },
      "Registrations": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "account_name": {
              "type": "string",
              "required": true
            },
            "account_realm": {
              "type": "string",
              "required": true
            },
            "authorizing_id": {
              "type": "string",
              "required": true
            },
            "authorizing_type": {
              "type": "string",
              "required": true
            },
            "call_id": {
              "type": "string",
              "required": true
            },
            "contact": {
              "type": "string",
              "required": true
            },
            "contact_ip": {
              "type": "string",
              "required": true
            },
            "contact_port": {
              "type": "number",
              "required": true
            },
            "event_timestamp": {
              "type": "number",
              "required": true
            },
            "expires": {
              "type": "number",
              "required": true
            },
            "from_host": {
              "type": "string",
              "required": true
            },
            "from_user": {
              "type": "string",
              "required": true
            },
            "network_ip": {
              "type": "string",
              "required": true
            },
            "network_port": {
              "type": "string",
              "required": true
            },
            "original_contact": {
              "type": "string",
              "required": true
            },
            "owner_id": {
              "type": "string",
              "required": true
            },
            "owner_name": {
              "type": "string",
              "required": true
            },
            "proxy_ip": {
              "type": "string",
              "required": true
            },
            "proxy_port": {
              "type": "number",
              "required": true
            },
            "proxy_protocol": {
              "type": "string",
              "required": true
            },
            "source_ip": {
              "type": "string",
              "required": true
            },
            "source_port": {
              "type": "string",
              "required": true
            },
            "realm": {
              "type": "string",
              "required": true
            },
            "suppress_unregister_notify": {
              "type": "boolean",
              "required": true
            },
            "to_host": {
              "type": "string",
              "required": true
            },
            "to_user": {
              "type": "string",
              "required": true
            },
            "user_agent": {
              "type": "string",
              "required": true
            },
            "username": {
              "type": "string",
              "required": true
            },
            "mac_address": {
              "type": "string",
              "required": false
            },
            "manufacturer": {
              "type": "string",
              "required": false
            },
            "model": {
              "type": "string",
              "required": false
            },
            "extension": {
              "type": "string",
              "required": false
            }
          }
        }
      },
      "IPAddedByInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the user who added or modified the IP address."
          },
          "full_name": {
            "type": "string",
            "description": "The full name of the user who added or modified the IP address."
          }
        },
        "required": [
          "id",
          "full_name"
        ]
      },
      "whitelistedIPResponse": {
        "type": "object",
        "properties": {
          "ip": {
            "type": "string",
            "description": "The IP address."
          },
          "metadata": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string",
                "description": "A description for the IP address entry."
              },
              "date_added": {
                "type": "integer",
                "format": "int64",
                "description": "The timestamp when the IP address was added to the whitelist."
              },
              "added_by": {
                "$ref": "#/components/schemas/IPAddedByInfo",
                "description": "Information about the user who added the IP address."
              },
              "last_modified": {
                "type": "integer",
                "format": "int64",
                "description": "The timestamp when the IP address metadata was last modified."
              },
              "modified_by": {
                "$ref": "#/components/schemas/IPAddedByInfo",
                "description": "Information about the user who last modified the IP address metadata."
              },
              "expiration": {
                "type": "integer",
                "format": "int64",
                "description": "The timestamp indicating the expiration date of the IP address entry."
              },
              "usage_stats": {
                "type": "object",
                "properties": {
                  "access_count": {
                    "type": "integer",
                    "description": "The number of times the IP address has been accessed."
                  }
                }
              },
              "comments": {
                "type": "string",
                "description": "Additional comments or notes about the IP address."
              },
              "services": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of services associated with the IP address."
              }
            }
          }
        },
        "required": [
          "ip",
          "metadata"
        ]
      },
      "addToWhitelistRequest": {
        "type": "object",
        "properties": {
          "ip": {
            "type": "string",
            "format": "ipv4",
            "description": "The IP address to be added to the whitelist."
          },
          "description": {
            "type": "string",
            "description": "A description for the IP address entry."
          },
          "comments": {
            "type": "string",
            "description": "Additional comments or notes about the IP address."
          }
        }
      },
      "editIPInWhitelistRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "The updated description for the IP address entry."
          },
          "comments": {
            "type": "string",
            "description": "The updated comments or notes about the IP address."
          }
        }
      },
      "PhoneKey": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Type of the key"
          },
          "device_id": {
            "type": "string",
            "description": "ID of the device associated with the key"
          },
          "user_id": {
            "type": "string",
            "description": "ID of the user associated with the key"
          },
          "label": {
            "type": "string",
            "description": "Label for the key"
          },
          "value": {
            "type": "string",
            "description": "Value of the key"
          },
          "number": {
            "type": "string",
            "description": "Phone number associated with the key"
          },
          "page_ip": {
            "type": "string",
            "description": "IP address for paging"
          },
          "handset": {
            "type": "string",
            "description": "Handset information"
          },
          "listener": {
            "type": "object",
            "description": "Listener configuration for the key"
          }
        }
      },
      "KeypadLockType": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether keypad lock is enabled"
          },
          "pin": {
            "type": "string",
            "description": "PIN for keypad lock"
          }
        }
      },
      "CreatePhoneRequest": {
        "type": "object",
        "properties": {
          "mac": {
            "type": "string",
            "description": "MAC address of the phone"
          },
          "note": {
            "type": "string",
            "description": "Note or description for the phone"
          },
          "profile": {
            "type": "string",
            "description": "Profile ID for the phone"
          },
          "button_profile_id": {
            "type": "string",
            "description": "Live linked Buttons profile ID. Empty unlinks. Stored keys stay Line only while linked."
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PhoneKey"
            },
            "description": "List of phone keys"
          },
          "keypad_lock": {
            "$ref": "#/components/schemas/KeypadLockType",
            "description": "Keypad lock configuration for the phone"
          }
        }
      },
      "UserActivitySummaryValue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the user activity"
          },
          "call_id": {
            "type": "string",
            "description": "The call ID associated with the activity"
          },
          "user": {
            "type": "string",
            "description": "The user involved in the activity"
          },
          "start_time": {
            "type": "integer",
            "description": "The start time of the activity (Unix timestamp)"
          },
          "caller_id_name": {
            "type": "string",
            "description": "The caller's ID name"
          },
          "caller_id_number": {
            "type": "string",
            "description": "The caller's ID number"
          },
          "destination": {
            "type": "string",
            "description": "The destination of the call"
          },
          "callee_id_number": {
            "type": "string",
            "description": "The callee's ID number"
          },
          "callee_id_name": {
            "type": "string",
            "description": "The callee's ID name"
          },
          "duration_seconds": {
            "type": "string",
            "description": "The duration of the call in seconds"
          },
          "billing_seconds": {
            "type": "string",
            "description": "The billing duration of the call in seconds"
          },
          "hangup_cause": {
            "type": "string",
            "description": "The cause of call hangup"
          },
          "direction": {
            "type": "string",
            "description": "The direction of the call"
          },
          "extension": {
            "type": "string",
            "description": "The extension associated with the call"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "example": "Error message detailing what went wrong."
          }
        }
      },
      "FeaturesBundleDocPublicFields": {
        "type": "object",
        "properties": {
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "FeaturesPlanDocPublicFields": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "feature_bundle_id": {
            "type": "string"
          },
          "price": {
            "type": "integer"
          },
          "users_limit": {
            "type": "integer"
          },
          "unlimited_users": {
            "type": "boolean"
          }
        }
      },
      "Task": {
        "type": "object",
        "description": "Task",
        "properties": {
          "group": {
            "type": "string",
            "description": "The group that the task belongs to"
          },
          "category": {
            "type": "string",
            "description": "The category that the task belongs to"
          },
          "name": {
            "type": "string",
            "description": "Task name"
          },
          "status": {
            "type": "string",
            "description": "Task status (it could be running, scheduled or not_scheduled)"
          },
          "last_execution": {
            "type": "integer",
            "description": "Last execution timestamp of the task"
          },
          "next_run": {
            "type": "integer",
            "description": "Next execution timestamp of the task"
          },
          "configured": {
            "type": "boolean",
            "description": "Indicates whether the task is already configured to be scheduled"
          }
        }
      },
      "Tasks": {
        "type": "array",
        "description": "List of Tasks",
        "items": {
          "$ref": "#/components/schemas/Task"
        }
      },
      "AIAgent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the agent."
          },
          "name": {
            "type": "string",
            "description": "Name of the agent."
          },
          "description": {
            "type": "string",
            "description": "Description of the agent."
          },
          "instructions": {
            "type": "string",
            "description": "Instructions for the agent."
          },
          "extension": {
            "type": "string",
            "description": "Phone extension of the agent."
          }
        }
      },
      "TAgentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the agent.",
            "maxLength": 128,
            "example": "John Doe"
          },
          "description": {
            "type": "string",
            "description": "Description of the agent.",
            "example": "Support agent for customer inquiries."
          },
          "instructions": {
            "type": "string",
            "description": "Instructions for the agent.",
            "example": "Follow up on all customer tickets within 24 hours."
          },
          "extension": {
            "type": "string",
            "description": "Phone extension of the agent.",
            "example": "1001"
          }
        },
        "required": [
          "name",
          "instructions",
          "extension"
        ]
      },
      "FonoUCCallEventWebHook": {
        "type": "object",
        "properties": {
          "api_endpoint": {
            "type": "string"
          },
          "api_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "api_method": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retries": {
            "type": "integer"
          }
        }
      },
      "SubscriptionInfo": {
        "type": "object",
        "properties": {
          "api_endpoint": {
            "type": "string"
          },
          "api_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "api_method": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retries": {
            "type": "integer"
          }
        }
      },
      "Body": {
        "type": "object",
        "properties": {
          "disabled": {
            "type": "boolean"
          }
        }
      },
      "portalModuleEnabledBody": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "GSWaveDevice": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "Codecs": {
        "type": "object",
        "properties": {
          "audio": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "video": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UCP": {
        "type": "object",
        "properties": {
          "codecs": {
            "$ref": "#/components/schemas/Codecs"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "UCPMobile": {
        "type": "object",
        "properties": {
          "codecs": {
            "$ref": "#/components/schemas/Codecs"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCAutoProvision": {
        "type": "object",
        "properties": {
          "gs_wave": {
            "$ref": "#/components/schemas/GSWaveDevice"
          },
          "ucp": {
            "$ref": "#/components/schemas/UCP"
          },
          "ucp_mobile": {
            "$ref": "#/components/schemas/UCPMobile"
          }
        }
      },
      "FonoUCCallsCalleeIDSettings": {
        "type": "object",
        "properties": {
          "disabled": {
            "type": "boolean"
          },
          "mask": {
            "type": "string"
          }
        }
      },
      "FonoUCCallsCallerIDSettings": {
        "type": "object",
        "properties": {
          "inbound": {
            "type": "object",
            "properties": {
              "disabled": {
                "type": "boolean"
              },
              "name_mask": {
                "type": "string"
              },
              "number_mask": {
                "type": "string"
              }
            }
          }
        }
      },
      "FonoUCCallsSettings": {
        "type": "object",
        "properties": {
          "callee_id": {
            "$ref": "#/components/schemas/FonoUCCallsCalleeIDSettings"
          },
          "caller_id": {
            "$ref": "#/components/schemas/FonoUCCallsCallerIDSettings"
          },
          "disable_blind_transfer": {
            "type": "boolean"
          },
          "disable_call_disposition": {
            "type": "boolean"
          },
          "disable_rating": {
            "type": "boolean"
          },
          "draggable_call_popup": {
            "type": "boolean"
          },
          "transcription_enabled": {
            "type": "boolean"
          },
          "transcription_language": {
            "type": "string",
            "description": "\"es\", \"en\", \"multi\", etc."
          },
          "transcription_mode": {
            "type": "string",
            "description": "\"automatic\" or \"manual\""
          },
          "transcription_provider": {
            "type": "string",
            "description": "\"deepgram\" or \"google_stt\""
          },
          "wait_for_representative": {
            "type": "boolean",
            "description": "WaitForRepresentative lets UCP agents leave a call waiting in a queue and be alerted when a person picks up. Only that wait is transcribed, so it works without TranscriptionEnabled."
          }
        }
      },
      "Response": {
        "type": "object",
        "properties": {
          "callcenter": {
            "type": "boolean"
          },
          "cc_users": {
            "type": "integer"
          },
          "cx_channels": {
            "type": "boolean"
          },
          "cx_channels_auto_assignment_disabled": {
            "type": "boolean"
          },
          "cx_channels_managed_inbox_membership": {
            "type": "boolean"
          },
          "quality_management": {
            "type": "boolean"
          },
          "queues": {
            "type": "boolean"
          },
          "workforce_management": {
            "type": "boolean"
          }
        }
      },
      "optionalCount": {
        "type": "object",
        "properties": {
          "Set": {
            "type": "boolean"
          },
          "Value": {
            "type": "integer"
          }
        }
      },
      "deskCenterBody": {
        "type": "object",
        "properties": {
          "apps": {
            "type": "object",
            "description": "Apps are the Desk apps switched on for this account (DEV-6699), keyed by app id — stored as `QVOICE Platform.features.desk_apps`, which desk reads. The GET always sends it, with the stored switches including false (an empty object when none was saved). On the PUT, absent leaves them as saved and a present object is merged key by key, true and false both stored — the account is saved through a merge PATCH, which a missing key cannot switch off. A client that does not know an app cannot switch it off. That protects only the apps: the rest of this body keeps its own rules (a missing `enabled` is false, a missing quota or retention is cleared), so a PUT still has to carry the whole modal. A null value is refused rather than read as off.",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "attachment_quota_bytes": {
            "type": "integer",
            "description": "AttachmentQuotaBytes is the parent's cap on this account's Desk Center attachments. NULL MEANS \"follow the deployment\", which is not the same as zero — zero would be a cap of nothing, and desk's own fallback is itself capped rather than unlimited."
          },
          "customer_tickets": {
            "type": "boolean",
            "description": "CustomerTickets is whether the account RECEIVES tickets from its customer accounts (Portal Support) into its Desk Center \"Customer tickets\" board (DEV-6704). Same rule as Softphone: absent leaves the stored value unchanged, which is why it is a pointer; the GET always sends it (the STORED value, not the effective one)."
          },
          "enabled": {
            "type": "boolean"
          },
          "helpdesk_mail_ready": {
            "type": "boolean",
            "description": "HelpdeskMailReady is whether some Mailgun serves this account: the deployment's own ([helpdesk_mail] deployment_mailgun) or a reseller integration in its chain (helpdeskmailservice.MailReady). Response-only: the GET always sends it, resolved whether the Helpdesk app is on or off; the PUT ignores it, so a client that echoes the GET body is harmless."
          },
          "helpdesk_monthly_emails": {
            "description": "HelpdeskMonthlyEmails is the Helpdesk app's monthly email cap (DEV-6707), stored as `QVOICE Platform.limit.desk_helpdesk_monthly_emails`. THREE ANSWERS, like the apps and unlike the quota: absent leaves it as saved, null clears it (back to desk's default), a number sets it. Absent cannot mean \"clear\" here: a portal that does not know the field would lift a reseller's cost cap on every save. The GET always sends it, null when unset.",
            "allOf": [
              {
                "$ref": "#/components/schemas/optionalCount"
              }
            ]
          },
          "retention_days": {
            "type": "integer",
            "description": "RetentionDays is the LONGEST this account may keep attachments before they are deleted automatically. NULL MEANS NOTHING IS EVER DELETED, which is the opposite of the quota's null above: an absent quota falls back to a deployment number because the worst case is a refused upload, and an absent retention has no safe fallback because the worst case is somebody's evidence gone."
          },
          "softphone": {
            "type": "boolean",
            "description": "Softphone is whether Desk Center embeds the softphone (DEV-6686), shown in the same modal as Enabled because it is a Desk Center setting. IT RIDES THIS ENDPOINT for the reason the quota above does, and more strongly: a third route would be a third request for the one modal that already asks this question, and a flag that is meaningless without `enabled` has no business living somewhere `enabled` is not. ABSENT LEAVES IT AS SAVED — which is why it is a pointer, and the one place this endpoint's three optional fields do not agree. The quota and the retention treat absent as \"clear it\", because for those the modal is the only writer and clearing is a state somebody chooses. This field has other writers: the PUT replaces the whole body, so ANY client that does not know about the softphone — an older portalfrontend, a script changing the retention — would silently revoke a reseller's choice by saving the fields it does know. Absent therefore has to mean \"I am not answering this\", not \"no\"."
          }
        }
      },
      "deskStorageBody": {
        "type": "object",
        "properties": {
          "from_parent": {
            "type": "boolean",
            "description": "FromParent says whether the number above was chosen for this account. The screen needs it to tell \"capped at 1 GB here\" from \"following the deployment\", which look identical once both are rendered as a number."
          },
          "parent_quota_bytes": {
            "type": "integer",
            "description": "ParentQuotaBytes is the MOST this account's reseller may hand out — the ceiling the PUT enforces (model A of the Reseller Storage Ceilings design). IT IS HERE SO THE SCREEN CAN SAY THE LIMIT BEFORE SOMEBODY HITS IT. Without it the rule is only a 400 arriving after a save, which teaches the number by guessing downwards; an administrator who can see \"maximum 15,000 MB\" never types 20,000. A POINTER, because zero is a real ceiling here. A reseller allowed nothing may hand out nothing, and an omitted field has to mean \"no ceiling\" rather than \"a ceiling of zero\" — the two are opposite instructions. ON THIS ENDPOINT AND NOT ON THE FEATURE'S GET, for the reason written at the top of this file: desk calls that one on every request, and this costs an account read. Here it is charged once, when a reseller opens the modal, and only for an account that HAS a parent."
          },
          "quota_bytes": {
            "type": "integer",
            "description": "QuotaBytes is the cap THIS PARENT SET, and zero with FromParent false means nobody here decided one. IT IS NOT THE CAP IN FORCE WHEN NOBODY SET IT, and that is a limit of this endpoint rather than an omission. The fallback is the DEPLOYMENT's number, which lives in desk's own configuration file — goportalbackend does not read it and should not start, or the two would drift and the Portal would state a limit desk is not applying. So the screen shows the usage and says the account follows the deployment, without inventing a denominator."
          },
          "used_bytes": {
            "type": "integer"
          }
        }
      },
      "Action": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "item": {
            "type": "boolean",
            "description": "Item is a contact-centre configuration item (queues, campaigns, ...), which the role form shows as a subsection rather than a permission."
          },
          "writes": {
            "type": "boolean",
            "description": "Writes: some tool behind it changes something, so \"read\" is a step."
          }
        }
      },
      "Section": {
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Action"
            }
          },
          "module": {
            "type": "string"
          },
          "section": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "description": "Tools is every tool that names the section, for the modal's hints.",
            "items": {
              "type": "string"
            }
          },
          "writes": {
            "type": "boolean"
          }
        }
      },
      "mcpFeatureBody": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "sections": {
            "type": "array",
            "description": "Sections is every role section and action the MCP's tools check, answered on GET so the modal offers exactly those; the labels come from the permissions registry the role form uses.",
            "items": {
              "$ref": "#/components/schemas/Section"
            }
          },
          "users": {
            "type": "object",
            "description": "Users is user ID -> limit key -> \"read\" | \"none\", the key being a role section (\"users.users\") or one of its actions (\"users.users.create\", \"callcenter.config.queues\"). ABSENT ON A PUT LEAVES THEM AS SAVED, so a client that only switches the MCP on or off does not wipe them; an empty object clears them.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "MeetingsJitsi": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "Meetings": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "guests_enabled": {
            "type": "boolean"
          },
          "jitsi": {
            "$ref": "#/components/schemas/MeetingsJitsi"
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "summary_enabled": {
            "type": "boolean"
          },
          "summary_prompt": {
            "type": "string"
          },
          "transcription_enabled": {
            "type": "boolean"
          },
          "translation_enabled": {
            "type": "boolean"
          }
        }
      },
      "resellerBillingFeatureBody": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "locationPrefixRequest": {
        "type": "object",
        "properties": {
          "prefix": {
            "type": "string"
          }
        }
      },
      "locationPrefixResponse": {
        "type": "object",
        "properties": {
          "prefix": {
            "type": "string"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Row": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "previous_prefix": {
            "type": "string",
            "description": "PreviousPrefix is the prefix the page was showing. When it is not the stored one the page is stale and the save is refused."
          }
        }
      },
      "locationPrefixesBody": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Row"
            }
          }
        }
      },
      "childrenAccount": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_working_account": {
            "type": "boolean"
          },
          "parent_id": {
            "type": "string"
          }
        }
      },
      "deskStorageRow": {
        "type": "object",
        "properties": {
          "from_parent": {
            "type": "boolean"
          },
          "quota_bytes": {
            "type": "integer"
          },
          "used_bytes": {
            "type": "integer"
          }
        }
      },
      "deskStorageBulkBody": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/deskStorageRow"
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string"
          },
          "line": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "accountImportCheck": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "integer"
          },
          "numbers": {
            "type": "integer"
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "users": {
            "type": "integer"
          }
        }
      },
      "CallRecordingDirection": {
        "type": "object",
        "properties": {
          "offnet": {},
          "onnet": {}
        }
      },
      "CallRecordingAccount": {
        "type": "object",
        "properties": {
          "any": {
            "$ref": "#/components/schemas/CallRecordingDirection"
          },
          "inbound": {
            "$ref": "#/components/schemas/CallRecordingDirection"
          },
          "outbound": {
            "$ref": "#/components/schemas/CallRecordingDirection"
          }
        }
      },
      "CallRecording": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/CallRecordingAccount"
          },
          "endpoint": {
            "$ref": "#/components/schemas/CallRecordingAccount"
          }
        }
      },
      "Restriction": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          }
        }
      },
      "CallRestriction": {
        "type": "object",
        "properties": {
          "caribbean": {
            "$ref": "#/components/schemas/Restriction"
          },
          "did_us": {
            "$ref": "#/components/schemas/Restriction"
          },
          "emergency": {
            "$ref": "#/components/schemas/Restriction"
          },
          "international": {
            "$ref": "#/components/schemas/Restriction"
          },
          "local": {
            "$ref": "#/components/schemas/Restriction"
          },
          "sri_lanka": {
            "$ref": "#/components/schemas/Restriction"
          },
          "toll_us": {
            "$ref": "#/components/schemas/Restriction"
          },
          "tollfree_us": {
            "$ref": "#/components/schemas/Restriction"
          },
          "unknown": {
            "$ref": "#/components/schemas/Restriction"
          }
        }
      },
      "DatabaseAddress": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "extended_address": {
            "type": "string"
          },
          "locality": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "street_address": {
            "type": "string"
          }
        }
      },
      "EmergencyCID": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "account_address": {
            "type": "boolean"
          },
          "address": {
            "$ref": "#/components/schemas/DatabaseAddress"
          },
          "number": {
            "type": "string"
          }
        }
      },
      "CompleteCID": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "number": {
            "type": "string"
          }
        }
      },
      "DatabaseCallerID": {
        "type": "object",
        "properties": {
          "emergency": {
            "$ref": "#/components/schemas/EmergencyCID"
          },
          "external": {
            "$ref": "#/components/schemas/CompleteCID"
          },
          "internal": {
            "$ref": "#/components/schemas/CompleteCID"
          }
        }
      },
      "AccountCDRSettings": {
        "type": "object",
        "properties": {
          "journey_trace_enabled": {
            "type": "boolean"
          }
        }
      },
      "Technical": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "number": {
            "type": "string"
          }
        }
      },
      "DatabaseContact": {
        "type": "object",
        "properties": {
          "technical": {
            "$ref": "#/components/schemas/Technical"
          }
        }
      },
      "dialPlanRuleInput": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "converter": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "suffix": {
            "type": "string"
          }
        }
      },
      "FonoUCAccountBilling": {
        "type": "object",
        "properties": {
          "auto_topup_count": {
            "type": "integer",
            "description": "AutoTopupCount is the number of automatic credit topups successfully charged within the current window (see AutoTopupWindowStart). It is capped by ai_concierge.max_auto_topups_per_month and reset to 0 when the window rolls. omitempty means existing documents read the field as 0 without any migration."
          },
          "auto_topup_window_start": {
            "type": "integer",
            "description": "AutoTopupWindowStart is the Unix timestamp (seconds) marking the start of the current rolling one-month window used to cap automatic credit topups (anti-fraud). Zero means no window has opened yet; the first topup opens one. Reset to \"now\" whenever the window rolls."
          },
          "changed_status_date": {
            "type": "integer"
          },
          "cycle": {
            "type": "string"
          },
          "next_billing_at": {
            "type": "integer",
            "description": "NextBillingAt is the Unix timestamp when this account is next due to be charged. The daily AI Concierge billing task uses it as an anniversary cursor: charge when now >= NextBillingAt, then bump by 1 month or 1 year depending on Cycle."
          },
          "pending_plan_id": {
            "type": "string",
            "description": "PendingPlanID holds the id of the AI Concierge service plan that will take effect at the next billing anniversary. Empty string means no pending change. Set by ChangeSubscription on a downgrade; cleared by the cancel endpoint, by an immediate upgrade, and by chargeAIConciergeAccount after it successfully applies the deferred switch. The tag intentionally omits omitempty so that a \"\" value is sent explicitly in the Crossbar patch body, clearing the field in CouchDB. Existing documents without the field read as \"\" (Go zero value), so no migration is required."
          },
          "status": {},
          "stripe_customer_id": {
            "type": "string",
            "description": "StripeCustomerID caches the Stripe customer id for this account. The billing client's GetCustomer reads this field first and only falls back to a Customer Search API call when it is empty. The field is written at signup (CreateAccount) and lazily on read (GetCustomer). Stripe remains the system of record; this is a cached pointer."
          },
          "trial_ending_notice_sent_at": {
            "type": "integer",
            "description": "TrialEndingNoticeSentAt is the Unix timestamp (seconds) at which the trial-ending \"about to charge\" email was sent to the account admin. Zero means the notice has not yet been sent. Written best-effort by the daily billing task; omitempty means existing documents read the field as 0 (unsent) without any migration."
          },
          "usage_reset_at": {
            "type": "integer",
            "description": "UsageResetAt is the Unix timestamp when the in-memory minute usage counter for this account should be zeroed next. Always rolls monthly regardless of Cycle so yearly-billed accounts still get a fresh monthly minute allowance."
          }
        }
      },
      "FonoUCAccountData": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "billing": {
            "$ref": "#/components/schemas/FonoUCAccountBilling"
          },
          "display_name": {
            "type": "string",
            "description": "DisplayName is the customer-facing agency/brokerage name. Kazoo account.Name may carry a _NNNN uniqueness suffix when duplicate display names are allowed."
          },
          "kind": {
            "type": "string",
            "description": "Kind is the account's place in a reseller's customer structure: AccountKindSingleSite, AccountKindOrganization or AccountKindLocation. Empty on accounts created before kinds existed; read it with Kind()."
          },
          "service_plan": {
            "type": "string"
          }
        }
      },
      "FonoUCCallInvite": {
        "type": "object",
        "properties": {
          "max_participants": {
            "type": "integer"
          }
        }
      },
      "FonoUCCallRecordingEncryption": {
        "type": "object",
        "properties": {
          "algorithm": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "encrypted_key": {
            "type": "string",
            "description": "Base64-encoded unencrypted key, used directly by Gorec"
          },
          "historical_keys": {
            "type": "object",
            "description": "Map of key_version -> encrypted_key for key rotation",
            "additionalProperties": {}
          },
          "historical_salts": {
            "type": "object",
            "description": "Map of key_version -> salt for salt rotation",
            "additionalProperties": {}
          },
          "key_id": {
            "type": "string"
          },
          "key_version": {
            "type": "integer"
          },
          "salt": {
            "type": "string"
          }
        }
      },
      "CallRecordingOnTheFlyToggle": {
        "type": "object",
        "properties": {
          "cc_calls": {
            "type": "boolean"
          },
          "regular_calls": {
            "type": "boolean"
          }
        }
      },
      "FonoUCCallRecording": {
        "type": "object",
        "properties": {
          "account_mode": {
            "type": "boolean"
          },
          "custom_filename": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "encryption": {
            "$ref": "#/components/schemas/FonoUCCallRecordingEncryption"
          },
          "is_filename_custom": {
            "type": "boolean"
          },
          "on_the_fly_toggle": {
            "$ref": "#/components/schemas/CallRecordingOnTheFlyToggle"
          },
          "retention_duration": {
            "type": "integer"
          },
          "service": {
            "type": "string"
          },
          "size_limit": {
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "FonoUCCallcenter": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCChat": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCCollaboration": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "limits": {
            "type": "object",
            "properties": {
              "members_per_channel": {
                "type": "integer"
              }
            }
          },
          "webrtc": {
            "type": "boolean"
          }
        }
      },
      "FonoUCCRMSalesforce": {
        "type": "object",
        "properties": {
          "connected_app_client_id": {
            "type": "string"
          },
          "connected_app_client_secret": {
            "type": "string"
          },
          "domain_prefix": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "FonoUCCRM": {
        "type": "object",
        "properties": {
          "salesforce": {
            "$ref": "#/components/schemas/FonoUCCRMSalesforce"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "DisaPinset": {
        "type": "object",
        "properties": {
          "disa_from_ignore_prefixes": {
            "type": "array",
            "items": {}
          },
          "disa_ignore_trunk_ids": {
            "type": "array",
            "items": {}
          },
          "disa_to_ignore_prefixes": {
            "type": "array",
            "items": {}
          },
          "enabled": {
            "type": "integer"
          },
          "groups": {
            "type": "array",
            "items": {}
          },
          "mode": {
            "type": "string"
          },
          "pins_v2": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      },
      "CustomRouting": {
        "type": "object",
        "properties": {
          "custom_caller_id": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              }
            }
          },
          "disa_pinset": {
            "$ref": "#/components/schemas/DisaPinset"
          },
          "enabled": {
            "type": "integer"
          },
          "engine": {
            "type": "string"
          },
          "trunk_route": {
            "type": "string"
          },
          "trunk_route_account_id": {
            "type": "string"
          }
        }
      },
      "Desktop": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "E911Confirmation": {
        "type": "object",
        "properties": {
          "at": {
            "type": "integer"
          },
          "by": {
            "type": "string"
          },
          "key": {
            "type": "string"
          }
        }
      },
      "FonoUCE911": {
        "type": "object",
        "properties": {
          "confirmed": {
            "$ref": "#/components/schemas/E911Confirmation"
          }
        }
      },
      "DatabaseFaxConfig": {
        "type": "object",
        "properties": {
          "cover_page_enabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCFeatures": {
        "type": "object",
        "properties": {
          "agent_state_disabled": {
            "type": "boolean"
          },
          "ai_assist": {
            "type": "boolean"
          },
          "auto_answer_c2c": {
            "type": "boolean"
          },
          "auto_logout_queues_on_unavailable": {
            "type": "boolean"
          },
          "desk_apps": {
            "type": "object",
            "description": "DeskApps are the Desk Center apps the reseller switched on for this account (DEV-6699), keyed by the app id desk registers (e.g. \"calendar\"). Desk reads it from `/ucp/v2/account` and treats only a literal true as on, and only under DeskCenter. Declared here so it reaches desk at all, and so a whole-document save from the Portal does not drop it.",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "desk_center": {
            "type": "boolean",
            "description": "DeskCenter gates the Desk Center product — the work-item engine, CRM and tickets. Absent reads as false, which is what this flag wants: it is a product being sold, and a flag that defaults on is not a decision the reseller made but one they never saw."
          },
          "desk_customer_tickets": {
            "type": "boolean",
            "description": "DeskCustomerTickets: the account RECEIVES tickets from its customer accounts (Portal Support) into its Desk Center \"Customer tickets\" board. Stored flag; no omitempty (SUP-511: absent must serialise as false). Read the effective value through CanUseDeskCustomerTickets."
          },
          "desk_softphone": {
            "type": "boolean",
            "description": "DeskSoftphone gates the softphone embedded inside Desk Center (DEV-6686): the agent takes and places calls in a rail beside the case instead of keeping UCP open in another tab. IT ONLY MEANS ANYTHING WITH DeskCenter ON, and the pair is read through CanUseDeskSoftphone rather than enforced on the write — the stored value is what the reseller last saved, which is what their modal must render back to them. Switching it on has a consequence worth naming where the flag is defined: a softphone registering for a user LOGS OUT that user's older session (the \"New session detected\" rule, SUP-644). An agent who opens desk with this on is signed out of UCP. That is the platform's single-session rule working, not a defect, and it is why this is a per-account choice."
          },
          "quality_management": {
            "type": "boolean"
          },
          "queues": {
            "type": "boolean"
          },
          "reseller_billing": {
            "type": "boolean",
            "description": "ResellerBilling gates the Books-backed price book and catalogue setup flow."
          },
          "ucp_click2call": {
            "type": "boolean"
          },
          "workforce_management": {
            "type": "boolean"
          }
        }
      },
      "FixedDestination": {
        "type": "object",
        "properties": {
          "destination": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCAccountIntegration": {
        "type": "object",
        "properties": {
          "enabled": {}
        }
      },
      "FonoUCAccountIntegrations": {
        "type": "object",
        "properties": {
          "google": {
            "$ref": "#/components/schemas/FonoUCAccountIntegration"
          },
          "microsoft": {
            "$ref": "#/components/schemas/FonoUCAccountIntegration"
          }
        }
      },
      "LDAPData": {
        "type": "object",
        "properties": {
          "auth": {
            "type": "boolean"
          }
        }
      },
      "FonoUCLimit": {
        "type": "object",
        "properties": {
          "cc_users": {
            "type": "integer"
          },
          "desk_attachment_bytes": {
            "type": "integer",
            "description": "DeskAttachmentBytes is how much Desk Center's attachments may add up to for this account (D15). HERE RATHER THAN IN A BLOCK OF ITS OWN because this struct is already \"tenant-scoped caps\" and that is exactly what it is. The other two are commercial and this one is operational, which is a difference in why somebody sets it rather than in what it is. SET BY THE PARENT RESELLER, never by the tenant: desk keeps the files in the platform's CouchDB, so the disk one account fills is every account's, and an override on the tenant's own screen would let them raise their own ceiling. Same axis as the Desk Center entitlement beside it (D14). A POINTER so \"not set\" and \"set to zero\" stay different answers. Nil means desk falls back to its deployment's number — which is itself capped rather than unlimited, so an absent value is never permission to fill the disk."
          },
          "desk_helpdesk_monthly_emails": {
            "type": "integer",
            "description": "DeskHelpdeskMonthlyEmails caps the replies Desk's Helpdesk app emails for this account in a calendar month (DEV-6707). QVOICE Platform's mail provider carries the cost, so the reseller decides it, never the tenant. NIL MEANS THE DEPLOYMENT DEFAULT (desk's own, 5000), and zero is a real answer: no email at all. OMITEMPTY ON PURPOSE. The account is saved through a merge PATCH, and flows that send a partial limit (NormalizeFonoUCLimitForDoc, seat edits) would otherwise send a null and clear a reseller's cap. Clearing it is an explicit null in the Desk Center save (portal.deskCenterPatch)."
          },
          "desk_retention_days": {
            "type": "integer",
            "description": "DeskRetentionDays is the LONGEST this account may keep Desk Center attachments before they are deleted automatically (D15). THE SAME AXIS AS THE QUOTA BESIDE IT, and the same owner: the cluster operator carries the disk, so how long it is carried for is theirs. The account's own admin may choose to delete SOONER — which only ever frees the parent's disk — and may not choose to keep files for longer. NIL MEANS NOTHING IS DELETED, which is the opposite of the quota's nil and deliberately so. An absent quota falls back to a deployment number because the worst case is a refused upload; an absent retention has no safe fallback, because the worst case is somebody's evidence gone. Automatic deletion happens only where somebody wrote a number down."
          },
          "users": {
            "type": "integer"
          }
        }
      },
      "DatabaseLocation": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "access_list": {
            "type": "array",
            "items": {}
          },
          "allowed_sip_trunks": {
            "type": "array",
            "items": {}
          },
          "caller_id": {},
          "directory": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "outbound_calls_disabled": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string"
          }
        }
      },
      "DatabaseLocations": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatabaseLocation"
            }
          },
          "default": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "model": {
            "type": "string"
          }
        }
      },
      "FonoUCMCP": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "users": {
            "type": "object",
            "description": "Users narrows, per user ID, what the MCP offers that user: group key (pkg/mcpperms) to \"read\" or \"none\". A group not listed is as the user's role allows; a limit never adds to the role.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "MCPCRMContactConfig": {
        "type": "object",
        "properties": {
          "additional_rules_notes": {
            "type": "string"
          },
          "lookup_contact_description_override": {
            "type": "string"
          },
          "qualified_disposition_ids": {
            "type": "array",
            "description": "QualifiedDispositionIDs: disposition document IDs that bump contact qualified_at on completed SaveCall (merged with persona.voice_qualified_disposition_ids).",
            "items": {
              "type": "string"
            }
          },
          "save_contact_description_override": {
            "type": "string"
          },
          "voice_qualified_recent_lookback_days": {
            "type": "integer",
            "description": "VoiceQualifiedRecentLookbackDays: rolling window for qualified_recent at lookup_contact (0 = use server default 30 unless persona overrides)."
          }
        }
      },
      "Mobile": {
        "type": "object",
        "properties": {
          "cloud_id": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          }
        }
      },
      "FonoUCNumbers": {
        "type": "object",
        "properties": {
          "allow_own_provider": {
            "type": "boolean",
            "description": "AllowOwnProvider lets this reseller buy with its own numbers provider."
          },
          "core_locations": {
            "type": "boolean",
            "description": "CoreLocations puts this reseller and every account under it on Core Locations only: new accounts start on Core and none can go back to Pivot."
          },
          "did_assignment": {
            "type": "boolean"
          },
          "show_carrier": {
            "type": "boolean",
            "description": "ShowCarrier lets this reseller see which carrier its numbers are on."
          },
          "wholesale_provider": {
            "type": "string"
          },
          "wholesale_provider_id": {
            "type": "string",
            "description": "WholesaleProviderID names the platform numbers provider set on this reseller. WholesaleProvider stays filled with its catalog id."
          }
        }
      },
      "FonoUCOmnichannel": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer"
          },
          "admin_user_api_key": {
            "type": "string"
          },
          "admin_user_id": {
            "type": "integer"
          },
          "auto_assignment_disabled": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "managed_inbox_membership": {
            "type": "boolean",
            "description": "ManagedInboxMembership opts the account into the SSO self-heal that re-scopes each Chatwoot inbox's members to its associated queue's agents. Default false: accounts that manage inbox membership directly in Chatwoot are left untouched."
          },
          "password": {
            "type": "string"
          }
        }
      },
      "FonoUCPortalModules": {
        "type": "object",
        "properties": {
          "ai": {
            "type": "boolean"
          },
          "crm": {
            "type": "boolean"
          }
        }
      },
      "FonoUCReports": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "agent_name_format": {
            "type": "string",
            "description": "AgentNameFormat is read by the Analytics frontend only; it does not affect the CSV exports that Custom switches."
          },
          "custom": {
            "type": "boolean"
          }
        }
      },
      "FonoUCResellerPreparedBy": {
        "type": "object",
        "properties": {
          "address": {},
          "brand_suffix": {
            "type": "string"
          },
          "channel_partner_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "legal_entity_name": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "quote_name": {
            "type": "string",
            "description": "The partner's overrides for a new quote's Prepared by block. Empty uses the default: the cluster's name, the creating user's email, the account's external caller ID. No omitempty: the account is saved with a PATCH, which keeps any key left out, so a cleared override has to be sent empty."
          }
        }
      },
      "FonoUCResellerBillingProfile": {
        "type": "object",
        "properties": {
          "active_assortment_version_id": {
            "type": "string"
          },
          "active_pricebook_version_id": {
            "type": "string"
          },
          "commission_rate": {
            "type": "number"
          },
          "default_quote_currency": {
            "type": "string"
          },
          "enabled_at": {
            "type": "string"
          },
          "initialized_at": {
            "type": "string"
          },
          "partner_note": {
            "type": "string"
          },
          "prepared_by": {
            "$ref": "#/components/schemas/FonoUCResellerPreparedBy"
          },
          "reseller_type": {
            "type": "string"
          },
          "setup_status": {
            "type": "string"
          },
          "sub_agent_code": {
            "type": "string"
          }
        }
      },
      "SignupFreeNumbers": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "prefix": {
            "type": "string"
          }
        }
      },
      "SignupOTP": {
        "type": "object",
        "properties": {
          "cellphone_val": {
            "type": "boolean"
          }
        }
      },
      "Signup": {
        "type": "object",
        "properties": {
          "free_numbers": {
            "$ref": "#/components/schemas/SignupFreeNumbers"
          },
          "otp": {
            "$ref": "#/components/schemas/SignupOTP"
          }
        }
      },
      "FonoUCSMS": {
        "type": "object",
        "properties": {
          "admin_off": {
            "type": "boolean",
            "description": "AdminOff says an admin turned SMS off. Automatic set-ups (a BulkVS numbers provider save, a number purchase) never turn it back on; only an admin turning SMS on clears it."
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCTranscriptionDeepgram": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "sentiment": {
            "type": "boolean",
            "description": "We need to investigate what would be interesting to add here"
          }
        }
      },
      "FonoUCTranscriptionSettings": {
        "type": "object",
        "properties": {
          "recordings": {},
          "voicemails": {}
        }
      },
      "FonoUCTranscription": {
        "type": "object",
        "properties": {
          "deepgram": {
            "$ref": "#/components/schemas/FonoUCTranscriptionDeepgram"
          },
          "enabled": {
            "type": "boolean"
          },
          "settings": {
            "$ref": "#/components/schemas/FonoUCTranscriptionSettings"
          }
        }
      },
      "FonoUCUCPAI": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "ui_disabled": {
            "type": "boolean"
          }
        }
      },
      "FonoUCUCPApps": {
        "type": "object",
        "properties": {
          "ai_concierge": {},
          "desktop": {},
          "mobile": {},
          "web": {}
        }
      },
      "FonoUCUCPCalls": {
        "type": "object",
        "properties": {
          "early_media": {}
        }
      },
      "FonoUCUCPContactCenter": {
        "type": "object",
        "properties": {
          "login_group": {},
          "login_per_queue": {}
        }
      },
      "FonoUCUCPDashboard": {
        "type": "object",
        "properties": {
          "activity": {},
          "cx_channels_full_screen": {
            "type": "boolean"
          },
          "devices": {},
          "missed_calls": {},
          "preferences": {}
        }
      },
      "FonoUCUCPSettings": {
        "type": "object",
        "properties": {
          "audio": {},
          "fmfm": {},
          "logout": {},
          "profile_image": {}
        }
      },
      "FonoUCUCPStun": {
        "type": "object",
        "properties": {
          "credential": {},
          "urls": {},
          "username": {}
        }
      },
      "FonoUCUCPUser": {
        "type": "object",
        "properties": {
          "recordings": {}
        }
      },
      "FonoUCUCP": {
        "type": "object",
        "properties": {
          "ai": {
            "$ref": "#/components/schemas/FonoUCUCPAI"
          },
          "apps": {
            "$ref": "#/components/schemas/FonoUCUCPApps"
          },
          "calls": {
            "$ref": "#/components/schemas/FonoUCUCPCalls"
          },
          "contact_center": {
            "$ref": "#/components/schemas/FonoUCUCPContactCenter"
          },
          "dashboard": {
            "$ref": "#/components/schemas/FonoUCUCPDashboard"
          },
          "date_format": {
            "type": "string"
          },
          "ice_candidate_policy": {
            "type": "string"
          },
          "ice_gathering_timeout_ms": {
            "type": "integer"
          },
          "lite": {
            "type": "boolean"
          },
          "pwa": {
            "type": "boolean"
          },
          "settings": {
            "$ref": "#/components/schemas/FonoUCUCPSettings"
          },
          "stun_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FonoUCUCPStun"
            }
          },
          "user": {
            "$ref": "#/components/schemas/FonoUCUCPUser"
          }
        }
      },
      "FonoUCAccount": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "account": {
            "$ref": "#/components/schemas/FonoUCAccountData"
          },
          "address": {
            "$ref": "#/components/schemas/DatabaseAddress"
          },
          "auto_provision": {
            "$ref": "#/components/schemas/FonoUCAutoProvision"
          },
          "billing": {
            "type": "string"
          },
          "billing_rate": {
            "type": "string"
          },
          "call_invite": {
            "$ref": "#/components/schemas/FonoUCCallInvite"
          },
          "call_recording": {
            "$ref": "#/components/schemas/FonoUCCallRecording"
          },
          "callcenter": {
            "$ref": "#/components/schemas/FonoUCCallcenter"
          },
          "callevents_webhook": {
            "$ref": "#/components/schemas/FonoUCCallEventWebHook"
          },
          "calls": {
            "$ref": "#/components/schemas/FonoUCCallsSettings"
          },
          "chat": {
            "$ref": "#/components/schemas/FonoUCChat"
          },
          "collaboration": {
            "$ref": "#/components/schemas/FonoUCCollaboration"
          },
          "crm": {
            "$ref": "#/components/schemas/FonoUCCRM"
          },
          "custom_routing": {
            "$ref": "#/components/schemas/CustomRouting"
          },
          "desktop": {
            "$ref": "#/components/schemas/Desktop"
          },
          "e911": {
            "$ref": "#/components/schemas/FonoUCE911"
          },
          "fax": {
            "$ref": "#/components/schemas/DatabaseFaxConfig"
          },
          "feature_plans": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "features": {
            "$ref": "#/components/schemas/FonoUCFeatures"
          },
          "fixed_destination": {
            "$ref": "#/components/schemas/FixedDestination"
          },
          "gorec": {
            "type": "object",
            "additionalProperties": {}
          },
          "integrations": {
            "$ref": "#/components/schemas/FonoUCAccountIntegrations"
          },
          "ldap": {
            "$ref": "#/components/schemas/LDAPData"
          },
          "limit": {
            "$ref": "#/components/schemas/FonoUCLimit"
          },
          "locations": {
            "$ref": "#/components/schemas/DatabaseLocations"
          },
          "mcp": {
            "$ref": "#/components/schemas/FonoUCMCP"
          },
          "mcp_crm_contact": {
            "description": "MCPCRMContact: account-wide defaults for CRM MCP tools (lookup_contact / save_contact); merged before persona overrides at MCP list time.",
            "allOf": [
              {
                "$ref": "#/components/schemas/MCPCRMContactConfig"
              }
            ]
          },
          "meetings": {
            "$ref": "#/components/schemas/Meetings"
          },
          "missed_calls_emails": {
            "type": "string"
          },
          "mobile": {
            "$ref": "#/components/schemas/Mobile"
          },
          "numbers": {
            "$ref": "#/components/schemas/FonoUCNumbers"
          },
          "omnichannel": {
            "$ref": "#/components/schemas/FonoUCOmnichannel"
          },
          "portal_modules": {
            "$ref": "#/components/schemas/FonoUCPortalModules"
          },
          "preflow": {
            "type": "object",
            "additionalProperties": {}
          },
          "reports": {
            "$ref": "#/components/schemas/FonoUCReports"
          },
          "reseller_billing": {
            "$ref": "#/components/schemas/FonoUCResellerBillingProfile"
          },
          "ringtones": {
            "type": "object",
            "additionalProperties": {}
          },
          "signup": {
            "$ref": "#/components/schemas/Signup"
          },
          "sms": {
            "$ref": "#/components/schemas/FonoUCSMS"
          },
          "tags_restriction": {
            "type": "boolean"
          },
          "transcription": {
            "$ref": "#/components/schemas/FonoUCTranscription"
          },
          "ucp": {
            "$ref": "#/components/schemas/FonoUCUCP"
          }
        }
      },
      "Interaccount": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "prefix": {
            "type": "string"
          }
        }
      },
      "MetaflowData": {
        "type": "object",
        "properties": {
          "format": {},
          "action": {},
          "record_on_answer": {},
          "record_on_bridge": {}
        }
      },
      "Metaflow": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/MetaflowData"
          },
          "module": {
            "type": "string"
          }
        }
      },
      "Metaflows": {
        "type": "object",
        "properties": {
          "binding_digit": {
            "type": "string"
          },
          "binding_key": {
            "type": "string"
          },
          "digit_timeout_ms": {
            "type": "integer"
          },
          "listen_on": {
            "type": "string"
          },
          "numbers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Metaflow"
            }
          }
        }
      },
      "MusicOnHold": {
        "type": "object",
        "properties": {
          "media_id": {
            "type": "string"
          }
        }
      },
      "FirstOcurrence": {
        "type": "object",
        "properties": {
          "sent_initial_call": {
            "type": "boolean"
          },
          "sent_initial_registration": {
            "type": "boolean"
          }
        }
      },
      "LowBalance": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "last_notification": {
            "type": "integer"
          },
          "sent_low_balance": {
            "type": "boolean"
          },
          "threshold": {
            "type": "number"
          }
        }
      },
      "Notifications": {
        "type": "object",
        "properties": {
          "first_occurrence": {
            "$ref": "#/components/schemas/FirstOcurrence"
          },
          "low_balance": {
            "$ref": "#/components/schemas/LowBalance"
          }
        }
      },
      "NumbersFeatures": {
        "type": "object",
        "properties": {
          "cname_enabled": {
            "type": "boolean"
          },
          "e911_enabled": {
            "type": "boolean"
          }
        }
      },
      "Topup": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "threshold": {
            "type": "number"
          }
        }
      },
      "ShowTab": {
        "type": "object",
        "properties": {
          "show_tab": {
            "type": "boolean"
          }
        }
      },
      "Balance": {
        "type": "object",
        "properties": {
          "show_credit": {
            "type": "boolean"
          },
          "show_header": {
            "type": "boolean"
          },
          "show_minutes": {
            "type": "boolean"
          },
          "show_tab": {
            "type": "boolean"
          }
        }
      },
      "MyAccount": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "balance": {
            "$ref": "#/components/schemas/Balance"
          },
          "billing": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "errorTracker": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "inbound": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "outbound": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "service_plan": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "transactions": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "twoway": {
            "$ref": "#/components/schemas/ShowTab"
          },
          "user": {
            "$ref": "#/components/schemas/ShowTab"
          }
        }
      },
      "UIRestrictions": {
        "type": "object",
        "properties": {
          "myaccount": {
            "$ref": "#/components/schemas/MyAccount"
          }
        }
      },
      "CallResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "media": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "callResponseRow": {
        "type": "object",
        "properties": {
          "builtin": {
            "$ref": "#/components/schemas/CallResponse"
          },
          "cause": {
            "type": "string"
          },
          "effective": {
            "$ref": "#/components/schemas/CallResponse"
          },
          "global": {
            "$ref": "#/components/schemas/CallResponse"
          },
          "inherited": {
            "$ref": "#/components/schemas/CallResponse"
          },
          "override": {
            "$ref": "#/components/schemas/CallResponse"
          }
        }
      },
      "callResponseListResponse": {
        "type": "object",
        "properties": {
          "causes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/callResponseRow"
            }
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "LimitsData": {
        "type": "object",
        "properties": {
          "allow_postpay": {
            "type": "boolean"
          },
          "allow_prepay": {
            "type": "boolean"
          },
          "calls": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "inbound_trunks": {
            "type": "integer"
          },
          "outbound_trunks": {
            "type": "integer"
          },
          "twoway_trunks": {
            "type": "integer"
          }
        }
      },
      "APILimits": {
        "type": "object",
        "properties": {
          "calls": {
            "type": "integer"
          },
          "inbound_trunks": {
            "type": "integer"
          },
          "outbound_trunks": {
            "type": "integer"
          },
          "twoway_trunks": {
            "type": "integer"
          }
        }
      },
      "accountNumberManagerResponse": {
        "type": "object",
        "properties": {
          "inherited_reconcile_regex": {
            "type": "string"
          },
          "overlay": {
            "type": "boolean"
          },
          "reconcile_regex": {
            "type": "string"
          }
        }
      },
      "Blacklist": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "callRatingReasonRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          }
        }
      },
      "deskTargetRequest": {
        "type": "object",
        "properties": {
          "from_queue": {
            "type": "boolean",
            "description": "FromQueue is \"create the work, and let the QUEUE say which board\" (D32). IT IS HERE SO THIS EDITOR CANNOT ERASE IT. The Portal assigns the disposition field by field from what it is sent, so a state it does not model is a state it destroys: a wrap-up set to \"the queue decides\" — which carries no workflow — was read back as \"creates nothing\" and written away by the next save of any unrelated field. Silently, on a screen that looked correct."
          },
          "status_id": {
            "type": "string",
            "description": "StatusID is optional. Empty means the workflow's entry status, which is computed rather than configured, so leaving this blank cannot go stale."
          },
          "workflow_id": {
            "type": "string",
            "description": "WorkflowID is the required half UNLESS the queue decides: a target with neither has nowhere to put the item. `required_without` rather than `required`, so the rule reads as what it is — a destination is mandatory and there are two ways to give one."
          }
        }
      },
      "DispositionCustomField": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "smsActionRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          }
        }
      },
      "SubdispositionOption": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "ai_instructions": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "SubdispositionLevel": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "ai_instructions": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubdispositionOption"
            }
          },
          "subdispositions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SubdispositionLevel"
            }
          }
        }
      },
      "SubdispositionsTree": {
        "type": "object",
        "properties": {
          "subdispositions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SubdispositionLevel"
            }
          }
        }
      },
      "newDispositionRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "crm_code": {
            "type": "string"
          },
          "desk_target": {
            "description": "DeskTarget names the Desk Center work item this disposition creates, if any (D16). Absent means no work item — see database.DispositionDeskTarget for why that is the default worth defending. Sent as null (or omitted) to clear it, which is how the Portal turns the behaviour off again.",
            "allOf": [
              {
                "$ref": "#/components/schemas/deskTargetRequest"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "field": {
            "$ref": "#/components/schemas/DispositionCustomField"
          },
          "follow_up_types": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "label": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "sms_action": {
            "description": "SMSAction is the SMS sent to the customer when this disposition is recorded on an answered call (SUP-581). Null or omitted clears it.",
            "allOf": [
              {
                "$ref": "#/components/schemas/smsActionRequest"
              }
            ]
          },
          "subdispositions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SubdispositionsTree"
            }
          },
          "title": {
            "type": "string"
          },
          "voice_live_transfer_eligible": {
            "type": "boolean",
            "description": "VoiceLiveTransferEligible: Portal — allow live transfer_call when tier matches this disposition Title."
          },
          "whatsapp_agent_notify": {
            "type": "string",
            "description": "Empty string = legacy tier heuristic; off | fyi | blocking_accept otherwise."
          }
        }
      },
      "deskTargetBody": {
        "type": "object",
        "properties": {
          "from_queue": {
            "type": "boolean",
            "description": "FromQueue is \"create the work, and let the queue say which board\" — the third answer this endpoint used to be unable to express, which is why the queue-to-board mapping could never decide anything (D32)."
          },
          "status_id": {
            "type": "string",
            "description": "StatusID is where the item is born. Optional: empty means the workflow's entry status. Naming one is what lets \"Complaint, escalate\" land in Escalated rather than in New, waiting for somebody to move it."
          },
          "workflow_id": {
            "type": "string"
          }
        }
      },
      "conferenceItem": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "directoryData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "GlobalE911": {
        "type": "object",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/DatabaseAddress"
          },
          "bulkvs": {
            "type": "integer"
          },
          "confirmed": {
            "$ref": "#/components/schemas/E911Confirmation"
          },
          "dids": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "warning": {
            "type": "boolean"
          }
        }
      },
      "Menu": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "MOH": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "media_source": {
            "type": "string"
          }
        }
      },
      "numberOwnerPathEl": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "numberSearchAPI": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "account_name": {
            "type": "string",
            "description": "Who owns the number, so Find can name an owner the Numbers list does not show (it lists only the working account and its immediate children). Set only when the owner is below the working account, or for super admins."
          },
          "account_path": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/numberOwnerPathEl"
            }
          },
          "can_switch": {
            "type": "boolean",
            "description": "The owner is in the user's own tree, so the portal can switch to it."
          },
          "details": {
            "type": "object",
            "description": "Super admins only: the number doc as Kazoo stores it, the record `sup stepswitch_maintenance lookup_number` reads.",
            "additionalProperties": {}
          },
          "number": {
            "type": "string"
          }
        }
      },
      "NumbersProviderConfiguration": {
        "type": "object",
        "properties": {
          "tiers": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "NumbersProviderAPIResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "configuration": {
            "$ref": "#/components/schemas/NumbersProviderConfiguration"
          },
          "group_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "space": {
            "type": "string",
            "description": "Space is the SignalWire space host (e.g. example.signalwire.com)."
          },
          "username": {
            "type": "string"
          }
        }
      },
      "NumbersProviderAPI": {
        "type": "object",
        "properties": {
          "type": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "configuration": {
            "$ref": "#/components/schemas/NumbersProviderConfiguration"
          },
          "group_id": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "space": {
            "type": "string",
            "description": "Space is the SignalWire space host (e.g. example.signalwire.com)."
          },
          "username": {
            "type": "string"
          }
        }
      },
      "BackfillResult": {
        "type": "object",
        "properties": {
          "needs_review": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stamped": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "NumberCNAMCarrier": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "checked_at": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "NumberCNAM": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "carrier": {
            "$ref": "#/components/schemas/NumberCNAMCarrier"
          },
          "enabled": {
            "type": "boolean"
          },
          "set_at": {
            "type": "integer"
          },
          "set_by": {
            "type": "string"
          }
        }
      },
      "NumberE911Address": {
        "type": "object",
        "properties": {
          "caller_name": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          }
        }
      },
      "NumberE911Carrier": {
        "type": "object",
        "properties": {
          "checked_at": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "record": {
            "$ref": "#/components/schemas/NumberE911Address"
          },
          "verified": {
            "description": "Verified is the address QVOICE Platform set, as the carrier's address check returned it, and VerifiedKey names that address: a different key means the address changed after the check.",
            "allOf": [
              {
                "$ref": "#/components/schemas/NumberE911Address"
              }
            ]
          },
          "verified_key": {
            "type": "string"
          },
          "verify_error": {
            "type": "string"
          }
        }
      },
      "E911Check": {
        "type": "object",
        "properties": {
          "account": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "carrier": {
            "$ref": "#/components/schemas/NumberE911Carrier"
          },
          "expected": {
            "$ref": "#/components/schemas/NumberE911Address"
          },
          "location": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          }
        }
      },
      "NumberEvent": {
        "type": "object",
        "properties": {
          "carrier": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "from_account": {
            "type": "string"
          },
          "from_name": {
            "type": "string",
            "description": "Names are kept with the event: the tenant may be deleted later."
          },
          "number": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer"
          },
          "to_account": {
            "type": "string"
          },
          "to_name": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "user_name": {
            "type": "string"
          }
        }
      },
      "InventoryReport": {
        "type": "object",
        "properties": {
          "carriers": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "chunks": {
            "type": "integer"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "failure": {
            "type": "string",
            "description": "Failure is not \"error\": the CouchDB client reads that key as a failed request."
          },
          "finished_at": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "started_at": {
            "type": "integer"
          },
          "started_by": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "InventoryApplied": {
        "type": "object",
        "properties": {
          "added": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "seen": {
            "type": "integer"
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stamped": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CorelocationsRow": {
        "type": "object",
        "properties": {
          "account": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "bulkvs": {
            "type": "integer",
            "description": "BulkVS is the DIDs on BulkVS: an account with any must have a Global E911."
          },
          "core_required": {
            "type": "string",
            "description": "CoreRequired names the account that puts this one on Core Locations only. A Pivot row with it set must be upgraded."
          },
          "dids": {
            "type": "integer"
          },
          "e911_error": {
            "type": "integer"
          },
          "e911_external": {
            "type": "integer"
          },
          "e911_ok": {
            "type": "integer"
          },
          "e911_status": {
            "type": "string",
            "description": "E911 is the Global E911 status, and Warning whether it needs action."
          },
          "locations": {
            "type": "integer"
          },
          "mode": {
            "type": "string"
          },
          "no_e911": {
            "type": "integer"
          },
          "warning": {
            "type": "boolean"
          }
        }
      },
      "E911Counts": {
        "type": "object",
        "properties": {
          "bulkvs": {
            "type": "integer",
            "description": "BulkVS is the DIDs on BulkVS: an account with any must have a Global E911."
          },
          "dids": {
            "type": "integer"
          },
          "e911_error": {
            "type": "integer"
          },
          "e911_external": {
            "type": "integer"
          },
          "e911_ok": {
            "type": "integer"
          },
          "no_e911": {
            "type": "integer"
          }
        }
      },
      "Summary": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "integer"
          },
          "core": {
            "type": "integer"
          },
          "e911_not_set_up": {
            "type": "integer"
          },
          "e911_set_up": {
            "type": "integer"
          },
          "e911_warnings": {
            "type": "integer"
          },
          "mixed": {
            "type": "integer"
          },
          "pivot": {
            "type": "integer"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorelocationsRow"
            }
          },
          "total": {
            "$ref": "#/components/schemas/E911Counts"
          }
        }
      },
      "Preflight": {
        "type": "object",
        "properties": {
          "account": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "locations": {
            "type": "integer"
          },
          "mode": {
            "type": "string"
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "trunks": {
            "type": "integer"
          }
        }
      },
      "NumberResult": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "DIDSummaryRow": {
        "type": "object",
        "properties": {
          "account": {
            "type": "string"
          },
          "account_id": {
            "type": "string"
          },
          "bulkvs": {
            "type": "integer"
          },
          "dids": {
            "type": "integer"
          },
          "didww": {
            "type": "integer"
          },
          "other": {
            "type": "integer"
          },
          "signalwire": {
            "type": "integer"
          },
          "twilio": {
            "type": "integer"
          }
        }
      },
      "DIDCounts": {
        "type": "object",
        "properties": {
          "bulkvs": {
            "type": "integer"
          },
          "dids": {
            "type": "integer"
          },
          "didww": {
            "type": "integer"
          },
          "other": {
            "type": "integer"
          },
          "signalwire": {
            "type": "integer"
          },
          "twilio": {
            "type": "integer"
          }
        }
      },
      "DIDSummary": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "integer"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DIDSummaryRow"
            }
          },
          "skipped": {
            "type": "array",
            "description": "Skipped names the numbers databases that could not be read, so the counts leave them out. Empty when the summary is complete.",
            "items": {
              "type": "string"
            }
          },
          "total": {
            "$ref": "#/components/schemas/DIDCounts"
          }
        }
      },
      "CallsPermissionsBody": {
        "type": "object",
        "properties": {
          "call_recording": {
            "type": "boolean"
          },
          "inbound_external": {
            "type": "boolean"
          },
          "outbound_external": {
            "type": "boolean"
          },
          "quality_analytics": {
            "type": "boolean"
          }
        }
      },
      "UserContactsPermissionsBody": {
        "type": "object",
        "properties": {
          "crm_contacts": {
            "type": "boolean"
          },
          "google_contacts": {
            "type": "boolean"
          }
        }
      },
      "UserActivityPermissionsBody": {
        "type": "object",
        "properties": {
          "calls": {
            "type": "boolean"
          },
          "faxes": {
            "type": "boolean"
          },
          "voicemails": {
            "type": "boolean"
          }
        }
      },
      "UserPrefPermissionsBody": {
        "type": "object",
        "properties": {
          "do_not_disturb": {
            "type": "boolean"
          },
          "find_me_follow_me": {
            "type": "boolean"
          },
          "voicemail_to_email": {
            "type": "boolean"
          }
        }
      },
      "UserPermissionsBody": {
        "type": "object",
        "properties": {
          "contacts": {
            "$ref": "#/components/schemas/UserContactsPermissionsBody"
          },
          "devices": {
            "type": "boolean"
          },
          "invitation": {
            "type": "object",
            "properties": {
              "max_count": {
                "type": "integer"
              }
            }
          },
          "last_activity": {
            "$ref": "#/components/schemas/UserActivityPermissionsBody"
          },
          "preferences": {
            "$ref": "#/components/schemas/UserPrefPermissionsBody"
          }
        }
      },
      "PermissionsBody": {
        "type": "object",
        "properties": {
          "callcenter": {
            "type": "boolean"
          },
          "calls": {
            "$ref": "#/components/schemas/CallsPermissionsBody"
          },
          "desktop": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "mobile": {
            "type": "boolean"
          },
          "phone_numbers": {
            "type": "boolean"
          },
          "portal": {
            "type": "boolean"
          },
          "reports": {
            "type": "boolean"
          },
          "smartpbx": {
            "type": "boolean"
          },
          "sms": {
            "type": "boolean"
          },
          "users": {
            "$ref": "#/components/schemas/UserPermissionsBody"
          }
        }
      },
      "ActionDefinition": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "group_label": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "SectionRestriction": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Description explains why this restriction exists"
          },
          "requires_global_admin": {
            "type": "boolean",
            "description": "RequiresGlobalAdmin means the section requires priv_level === \"admin\" && account_name === \"admin\""
          },
          "requires_reseller": {
            "type": "boolean",
            "description": "RequiresReseller means the section requires account.is_reseller === true"
          },
          "requires_super": {
            "type": "boolean",
            "description": "RequiresSuper means the section requires user.level === \"super\""
          }
        }
      },
      "SectionDefinition": {
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionDefinition"
            }
          },
          "group": {
            "type": "string",
            "description": "Group/category for organizing sections (e.g., \"account\", \"phone_system\")"
          },
          "group_label": {
            "type": "string",
            "description": "Human-readable group label"
          },
          "icon": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "restrictions": {
            "$ref": "#/components/schemas/SectionRestriction"
          },
          "route": {
            "type": "string"
          }
        }
      },
      "ModuleDefinition": {
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionDefinition"
            }
          },
          "icon": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "restrictions": {
            "$ref": "#/components/schemas/SectionRestriction"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SectionDefinition"
            }
          }
        }
      },
      "PermissionsRegistryData": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModuleDefinition"
            }
          },
          "version": {
            "type": "integer"
          }
        }
      },
      "BadRequestError": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      },
      "SectionPermission": {
        "type": "object",
        "properties": {
          "access": {
            "type": "string"
          },
          "actions": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "ModulePermission": {
        "type": "object",
        "properties": {
          "access": {
            "type": "string"
          },
          "actions": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "sections": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionPermission"
            }
          }
        }
      },
      "PermissionsV2": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModulePermission"
            }
          }
        }
      },
      "RoleScope": {
        "type": "object",
        "properties": {
          "requires_level": {
            "type": "string",
            "description": "RequiresLevel is the minimum user level required to have this role Possible values: \"\", \"admin\", \"super\""
          },
          "valid_for": {
            "type": "array",
            "description": "ValidFor defines which account types can use this role Possible values: \"global\", \"reseller\", \"account\"",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RoleUCPSettings": {
        "type": "object",
        "properties": {
          "dnd_visible": {
            "type": "boolean",
            "description": "DNDVisible controls whether the DND toggle appears in UCP Preferences. nil → true (visible, default for existing roles)."
          },
          "queue_login_logout_visible": {
            "type": "boolean",
            "description": "QueueLoginLogoutVisible controls whether the queue login/logout buttons appear in the agent panel (per-queue toggle and Login All / Logout All). nil → true (visible, default for existing roles)."
          }
        }
      },
      "AccessRoleV2PublicFields": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Audit fields (only for custom roles)"
          },
          "created_by": {
            "type": "string"
          },
          "permissions": {
            "$ref": "#/components/schemas/PermissionsV2"
          },
          "role_id": {
            "type": "string"
          },
          "schema_version": {
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/RoleScope"
          },
          "ucp_settings": {
            "$ref": "#/components/schemas/RoleUCPSettings"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_by": {
            "type": "string"
          }
        }
      },
      "RequestScope": {
        "type": "object",
        "properties": {
          "requires_level": {
            "type": "string"
          },
          "valid_for": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "permissions": {
            "$ref": "#/components/schemas/PermissionsV2"
          },
          "role_id": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/RequestScope"
          },
          "ucp_settings": {
            "$ref": "#/components/schemas/RoleUCPSettings"
          }
        }
      },
      "UpdateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "permissions": {
            "$ref": "#/components/schemas/PermissionsV2"
          },
          "scope": {
            "$ref": "#/components/schemas/RequestScope"
          },
          "ucp_settings": {
            "$ref": "#/components/schemas/RoleUCPSettings"
          }
        }
      },
      "DeleteRoleResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "warning": {
            "type": "string"
          }
        }
      },
      "CloneRoleRequest": {
        "type": "object",
        "properties": {
          "new_name": {
            "type": "string"
          },
          "new_role_id": {
            "type": "string"
          }
        }
      },
      "TemporalRule": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "RoleResponseUser": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "level": {
            "type": "string",
            "description": "Level is the user's `priv_level`: \"admin\" or \"user\". A LEVEL IS NOT A ROLE, and this endpoint now carries both because today they answer for different populations. A role is assigned to administrators; a regular user has none, and `role_id` falls back to `DefaultRole` — which is `admin` — so a consumer trying to tell the two apart from the role alone concludes that everybody is an administrator. The level is the field that actually separates them, and unlike the role it is MANDATORY: user validation refuses to create or edit a user without one, so it is always present and always one of the two values. Sent because Desk Center needs it and cannot get it anywhere else: it has no login of its own and no user endpoint to ask, which is the same reason `User` and `AccountName` were added here. Contact Center already gates Workforce Management on exactly this comparison (`contactcentermodules/handler.go`), so the distinction is one the suite already makes — it just made it without ever telling the caller. NOT the global-admin test, which is `priv_level == \"admin\"` AND `account_name == \"admin\"` (see isGlobalAdmin in this package). That one is about the root account, not about what a tenant's own user may do, and conflating them would hand every tenant admin the platform. AND IT IS A STEP TOWARDS ROLES FOR REGULAR USERS. When a role can be assigned to a user and not only to an administrator, this field is what the permission set is resolved AGAINST rather than a replacement for it: the level says which population somebody is in, the role says what they may do inside it. Shipping it now means consumers are already reading the right field when that lands. Additive and omitempty, so every existing caller is unaffected — and a consumer that deploys ahead of this one reads an empty string, which it must treat as \"not told\" rather than as \"not an administrator\"."
          }
        }
      },
      "RoleResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "account_name": {
            "type": "string",
            "description": "AccountName is the name of the account this request is scoped to, as opposed to its id. Added for the same reason as User: the value is already in context here and every caller that wanted to SHOW which account somebody is working in had to go and ask for it separately — or, as Desk Center did, render a 32-character hex id at a person."
          },
          "fallback_message": {
            "type": "string"
          },
          "is_fallback": {
            "type": "boolean"
          },
          "permissions": {
            "$ref": "#/components/schemas/PermissionsV2"
          },
          "role_id": {
            "type": "string"
          },
          "schema_version": {
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/RoleScope"
          },
          "ucp_settings": {
            "$ref": "#/components/schemas/RoleUCPSettings"
          },
          "user": {
            "description": "User is who is asking, not what they may do. This endpoint already had the user in context and answered only about the role, so every caller that wanted to show \"signed in as…\" had to find it somewhere else. Desk Center is the first that cannot: it has no login of its own and no user endpoint to call. Additive and omitempty, so every existing caller is unaffected.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RoleResponseUser"
              }
            ]
          }
        }
      },
      "BulkUsersSetEnabledBody": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "required; pointer to detect absence"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UsersDesktopVersionInfoPublicFields": {
        "type": "object",
        "properties": {
          "browser": {
            "type": "string"
          },
          "browser_version": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "not to be saved; just for return purposes"
          },
          "extension": {
            "type": "string"
          },
          "full_name": {
            "type": "string",
            "description": "not to be saved; just for return purposes"
          },
          "os": {
            "type": "string"
          },
          "ucp_version": {
            "type": "string"
          },
          "unix_timestamp": {
            "type": "integer"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "UCPSessionEventPublicFields": {
        "type": "object",
        "properties": {
          "browser": {
            "type": "string"
          },
          "browser_version": {
            "type": "string"
          },
          "client": {
            "type": "string"
          },
          "client_version": {
            "type": "string"
          },
          "embedded": {
            "type": "boolean"
          },
          "event": {
            "type": "string"
          },
          "host_origin": {
            "type": "string"
          },
          "os": {
            "type": "string"
          },
          "replaced_by_session_id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          }
        }
      },
      "ErrorsError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorsErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorsError"
          }
        }
      },
      "CallForward": {
        "type": "object",
        "properties": {
          "direct_calls_only": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "failover": {
            "type": "boolean"
          },
          "ignore_early_media": {
            "type": "boolean"
          },
          "keep_caller_id": {
            "type": "boolean"
          },
          "number": {
            "type": "string"
          },
          "require_keypress": {
            "type": "boolean"
          },
          "substitute": {
            "type": "boolean"
          }
        }
      },
      "DeviceCodecs": {
        "type": "object",
        "properties": {
          "codecs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Encryption": {
        "type": "object",
        "properties": {
          "enforce_security": {
            "type": "boolean"
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Media": {
        "type": "object",
        "properties": {
          "audio": {
            "$ref": "#/components/schemas/DeviceCodecs"
          },
          "encryption": {
            "$ref": "#/components/schemas/Encryption"
          },
          "video": {
            "$ref": "#/components/schemas/DeviceCodecs"
          },
          "webrtc": {
            "type": "boolean"
          }
        }
      },
      "SIP": {
        "type": "object",
        "properties": {
          "expire_seconds": {
            "type": "integer"
          },
          "invite_format": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "realm": {
            "type": "string"
          },
          "route": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        }
      },
      "Creation": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "_id": {
            "type": "string"
          },
          "_rev": {
            "type": "string"
          },
          "call_forward": {
            "$ref": "#/components/schemas/CallForward"
          },
          "call_restriction": {
            "$ref": "#/components/schemas/CallRestriction"
          },
          "contact_list": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "device_type": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "exclude_from_queues": {
            "type": "boolean"
          },
          "ignore_completed_elsewhere": {
            "type": "boolean"
          },
          "media": {
            "$ref": "#/components/schemas/Media"
          },
          "mwi_unsolicitated_updates": {
            "type": "boolean"
          },
          "owner_id": {
            "type": "string"
          },
          "register_overwrite_notify": {
            "type": "boolean"
          },
          "sip": {
            "$ref": "#/components/schemas/SIP"
          },
          "suppress_unregister_notifications": {
            "type": "boolean"
          }
        }
      },
      "updateSkillsRequest": {
        "type": "object",
        "properties": {
          "skills": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AccountSummaryConcurrency": {
        "type": "object",
        "properties": {
          "inbound_peak": {
            "type": "integer"
          },
          "inbound_peak_at": {
            "type": "integer"
          },
          "outbound_peak": {
            "type": "integer"
          },
          "outbound_peak_at": {
            "type": "integer"
          },
          "peak": {
            "type": "integer"
          },
          "peak_at": {
            "type": "integer"
          }
        }
      },
      "AccountSummaryFollowUp": {
        "type": "object",
        "properties": {
          "follow_in": {
            "type": "integer"
          },
          "follow_out": {
            "type": "integer"
          },
          "followed_up": {
            "type": "integer"
          },
          "not_followed_up": {
            "type": "integer"
          }
        }
      },
      "AccountSummaryClass": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "answered_seconds": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "AccountSummaryInbound": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "direct": {
            "$ref": "#/components/schemas/AccountSummaryClass"
          },
          "missed": {
            "type": "integer"
          },
          "missed_unique_numbers": {
            "type": "integer"
          },
          "queue": {
            "$ref": "#/components/schemas/AccountSummaryClass"
          },
          "total": {
            "type": "integer"
          },
          "unique_numbers": {
            "type": "integer"
          }
        }
      },
      "AccountSummaryOutbound": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "direct": {
            "$ref": "#/components/schemas/AccountSummaryClass"
          },
          "queue": {
            "$ref": "#/components/schemas/AccountSummaryClass"
          },
          "total": {
            "type": "integer"
          },
          "unanswered": {
            "type": "integer"
          },
          "unique_numbers": {
            "type": "integer"
          }
        }
      },
      "AccountSummaryRecordings": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "estimated_bytes": {
            "type": "integer"
          },
          "external_bytes": {
            "type": "integer"
          },
          "external_count": {
            "type": "integer"
          },
          "stored_bytes": {
            "type": "integer"
          },
          "total_bytes": {
            "type": "integer"
          }
        }
      },
      "AccountSummaryPoint": {
        "type": "object",
        "properties": {
          "concurrent_inbound_peak": {
            "type": "integer"
          },
          "concurrent_outbound_peak": {
            "type": "integer"
          },
          "concurrent_peak": {
            "type": "integer",
            "description": "The most carrier legs up at once inside the bucket (account_summary_concurrency.go)."
          },
          "inbound": {
            "type": "integer"
          },
          "inbound_answered": {
            "type": "integer"
          },
          "inbound_missed": {
            "type": "integer"
          },
          "outbound": {
            "type": "integer"
          },
          "outbound_answered": {
            "type": "integer"
          },
          "start": {
            "type": "integer"
          }
        }
      },
      "AccountSummarySeries": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSummaryPoint"
            }
          }
        }
      },
      "AccountSummaryTalkTime": {
        "type": "object",
        "properties": {
          "inbound_seconds": {
            "type": "integer"
          },
          "internal_calls": {
            "type": "integer",
            "description": "InternalCalls counts the connected extension-to-extension calls behind InternalSeconds."
          },
          "internal_seconds": {
            "type": "integer"
          },
          "outbound_seconds": {
            "type": "integer"
          }
        }
      },
      "ReportsAccountSummary": {
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean",
            "description": "Complete is false when a shard could not be read or the request ran out of time, so the client can say the numbers are partial instead of passing them off as final."
          },
          "concurrency": {
            "description": "Concurrency is the period's peak of simultaneous carrier calls.",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountSummaryConcurrency"
              }
            ]
          },
          "default_bucket": {
            "type": "string"
          },
          "follow_up": {
            "$ref": "#/components/schemas/AccountSummaryFollowUp"
          },
          "inbound": {
            "$ref": "#/components/schemas/AccountSummaryInbound"
          },
          "outbound": {
            "$ref": "#/components/schemas/AccountSummaryOutbound"
          },
          "recordings": {
            "description": "Recordings is the size of the period's call recordings; absent until the account's databases have the fonouc_recording_sizes view (account_summary_recordings.go).",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountSummaryRecordings"
              }
            ]
          },
          "series": {
            "type": "array",
            "description": "Series holds every grouping the range allows, finest first: 5-minute blocks up to 7 days, 15-minute blocks and hours up to 31 days, days always. DefaultBucket is the one to open with.",
            "items": {
              "$ref": "#/components/schemas/AccountSummarySeries"
            }
          },
          "talk_time": {
            "description": "TalkTime is the period's connected seconds, external by direction and internal.",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountSummaryTalkTime"
              }
            ]
          },
          "total_calls": {
            "type": "integer"
          }
        }
      },
      "PlanConcession": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "AgentID is empty for a concession that belongs to the whole plan, such as a coverage gap."
          },
          "detail": {
            "type": "string",
            "description": "Detail is a sentence a human reads."
          },
          "kind": {
            "type": "string"
          },
          "magnitude": {
            "type": "number",
            "description": "Magnitude makes two concessions of the same kind comparable: hours short, agents missing, minutes of a preference broken."
          }
        }
      },
      "PlanEntry": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "dates": {
            "type": "array",
            "description": "Dates are YYYY-MM-DD, so an entry can cover part of the range — a week where somebody works Monday to Wednesday on Early and Thursday on Late is ordinary, not an exception.",
            "items": {
              "type": "string"
            }
          },
          "pattern_id": {
            "type": "string"
          }
        }
      },
      "PlanSource": {
        "type": "object",
        "properties": {
          "forecast_range_end": {
            "type": "integer"
          },
          "forecast_range_start": {
            "type": "integer"
          },
          "hand_edited": {
            "type": "boolean",
            "description": "HandEdited records that a person changed the roster after the planner produced it. Provenance, like everything else here. \"Why does this say six agents at 09:00\" has a different answer for a plan the solver produced and one somebody rearranged, and a reviewer next quarter cannot tell them apart from the entries alone."
          },
          "history_weeks": {
            "type": "integer"
          },
          "pattern_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "queue": {
            "type": "string",
            "description": "Queue is the queue this plan staffs, empty for a plan built across the whole account. Recorded because two plans for the same week are otherwise indistinguishable, and because it is the difference between a figure that can be defended and one that cannot: a plan built pooled over queues that do not share agents is understaffed, and nothing else in the document would say so."
          },
          "service_level_target_percent": {
            "type": "number"
          },
          "shrinkage_measured": {
            "type": "boolean",
            "description": "ShrinkageMeasured is true when the percentage came from measurement rather than from somebody's choice."
          },
          "shrinkage_percent": {
            "type": "number"
          }
        }
      },
      "StaffingPlanPublicFields": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "accepted_at": {
            "type": "integer"
          },
          "accepted_by": {
            "type": "string"
          },
          "concessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanConcession"
            }
          },
          "created_assignment_ids": {
            "type": "array",
            "description": "CreatedAssignmentIDs are the assignments publishing produced, so a plan can be traced to the rota it became.",
            "items": {
              "type": "string"
            }
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanEntry"
            }
          },
          "mix": {
            "type": "object",
            "description": "Mix is how many agents the solver put on each pattern.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "proposed_at": {
            "type": "integer"
          },
          "published_at": {
            "type": "integer"
          },
          "published_by": {
            "type": "string"
          },
          "range_end": {
            "type": "string"
          },
          "range_start": {
            "type": "string",
            "description": "RangeStart and RangeEnd are the days the plan covers, YYYY-MM-DD."
          },
          "source": {
            "$ref": "#/components/schemas/PlanSource"
          },
          "status": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          }
        }
      },
      "ChannelRow": {
        "type": "object",
        "properties": {
          "avg_first_response_seconds": {
            "type": "number",
            "description": "Averages over the period, in seconds. Null when the period holds nothing to average, which is not the same as zero."
          },
          "avg_resolution_seconds": {
            "type": "number"
          },
          "channel": {
            "type": "string"
          },
          "conversations": {
            "type": "integer"
          },
          "inbox": {
            "type": "string"
          },
          "incoming_messages": {
            "type": "integer"
          },
          "outgoing_messages": {
            "type": "integer"
          },
          "resolved": {
            "type": "integer"
          }
        }
      },
      "channelsReportResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelRow"
            }
          }
        }
      },
      "leadStatusResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "cool_off": {
            "type": "integer"
          },
          "leads_by_status": {},
          "queue_name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total_leads": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownAgent": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "answered": {
            "type": "integer"
          },
          "ext": {
            "type": "string"
          },
          "talk_seconds": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownAgents": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "by_agent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownAgent"
            }
          },
          "talk_seconds": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownAI": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "calls_with_extra_sessions": {
            "type": "integer"
          },
          "handed_off_to_agent": {
            "type": "integer"
          },
          "sent_reason": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "sessions": {
            "type": "integer"
          },
          "short_sessions": {
            "type": "integer"
          },
          "talk_seconds": {
            "type": "integer"
          },
          "transferred_from_agent": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownHour": {
        "type": "object",
        "properties": {
          "agents_busy": {
            "type": "integer"
          },
          "agents_offline": {
            "type": "integer"
          },
          "ai_failed": {
            "type": "integer"
          },
          "hour": {
            "type": "integer"
          },
          "no_answer": {
            "type": "integer"
          },
          "other": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownAISession": {
        "type": "object",
        "properties": {
          "billing_seconds": {
            "type": "integer"
          },
          "call_id": {
            "type": "string"
          },
          "device_id": {
            "type": "string"
          },
          "hangup_cause": {
            "type": "string"
          },
          "start_time": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownAICall": {
        "type": "object",
        "properties": {
          "ai_seconds": {
            "type": "integer"
          },
          "ai_sessions": {
            "type": "array",
            "description": "AISessions are the answered AI legs of the call, oldest first: what the AI provider bills, one by one. Their billing adds up to AISeconds.",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownAISession"
            }
          },
          "call_id": {
            "type": "string"
          },
          "caller_id_name": {
            "type": "string"
          },
          "caller_id_number": {
            "type": "string"
          },
          "handoff_agent": {
            "type": "string"
          },
          "queue_name": {
            "type": "string",
            "description": "QueueName is the queue the call went through, empty for a call that reached the AI without one."
          },
          "sent_reason": {
            "type": "string"
          },
          "sessions": {
            "type": "integer"
          },
          "short_sessions": {
            "type": "integer"
          },
          "start_time": {
            "type": "integer"
          },
          "transferred_from_agent": {
            "type": "string",
            "description": "TransferredFromAgent is the agent who took the call first and sent it to the AI."
          }
        }
      },
      "InboundBreakdownDevice": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "ai_default": {
            "type": "boolean"
          },
          "ai_match": {
            "type": "string",
            "description": "AIMatch says why AIDefault is set: livekit_route or name."
          },
          "device_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "InboundBreakdownFailure": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownAIMissedCall": {
        "type": "object",
        "properties": {
          "attempts": {
            "type": "integer",
            "description": "Attempts is how many times an AI device was dialed for the call."
          },
          "call_id": {
            "type": "string"
          },
          "call_seconds": {
            "type": "integer",
            "description": "CallSeconds is how long the caller stayed on the call in total."
          },
          "caller_id_name": {
            "type": "string"
          },
          "caller_id_number": {
            "type": "string"
          },
          "hangup_causes": {
            "type": "array",
            "description": "HangupCauses are the AI legs' causes, in the order they were dialed, without repeats.",
            "items": {
              "type": "string"
            }
          },
          "queue_name": {
            "type": "string"
          },
          "sent_reason": {
            "type": "string"
          },
          "start_time": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownDurationBucket": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string"
          },
          "sessions": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownDay": {
        "type": "object",
        "properties": {
          "agents": {
            "type": "integer"
          },
          "ai": {
            "type": "integer"
          },
          "ai_failed": {
            "type": "integer"
          },
          "date": {
            "type": "string"
          },
          "missed": {
            "type": "integer"
          },
          "outside": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdownMissed": {
        "type": "object",
        "properties": {
          "abandoned_after_agent": {
            "type": "integer"
          },
          "abandoned_before_agent": {
            "type": "integer",
            "description": "AbandonedInQueue split by whether the queue rang an agent before the caller hung up. Only the calls that rang one reach the All Calls report."
          },
          "abandoned_in_queue": {
            "type": "integer"
          },
          "ai_not_answered": {
            "type": "integer"
          },
          "not_answered": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "InboundBreakdown": {
        "type": "object",
        "properties": {
          "agents": {
            "$ref": "#/components/schemas/InboundBreakdownAgents"
          },
          "ai": {
            "$ref": "#/components/schemas/InboundBreakdownAI"
          },
          "ai_by_hour": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownHour"
            }
          },
          "ai_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownAICall"
            }
          },
          "ai_devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownDevice"
            }
          },
          "ai_failures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownFailure"
            }
          },
          "ai_missed_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownAIMissedCall"
            }
          },
          "ai_session_durations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownDurationBucket"
            }
          },
          "answered_outside_queue": {
            "type": "integer"
          },
          "daily": {
            "type": "array",
            "description": "Daily, AIByHour and AISessionDurations feed the report's charts; they are filled only when the report is built for a timezone.",
            "items": {
              "$ref": "#/components/schemas/InboundBreakdownDay"
            }
          },
          "missed": {
            "$ref": "#/components/schemas/InboundBreakdownMissed"
          },
          "queue_calls_rang_agent": {
            "type": "integer",
            "description": "QueueCallsRangAgent counts the calls whose queue rang at least one agent, whatever bucket they landed in. It is the queue call count of the All Calls report counted by call, which only sees calls from the agents' side."
          },
          "total_inbound": {
            "type": "integer"
          }
        }
      },
      "voicemailPlaybackResponse": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "vmbox_id": {
            "type": "string"
          }
        }
      },
      "OutboundBreakdownBuckets": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "answered_short": {
            "type": "integer"
          },
          "barred": {
            "type": "integer"
          },
          "busy": {
            "type": "integer"
          },
          "cancelled": {
            "type": "integer"
          },
          "early_media": {
            "type": "integer"
          },
          "no_answer": {
            "type": "integer"
          },
          "not_answered": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "talk_seconds": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "OutboundBreakdownAgent": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "answered": {
            "type": "integer"
          },
          "answered_short": {
            "type": "integer"
          },
          "barred": {
            "type": "integer"
          },
          "busy": {
            "type": "integer"
          },
          "cancelled": {
            "type": "integer"
          },
          "early_media": {
            "type": "integer"
          },
          "ext": {
            "type": "string"
          },
          "no_answer": {
            "type": "integer"
          },
          "not_answered": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "talk_seconds": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "OutboundBreakdownDay": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "answered_short": {
            "type": "integer"
          },
          "barred": {
            "type": "integer"
          },
          "busy": {
            "type": "integer"
          },
          "cancelled": {
            "type": "integer"
          },
          "date": {
            "type": "string"
          },
          "early_media": {
            "type": "integer"
          },
          "no_answer": {
            "type": "integer"
          },
          "not_answered": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "talk_seconds": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "OutboundBreakdownCause": {
        "type": "object",
        "properties": {
          "calls": {
            "type": "integer"
          },
          "cause": {
            "type": "string"
          }
        }
      },
      "OutboundBreakdownNumber": {
        "type": "object",
        "properties": {
          "answered": {
            "type": "integer"
          },
          "last_attempt": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "unanswered": {
            "type": "integer"
          }
        }
      },
      "OutboundBreakdown": {
        "type": "object",
        "properties": {
          "agents": {
            "$ref": "#/components/schemas/OutboundBreakdownBuckets"
          },
          "by_agent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundBreakdownAgent"
            }
          },
          "campaigns": {
            "$ref": "#/components/schemas/OutboundBreakdownBuckets"
          },
          "carrier_attempts": {
            "type": "integer",
            "description": "CarrierAttempts counts the carrier legs before mergeCarrierAttempts: more than the off-net calls when the carrier was retried."
          },
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundBreakdownDay"
            }
          },
          "network": {
            "type": "string"
          },
          "onnet_calls": {
            "type": "integer"
          },
          "rejection_causes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundBreakdownCause"
            }
          },
          "top_unanswered": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundBreakdownNumber"
            }
          },
          "total": {
            "$ref": "#/components/schemas/OutboundBreakdownBuckets"
          },
          "transferred": {
            "description": "Transferred are the calls agents sent on to an outside number: the carrier leg of the transfer, which All Calls does not count as an outbound call.",
            "allOf": [
              {
                "$ref": "#/components/schemas/OutboundBreakdownBuckets"
              }
            ]
          }
        }
      },
      "userData": {
        "type": "object",
        "properties": {
          "extension": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        }
      },
      "TranscriptCall": {
        "type": "object",
        "properties": {
          "call_type": {
            "type": "string"
          },
          "callee_id_name": {
            "type": "string"
          },
          "callee_id_number": {
            "type": "string"
          },
          "caller_id_name": {
            "type": "string"
          },
          "caller_id_number": {
            "type": "string"
          },
          "duration": {
            "type": "integer"
          },
          "report_direction": {
            "type": "string"
          },
          "start": {
            "type": "integer"
          },
          "user": {
            "$ref": "#/components/schemas/userData"
          }
        }
      },
      "TranscriptLine": {
        "type": "object",
        "properties": {
          "speaker": {
            "type": "integer"
          },
          "start": {
            "type": "number"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "TranscriptTranslationSettings": {
        "type": "object",
        "properties": {
          "default_language": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "TranscriptResponse": {
        "type": "object",
        "properties": {
          "call": {
            "description": "Call is who was on the call, as the recordings report shows it, so a player opened from any report can name the speakers. Absent when it could not be worked out.",
            "allOf": [
              {
                "$ref": "#/components/schemas/TranscriptCall"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranscriptLine"
            }
          },
          "provider": {
            "type": "string"
          },
          "recording_id": {
            "type": "string"
          },
          "translation": {
            "description": "Translation says whether the player may offer to translate the transcript.",
            "allOf": [
              {
                "$ref": "#/components/schemas/TranscriptTranslationSettings"
              }
            ]
          }
        }
      },
      "TranslateTranscriptReqBody": {
        "type": "object",
        "properties": {
          "target": {
            "type": "string"
          }
        }
      },
      "TranscriptTranslation": {
        "type": "object",
        "properties": {
          "cached": {
            "type": "boolean",
            "description": "Cached is true when the translation was already saved on the recording."
          },
          "provider": {
            "type": "string"
          },
          "source_language": {
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        }
      },
      "TranslatedTranscriptResponse": {
        "type": "object",
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranscriptLine"
            }
          },
          "provider": {
            "type": "string"
          },
          "recording_id": {
            "type": "string"
          },
          "translation": {
            "$ref": "#/components/schemas/TranscriptTranslation"
          }
        }
      },
      "ForbiddenError": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized - invalid or missing authentication"
      },
      "InternalServerError": {
        "description": "Internal server error"
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UnauthorizedError": {
        "type": "object",
        "description": "Authorization token is missing or invalid",
        "properties": {
          "message": {
            "type": "string",
            "example": "Authorization token is missing or invalid"
          }
        }
      }
    },
    "headers": {
      "RecordingsResponse": {
        "type": "object",
        "properties": {
          "next_start_key": {
            "type": "string"
          },
          "recordings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recording"
            }
          }
        }
      },
      "CDROutbound": {
        "type": "object",
        "description": "CDR information for outbound reports",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of CDR in database"
          },
          "start_time": {
            "type": "integer",
            "description": "Initial call time in Unix timestamp"
          },
          "caller_id_name": {
            "type": "string",
            "description": "Caller ID Name"
          },
          "caller_id_number": {
            "type": "string",
            "description": "Caller ID Number"
          },
          "dialed_number": {
            "type": "string",
            "description": "Number dialed by user"
          },
          "outbound_dialed_number": {
            "type": "string",
            "description": "Number as dialed to PSTN"
          },
          "duration_seconds": {
            "type": "string",
            "description": "Call duration in seconds"
          },
          "billing_seconds": {
            "type": "string",
            "description": "Billable seconds of call"
          },
          "hangup_cause": {
            "type": "string",
            "description": "Text indicating hangup cause"
          }
        }
      },
      "FonoUCCallsRateSummaryForAllChildren": {
        "type": "array",
        "description": "Call and billing information about calls for all children",
        "items": {
          "type": "object",
          "properties": {
            "account_id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "total_amount": {
              "type": "number",
              "description": "Total charge amount"
            },
            "total_minutes": {
              "type": "number",
              "description": "Total minutes"
            },
            "total_calls": {
              "type": "number",
              "description": "Total calls"
            }
          }
        }
      },
      "CDRInbound": {
        "type": "object",
        "description": "CDR information for inbound reports",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of CDR in database"
          },
          "start_time": {
            "type": "integer",
            "description": "Initial call time in Unix timestamp"
          },
          "caller_id_name": {
            "type": "string",
            "description": "Caller ID Name"
          },
          "caller_id_number": {
            "type": "string",
            "description": "Caller ID Number"
          },
          "destination": {
            "type": "string",
            "description": "DID number"
          },
          "callee_id_name": {
            "type": "string",
            "description": "Callee ID Name"
          },
          "callee_id_number": {
            "type": "string",
            "description": "Callee ID Number"
          },
          "duration_seconds": {
            "type": "string",
            "description": "Call duration in seconds"
          },
          "billing_seconds": {
            "type": "string",
            "description": "Billable seconds of call"
          },
          "hangup_cause": {
            "type": "string",
            "description": "Text indicating hangup cause"
          }
        }
      }
    }
  }
}