{
  "openapi": "3.0.0",
  "info": {
    "title": "DialNexa API",
    "description": "Public REST API for the DialNexa voice AI platform. Versioned endpoints are under /v1; unversioned endpoints are legacy and deprecated.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.dialnexa.com",
      "description": "DialNexa production API"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "API Keys"
    },
    {
      "name": "Agent Functions"
    },
    {
      "name": "Agents V1"
    },
    {
      "name": "Agents2"
    },
    {
      "name": "Batch Calls"
    },
    {
      "name": "Batch Calls V1"
    },
    {
      "name": "Call Logs"
    },
    {
      "name": "Calls"
    },
    {
      "name": "Calls V1"
    },
    {
      "name": "Campaign Leads"
    },
    {
      "name": "Campaigns"
    },
    {
      "name": "External Webhooks"
    },
    {
      "name": "Knowledge Base"
    },
    {
      "name": "Knowledge Base V1"
    },
    {
      "name": "LLMs"
    },
    {
      "name": "LLMs V1"
    },
    {
      "name": "Languages"
    },
    {
      "name": "Languages V1"
    },
    {
      "name": "Organization Phone Numbers"
    },
    {
      "name": "Organization Phone Numbers V1"
    },
    {
      "name": "Phone Number Pricing"
    },
    {
      "name": "Phone Number Pricing V1"
    },
    {
      "name": "Transcribers"
    },
    {
      "name": "Transcribers V1"
    },
    {
      "name": "User Webhooks"
    },
    {
      "name": "User Webhooks V1"
    },
    {
      "name": "V1"
    },
    {
      "name": "Voices"
    },
    {
      "name": "Voices V1"
    },
    {
      "name": "Webcall"
    },
    {
      "name": "Workflow Leads"
    },
    {
      "name": "Workflow Leads V1"
    },
    {
      "name": "Workflows"
    },
    {
      "name": "Workflows V1"
    }
  ],
  "paths": {
    "/agent-functions/{agentId}/{versionNumber}": {
      "get": {
        "operationId": "AgentFunctionsController_findAll",
        "parameters": [
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "ID of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "versionNumber",
            "required": true,
            "in": "path",
            "description": "Version number of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent functions returned successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "403": {
            "description": "Agent does not belong to your organization."
          }
        },
        "summary": "Get an agent function by agent ID and version number",
        "tags": [
          "Agent Functions"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "AgentFunctionsController_create",
        "parameters": [
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "ID of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "versionNumber",
            "required": true,
            "in": "path",
            "description": "Version number of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentFunctionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The agent function has been successfully created."
          },
          "400": {
            "description": "Bad request."
          },
          "401": {
            "description": "Unauthorized."
          },
          "403": {
            "description": "Agent does not belong to your organization."
          }
        },
        "summary": "Create a new agent function",
        "tags": [
          "Agent Functions"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/agent-functions/{agentId}/{versionNumber}/merged-description": {
      "get": {
        "operationId": "AgentFunctionsController_getMergedDescriptionOfAgentFunctions",
        "parameters": [
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "ID of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "versionNumber",
            "required": true,
            "in": "path",
            "description": "Version number of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Merged description returned successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "403": {
            "description": "Agent does not belong to your organization."
          }
        },
        "summary": "Get the merged description of all agent functions",
        "tags": [
          "Agent Functions"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/agent-functions/{function_id}": {
      "patch": {
        "operationId": "AgentFunctionsController_update",
        "parameters": [
          {
            "name": "function_id",
            "required": true,
            "in": "path",
            "description": "Primary ID of the agent function",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentFunctionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The agent function has been successfully updated."
          },
          "401": {
            "description": "Unauthorized."
          },
          "403": {
            "description": "Agent does not belong to your organization."
          },
          "404": {
            "description": "Agent function not found."
          }
        },
        "summary": "Update an agent function",
        "tags": [
          "Agent Functions"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "get": {
        "operationId": "AgentFunctionsController_findOne",
        "parameters": [
          {
            "name": "function_id",
            "required": true,
            "in": "path",
            "description": "Primary ID of the agent function",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent function returned successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Agent function not found."
          }
        },
        "summary": "Get an agent function by its primary ID",
        "tags": [
          "Agent Functions"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "AgentFunctionsController_remove",
        "parameters": [
          {
            "name": "function_id",
            "required": true,
            "in": "path",
            "description": "Primary ID of the agent function",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The agent function has been successfully deleted."
          },
          "401": {
            "description": "Unauthorized."
          },
          "403": {
            "description": "Agent does not belong to your organization."
          },
          "404": {
            "description": "Agent function not found."
          }
        },
        "summary": "Delete an agent function",
        "tags": [
          "Agent Functions"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/agents2": {
      "get": {
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nDeprecated - use /v1/agents instead. This parallel resource will be removed in a future version.",
        "operationId": "Agents2Controller_findAllByOrganizationId",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Agents2VersionResponseDto"
                  }
                }
              }
            }
          }
        },
        "summary": "Get all agents by organization ID (structured)",
        "tags": [
          "Agents2"
        ]
      },
      "post": {
        "operationId": "Agents2Controller_create",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Grouped request body. Fallback LLM: set llm.fallback.fallback_llm_enabled and llm.fallback.llm_fallback_model (or fall_back_llm_id). PCA: set analysis.postcall_analysis with field_name, field_type, field_description, and optional additional_fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgents2BodyDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent created; current_version includes llm.fallback and flat fallback fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents2VersionResponseDto"
                }
              }
            }
          }
        },
        "summary": "Create a new agent (structured response)",
        "tags": [
          "Agents2"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/agents2/{id}": {
      "patch": {
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nDeprecated - use /v1/agents/:id instead. This parallel resource will be removed in a future version.",
        "operationId": "Agents2Controller_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Grouped request body. Provide version_number or current_version.number. Fallback LLM: llm.fallback.fallback_llm_enabled + llm.fallback.llm_fallback_model. PCA: analysis.postcall_analysis.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgents2BodyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent updated; current_version includes llm.fallback and flat fallback fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents2VersionResponseDto"
                }
              }
            }
          }
        },
        "summary": "Update an agent (structured response)",
        "tags": [
          "Agents2"
        ]
      },
      "get": {
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nDeprecated - use /v1/agents/:id instead. This parallel resource will be removed in a future version.",
        "operationId": "Agents2Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents2VersionResponseDto"
                }
              }
            }
          }
        },
        "summary": "Get a specific agent by ID (structured)",
        "tags": [
          "Agents2"
        ]
      }
    },
    "/api-keys": {
      "get": {
        "operationId": "ApiKeyController_listApiKeys",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of API keys",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "statusCode": 200,
                    "message": "API keys fetched successfully",
                    "data": [
                      {
                        "id": 1,
                        "organization_id": 123,
                        "key": "e3b0c44298fc1c149afbf4c8996fb924",
                        "name": "Docs Key",
                        "last_used_at": "2024-06-10T12:00:00.000Z",
                        "created_at": "2024-06-10T11:00:00.000Z",
                        "updated_at": "2024-06-10T11:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List all API keys for an organization",
        "tags": [
          "API Keys"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "ApiKeyController_createApiKey",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "statusCode": 201,
                    "message": "API key created successfully",
                    "data": {
                      "rawKey": "b7f9e3b0c44298fc1c149afbf4c8996f",
                      "apiKey": {
                        "id": 1,
                        "organization_id": 123,
                        "key": "e3b0c44298fc1c149afbf4c8996fb924",
                        "name": "Docs Key",
                        "last_used_at": "2024-06-10T12:00:00.000Z",
                        "created_at": "2024-06-10T11:00:00.000Z",
                        "updated_at": "2024-06-10T11:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new API key for an organization",
        "tags": [
          "API Keys"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/api-keys/{id}": {
      "patch": {
        "operationId": "ApiKeyController_updateApiKeyName",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApiKeyNameDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key name updated",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "statusCode": 200,
                    "message": "API key name updated successfully",
                    "data": {
                      "success": true
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update the name of an API key",
        "tags": [
          "API Keys"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "ApiKeyController_deleteApiKey",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key deleted",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "statusCode": 200,
                    "message": "API key deleted successfully",
                    "data": {
                      "success": true
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an API key",
        "tags": [
          "API Keys"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/batch-calls": {
      "get": {
        "operationId": "BatchCallsController_list",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch calls fetched successfully"
          }
        },
        "summary": "List batch calls for the organization",
        "tags": [
          "Batch Calls"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "BatchCallsController_create",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV or Excel leads file"
                  },
                  "title": {
                    "type": "string",
                    "example": "Enter campaign title here"
                  },
                  "agent_id": {
                    "type": "string",
                    "example": "agent_123"
                  },
                  "agent_version_number": {
                    "type": "number",
                    "example": 1
                  },
                  "starts_at": {
                    "type": "string",
                    "example": ""
                  },
                  "ends_at": {
                    "type": "string",
                    "example": ""
                  },
                  "calling_hours_start": {
                    "type": "string",
                    "example": ""
                  },
                  "calling_hours_end": {
                    "type": "string",
                    "example": ""
                  }
                },
                "required": [
                  "file",
                  "title",
                  "agent_id",
                  "agent_version_number"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Batch call created and queued"
          }
        },
        "summary": "Create campaign, upload leads file, and enqueue calls",
        "tags": [
          "Batch Calls"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/batch-calls/{id}": {
      "get": {
        "operationId": "BatchCallsController_listCallsInBatch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "call_id",
            "required": false,
            "in": "query",
            "description": "Filter by call ID - can be a single ID or comma-separated list (e.g., call_abc,call_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch_call_id",
            "required": false,
            "in": "query",
            "description": "Filter by batch call ID - can be a single ID or comma-separated list (e.g., batch_abc,batch_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Filter by sender phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Filter by recipient phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by call type(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "web"
              ]
            }
          },
          {
            "name": "call_direction",
            "required": false,
            "in": "query",
            "description": "Filter by call direction(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "latency_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "latency_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agent_version_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent version ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_version_name",
            "required": false,
            "in": "query",
            "description": "Search by agent version name (partial match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "required": false,
            "in": "query",
            "description": "Filter by sentiment(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "positive",
                "neutral",
                "negative",
                "unknown"
              ]
            }
          },
          {
            "name": "start_date",
            "required": false,
            "in": "query",
            "description": "Filter by start date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "required": false,
            "in": "query",
            "description": "Filter by end date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "duration_greater_than",
            "required": false,
            "in": "query",
            "description": "Filter by minimum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_less_than",
            "required": false,
            "in": "query",
            "description": "Filter by maximum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (min: 1, default: 20, max: 200)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_at",
            "required": false,
            "in": "query",
            "description": "Sort by created_at (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "duration",
            "required": false,
            "in": "query",
            "description": "Sort by duration (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by call status(es) - can be a single status or comma-separated list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "export",
            "required": false,
            "in": "query",
            "description": "Set to true to export all data without pagination",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calls in the batch fetched successfully"
          }
        },
        "summary": "List calls within a batch by ID",
        "tags": [
          "Batch Calls"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/call-logs": {
      "get": {
        "operationId": "CallLogsController_findAll",
        "parameters": [
          {
            "name": "agent_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "call_id",
            "required": false,
            "in": "query",
            "description": "Filter by call ID - can be a single ID or comma-separated list (e.g., call_abc,call_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch_call_id",
            "required": false,
            "in": "query",
            "description": "Filter by batch call ID - can be a single ID or comma-separated list (e.g., batch_abc,batch_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Filter by sender phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Filter by recipient phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by call type(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "web"
              ]
            }
          },
          {
            "name": "call_direction",
            "required": false,
            "in": "query",
            "description": "Filter by call direction(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "latency_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "latency_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agent_version_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent version ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_version_name",
            "required": false,
            "in": "query",
            "description": "Search by agent version name (partial match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "required": false,
            "in": "query",
            "description": "Filter by sentiment(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "positive",
                "neutral",
                "negative",
                "unknown"
              ]
            }
          },
          {
            "name": "start_date",
            "required": false,
            "in": "query",
            "description": "Filter by start date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "required": false,
            "in": "query",
            "description": "Filter by end date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "duration_greater_than",
            "required": false,
            "in": "query",
            "description": "Filter by minimum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_less_than",
            "required": false,
            "in": "query",
            "description": "Filter by maximum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (min: 1, default: 20, max: 200)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_at",
            "required": false,
            "in": "query",
            "description": "Sort by created_at (asc or desc)",
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "name": "duration",
            "required": false,
            "in": "query",
            "description": "Sort by duration (asc or desc)",
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by call status(es) - can be a single status or comma-separated list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "export",
            "required": false,
            "in": "query",
            "description": "Set to true to export all data without pagination",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "if-none-match",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "Encrypted ID of the organization",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return call logs with optional filtering and pagination"
          },
          "304": {
            "description": "Call logs unchanged since previous ETag"
          },
          "400": {
            "description": "Invalid filter parameters"
          }
        },
        "summary": "Get call logs with did_not_pick, completed, and failed statuses, with optional filtering and pagination",
        "tags": [
          "Call Logs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/call-logs/campaign/{campaignId}": {
      "get": {
        "operationId": "CallLogsController_findByCampaignId",
        "parameters": [
          {
            "name": "campaignId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return call logs for the specified campaign"
          },
          "404": {
            "description": "Campaign not found"
          }
        },
        "summary": "Get call logs by campaign ID",
        "tags": [
          "Call Logs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/call-logs/{id}": {
      "get": {
        "operationId": "CallLogsController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "Encrypted ID of the organization",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return the call log"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Call log not found"
          }
        },
        "summary": "Get a call log by ID",
        "tags": [
          "Call Logs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/call-logs/{id}/details": {
      "get": {
        "operationId": "CallLogsController_getCallLogDetails",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "required": true,
            "in": "query",
            "description": "Comma-separated list of fields to retrieve",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requested call log fields returned successfully"
          },
          "400": {
            "description": "No valid fields requested"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Call log not found"
          }
        },
        "summary": "Get specific fields for a call log (recording_url, transcript, summary, notes)",
        "tags": [
          "Call Logs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/call-logs/{id}/retries": {
      "get": {
        "operationId": "CallLogsController_findChildCallLogs",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "Encrypted ID of the organization",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return retry call logs for the specified parent call"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Parent call log not found"
          }
        },
        "summary": "Get retry call logs for a parent call ID",
        "tags": [
          "Call Logs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/calls": {
      "get": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nRetrieve all call logs for the authenticated organization.",
        "operationId": "CallsController_findAll",
        "parameters": [
          {
            "name": "agent_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "call_id",
            "required": false,
            "in": "query",
            "description": "Filter by call ID - can be a single ID or comma-separated list (e.g., call_abc,call_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch_call_id",
            "required": false,
            "in": "query",
            "description": "Filter by batch call ID - can be a single ID or comma-separated list (e.g., batch_abc,batch_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Filter by sender phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Filter by recipient phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by call type(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "web"
              ]
            }
          },
          {
            "name": "call_direction",
            "required": false,
            "in": "query",
            "description": "Filter by call direction(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "latency_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "latency_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agent_version_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent version ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_version_name",
            "required": false,
            "in": "query",
            "description": "Search by agent version name (partial match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "required": false,
            "in": "query",
            "description": "Filter by sentiment(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "positive",
                "neutral",
                "negative",
                "unknown"
              ]
            }
          },
          {
            "name": "start_date",
            "required": false,
            "in": "query",
            "description": "Filter by start date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "required": false,
            "in": "query",
            "description": "Filter by end date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "duration_greater_than",
            "required": false,
            "in": "query",
            "description": "Filter by minimum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_less_than",
            "required": false,
            "in": "query",
            "description": "Filter by maximum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (min: 1, default: 20, max: 200)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_at",
            "required": false,
            "in": "query",
            "description": "Sort by created_at (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "duration",
            "required": false,
            "in": "query",
            "description": "Sort by duration (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by call status(es) - can be a single status or comma-separated list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "export",
            "required": false,
            "in": "query",
            "description": "Set to true to export all data without pagination",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "Encrypted ID of the organization",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return all calls for the organization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CallLogs"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "summary": "Get all calls for the organization",
        "tags": [
          "Calls"
        ],
        "deprecated": true
      },
      "post": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nCreates a new call log entry for single outbound call automation. The call will be processed by the scheduler and initiated when resources are available.",
        "operationId": "CallsController_createCall",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCallDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Call created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCallResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - validation error"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not found - organization, agent, or phone number not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Create a single outbound call",
        "tags": [
          "Calls"
        ],
        "deprecated": true
      }
    },
    "/calls/single": {
      "post": {
        "operationId": "SingleCallController_makeCall",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MakeCallDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The call has been successfully initiated."
          },
          "400": {
            "description": "Bad request - missing or invalid parameters."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Agent version not found."
          },
          "500": {
            "description": "Internal server error."
          }
        },
        "summary": "Make a single call",
        "tags": [
          "Calls"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/calls/{id}": {
      "get": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nRetrieve a specific call log by its ID.",
        "operationId": "CallsController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return the call log",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallLogs"
                }
              }
            }
          },
          "404": {
            "description": "Call log not found"
          }
        },
        "summary": "Get a call by ID",
        "tags": [
          "Calls"
        ],
        "deprecated": true
      }
    },
    "/campaigns": {
      "get": {
        "operationId": "CampaignsController_findAll",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaigns fetched successfully"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Get all campaigns with pagination",
        "tags": [
          "Campaigns"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "CampaignsController_create",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCampaignDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campaign created successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required - Insufficient wallet credits"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a new campaign",
        "tags": [
          "Campaigns"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/campaigns-leads": {
      "post": {
        "operationId": "CampaignsLeadsController_create",
        "parameters": [
          {
            "name": "campaignId",
            "required": true,
            "in": "path",
            "description": "ID of the campaign",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCampaignLeadDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lead created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignLead"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Create a new lead for a specific campaign",
        "tags": [
          "Campaign Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/campaigns-leads/upload-file/{campaignId}": {
      "post": {
        "operationId": "CampaignsLeadsController_uploadFile",
        "parameters": [
          {
            "name": "campaignId",
            "required": true,
            "in": "path",
            "description": "ID of the campaign",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV or Excel file with leads data"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File processed successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Upload CSV or Excel file with leads data",
        "tags": [
          "Campaign Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/campaigns-leads/{id}": {
      "patch": {
        "operationId": "CampaignsLeadsController_update",
        "parameters": [
          {
            "name": "campaignId",
            "required": true,
            "in": "path",
            "description": "ID of the campaign",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the lead",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignLeadDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignLead"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Update a lead for a specific campaign",
        "tags": [
          "Campaign Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "get": {
        "operationId": "CampaignsLeadsController_findAll",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the campaign",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of leads",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CampaignLead"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get all leads for a specific campaign",
        "tags": [
          "Campaign Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "CampaignsLeadsController_softDelete",
        "parameters": [
          {
            "name": "campaignId",
            "required": true,
            "in": "path",
            "description": "ID of the campaign",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the lead",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead soft deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignLead"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Soft delete a lead (mark as deleted)",
        "tags": [
          "Campaign Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/campaigns/{id}": {
      "patch": {
        "operationId": "CampaignsController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign updated successfully"
          },
          "404": {
            "description": "Campaign not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Update a campaign by ID",
        "tags": [
          "Campaigns"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "get": {
        "operationId": "CampaignsController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign fetched successfully"
          },
          "404": {
            "description": "Campaign not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a single campaign by ID",
        "tags": [
          "Campaigns"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/external-webhooks/secret": {
      "get": {
        "operationId": "WebhookSecretsController_getSecret",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the active webhook secret."
          },
          "401": {
            "description": "Unauthorized."
          }
        },
        "summary": "Get the active webhook secret for an organization",
        "tags": [
          "External Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/external-webhooks/secret/rotate": {
      "post": {
        "operationId": "WebhookSecretsController_rotateSecret",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateWebhookSecretDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The secret has been successfully rotated."
          },
          "400": {
            "description": "Invalid input data."
          },
          "401": {
            "description": "Unauthorized."
          }
        },
        "summary": "Rotate the webhook secret for an organization",
        "tags": [
          "External Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/external-webhooks/secret/{id}": {
      "patch": {
        "operationId": "WebhookSecretsController_updateSecretName",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the webhook secret",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookSecretDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The secret name has been successfully updated."
          },
          "400": {
            "description": "Invalid input data."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Secret not found."
          }
        },
        "summary": "Update the name of a webhook secret",
        "tags": [
          "External Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "WebhookSecretsController_removeSecret",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the webhook secret",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The secret has been successfully deleted."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Secret not found."
          }
        },
        "summary": "Delete a webhook secret (soft delete)",
        "tags": [
          "External Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/languages": {
      "get": {
        "operationId": "LanguagesController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "Languages"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/languages/{id}": {
      "get": {
        "operationId": "LanguagesController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "Languages"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/llms": {
      "get": {
        "operationId": "LlmsController_getAll",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page",
            "schema": {
              "example": 10,
              "type": "number"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "example": "id",
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "description": "Sort order (ASC or DESC)",
            "schema": {
              "enum": [
                "ASC",
                "DESC"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of all LLMs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Llm"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get all LLMs",
        "tags": [
          "LLMs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/llms/{id}": {
      "get": {
        "operationId": "LlmsController_findById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the LLM",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "LLM found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Llm"
                }
              }
            }
          },
          "404": {
            "description": "LLM not found"
          }
        },
        "summary": "Get LLM by ID",
        "tags": [
          "LLMs"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/organization-phone-numbers": {
      "get": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nReturns a paginated list of all phone numbers registered in the system, supporting pagination (page, limit) and sorting (sortBy, sortOrder). Results include phone number details regardless of which telephony provider they belong to.",
        "operationId": "OrganizationPhoneNumbersController_findAll",
        "parameters": [
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ASC",
                "DESC"
              ],
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": true,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": true,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of phone numbers with pagination."
          }
        },
        "summary": "Get all organization phone numbers (paginated)",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true
      }
    },
    "/organization-phone-numbers/defaults": {
      "post": {
        "operationId": "OrganizationPhoneNumbersController_assignDefaultPhoneNumberV1",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDefaultPhoneNumberDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default phone number assigned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchasePhoneNumberResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or unsupported country."
          }
        },
        "summary": "Assign a default phone number based on country code (V1 alias)",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/organization-phone-numbers/orders": {
      "post": {
        "operationId": "OrganizationPhoneNumbersController_purchasePhoneNumberV1",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchasePhoneNumberRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Phone number purchase initiated and record created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchasePhoneNumberResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or failed to purchase"
          }
        },
        "summary": "Purchase a phone number from the specified provider (V1 alias)",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/organization-phone-numbers/provider-numbers": {
      "get": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nUnified endpoint for retrieving available phone numbers from either Plivo or Twilio. Determines which provider to use from telephony_provider_id (1=Plivo, 2=Twilio), always requests the 'local' number type (formatted per-provider - 'local' for Plivo, 'Local' for Twilio), and returns a consistent response format regardless of provider.",
        "operationId": "OrganizationPhoneNumbersController_getProviderPhoneNumbers",
        "parameters": [
          {
            "name": "country_iso",
            "required": true,
            "in": "query",
            "description": "ISO country code (e.g., US, GB, CA)",
            "schema": {
              "example": "US",
              "type": "string"
            }
          },
          {
            "name": "telephony_provider_id",
            "required": true,
            "in": "query",
            "description": "ID of telephony provider (14-char string)",
            "schema": {
              "example": "prov_plivo_123456",
              "type": "string"
            }
          },
          {
            "name": "region",
            "required": false,
            "in": "query",
            "description": "Region/state to filter numbers by",
            "schema": {
              "example": "Karnataka",
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA-encrypted organization_id string (base64 format)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available phone numbers retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProviderPhoneNumbersResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or failed to retrieve numbers"
          }
        },
        "summary": "Get available phone numbers from the specified provider",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true
      }
    },
    "/organization-phone-numbers/purchase": {
      "post": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nUnified endpoint for purchasing a phone number from either Plivo or Twilio. Determines which provider to use from telephonyProviderId (1=Plivo, 2=Twilio), calls that provider's API to purchase the number, then creates a database record associating it with the organization in a single operation. This is the recommended endpoint for purchases, since the single-provider endpoints only call the external API without creating a database record.",
        "operationId": "OrganizationPhoneNumbersController_purchasePhoneNumber",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchasePhoneNumberRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Phone number purchase initiated and record created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchasePhoneNumberResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or failed to purchase"
          }
        },
        "summary": "Purchase a phone number from the specified provider",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true
      }
    },
    "/organization-phone-numbers/sip-trunks": {
      "post": {
        "operationId": "OrganizationPhoneNumbersController_linkSipTrunkV1",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkSipTrunkDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "SIP trunk linked and registered with media server."
          },
          "400": {
            "description": "Invalid input or missing configuration"
          },
          "409": {
            "description": "Phone number already registered"
          },
          "502": {
            "description": "Media server trunk registration failed"
          }
        },
        "summary": "Link a BYOC phone number with SIP trunk credentials (V1 alias)",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/organization-phone-numbers/{id}": {
      "patch": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nUpdates the database record for an existing phone number, e.g. its organization association or other metadata. Only updates the database record - it cannot change the actual phone number with the external telephony provider. Returns 404 if not found; only users from the owning organization can update it.",
        "operationId": "OrganizationPhoneNumbersController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA-encrypted organization_id string (base64 format)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationPhoneNumberDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Phone number updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPhoneNumber"
                }
              }
            }
          },
          "403": {
            "description": "Phone number does not belong to your organization"
          },
          "404": {
            "description": "Phone number not found"
          }
        },
        "summary": "Update a phone number",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true
      },
      "get": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nFetches a single phone number record by ID, including its organization and telephony provider association. Returns 404 if not found; only users from the owning organization can view it.",
        "operationId": "OrganizationPhoneNumbersController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA-encrypted organization_id string (base64 format)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Phone number found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPhoneNumber"
                }
              }
            }
          },
          "403": {
            "description": "Phone number does not belong to your organization"
          },
          "404": {
            "description": "Phone number not found"
          }
        },
        "summary": "Get a phone number by ID",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true
      },
      "delete": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nMarks a phone number record as deleted without removing it, preserving it for historical purposes while making it inactive. Only affects the database record - it does not release the number from the external telephony provider (contact the provider directly for that). Returns 404 if not found; only users from the owning organization can delete it.",
        "operationId": "OrganizationPhoneNumbersController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA-encrypted organization_id string (base64 format)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Phone number deleted."
          },
          "403": {
            "description": "Phone number does not belong to your organization"
          },
          "404": {
            "description": "Phone number not found"
          }
        },
        "summary": "Soft delete a phone number",
        "tags": [
          "Organization Phone Numbers"
        ],
        "deprecated": true
      }
    },
    "/transcribers": {
      "get": {
        "operationId": "TranscribersController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": "List of all transcribers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Transcriber"
                  }
                }
              }
            }
          }
        },
        "summary": "Get all transcriber providers and models",
        "tags": [
          "Transcribers"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/transcribers/{id}": {
      "get": {
        "operationId": "TranscribersController_findById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Transcriber ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transcriber found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcriber"
                }
              }
            }
          },
          "404": {
            "description": "Transcriber not found"
          }
        },
        "summary": "Get transcriber by ID",
        "tags": [
          "Transcribers"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/user-webhooks": {
      "get": {
        "operationId": "UserWebhooksController_findAll",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (default: 10)",
            "schema": {
              "example": 10,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "example": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List all user webhooks for an organization",
        "tags": [
          "User Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "UserWebhooksController_create",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserWebhookDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Create a new user webhook",
        "tags": [
          "User Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/user-webhooks/{id}": {
      "patch": {
        "operationId": "UserWebhooksController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The ID of the webhook.",
            "schema": {
              "example": "wh_123",
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Update a user webhook",
        "tags": [
          "User Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "get": {
        "operationId": "UserWebhooksController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The ID of the webhook.",
            "schema": {
              "example": "wh_123",
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get a user webhook by ID",
        "tags": [
          "User Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "UserWebhooksController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The ID of the webhook.",
            "schema": {
              "example": "wh_123",
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Soft delete a user webhook",
        "tags": [
          "User Webhooks"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/v1/agents": {
      "get": {
        "description": "Returns all agents for your organization. Agent functions are NOT included in list responses - fetch a specific agent by ID to get its functions.",
        "operationId": "AgentsV1Controller_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agents returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Agents"
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "agents": [
                        {
                          "id": "agent_2g7Xy3tY53gRlp",
                          "folder_id": null,
                          "current_version_number": 1,
                          "timezone": "Asia/Kolkata",
                          "agent_type": "Single_Prompt_Agent",
                          "pipeline_type": "Cascaded",
                          "webhook_id": null,
                          "current_version": {
                            "agent_id": "agent_2g7Xy3tY53gRlp",
                            "version_number": 1,
                            "version_title": "Version 1",
                            "title": "Customer Support Agent",
                            "is_published": false,
                            "language_id": "lang_en_in",
                            "voice_id": "voice_abc123",
                            "llm_id": "llm_A1B2C3D4E5F6G7",
                            "transcriber_id": "trs_deepgram_nova_2",
                            "fallback_stt_enabled": true,
                            "stt_fallback_transcriber_id": "trs_soniox",
                            "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                          },
                          "versions": [
                            {
                              "agent_id": "agent_2g7Xy3tY53gRlp",
                              "version_number": 1,
                              "version_title": "Version 1",
                              "title": "Customer Support Agent",
                              "is_published": false,
                              "language_id": "lang_en_in",
                              "voice_id": "voice_abc123",
                              "llm_id": "llm_A1B2C3D4E5F6G7",
                              "transcriber_id": "trs_deepgram_nova_2",
                              "fallback_stt_enabled": true,
                              "stt_fallback_transcriber_id": "trs_soniox",
                              "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid query parameters",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Agents",
        "tags": [
          "Agents V1",
          "V1"
        ]
      },
      "post": {
        "description": "Creates an agent with its first draft version. Optionally include `agent_functions` and `post_call_analysis` in the body to set them at creation time.\n\n**Phone number fields:** `inbound_phone_number_id` and `outbound_phone_number_id` must belong to the authenticated workspace. On create, these IDs are stored on the draft version. Live dispatch routing is claimed when the version is published through `PATCH /v1/agents/{id}` with `is_published: true`.",
        "operationId": "AgentsV1Controller_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentDto"
              },
              "examples": {
                "request": {
                  "summary": "Create an agent",
                  "value": {
                    "title": "Customer Support Agent",
                    "language_id": "lang_en_in",
                    "voice_id": "voice_abc123",
                    "llm_id": "llm_A1B2C3D4E5F6G7",
                    "transcriber_id": "trs_deepgram_nova_2",
                    "system_prompt_text": "You are a helpful support agent. Confirm the customer issue and summarize next steps.",
                    "fallback_stt_enabled": true,
                    "stt_fallback_transcriber_id": "trs_soniox",
                    "post_call_analysis": [
                      {
                        "field_name": "issue_type",
                        "field_type": "STRING",
                        "field_description": "Main customer issue discussed on the call"
                      }
                    ],
                    "predictive_preprocessing_enabled": false,
                    "outbound_phone_number_id": "phn_def456",
                    "agent_type": "Single_Prompt_Agent",
                    "prompt_text": "You are a helpful support agent. Confirm the customer's issue and summarize next steps."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "agent_2g7Xy3tY53gRlp",
                      "folder_id": null,
                      "current_version_number": 1,
                      "timezone": "Asia/Kolkata",
                      "agent_type": "Single_Prompt_Agent",
                      "pipeline_type": "Cascaded",
                      "webhook_id": null,
                      "current_version": {
                        "agent_id": "agent_2g7Xy3tY53gRlp",
                        "version_number": 1,
                        "version_title": "Version 1",
                        "title": "Customer Support Agent",
                        "is_published": false,
                        "language_id": "lang_en_in",
                        "voice_id": "voice_abc123",
                        "llm_id": "llm_A1B2C3D4E5F6G7",
                        "transcriber_id": "trs_deepgram_nova_2",
                        "fallback_stt_enabled": true,
                        "stt_fallback_transcriber_id": "trs_soniox",
                        "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                      },
                      "versions": [
                        {
                          "agent_id": "agent_2g7Xy3tY53gRlp",
                          "version_number": 1,
                          "version_title": "Version 1",
                          "title": "Customer Support Agent",
                          "is_published": false,
                          "language_id": "lang_en_in",
                          "voice_id": "voice_abc123",
                          "llm_id": "llm_A1B2C3D4E5F6G7",
                          "transcriber_id": "trs_deepgram_nova_2",
                          "fallback_stt_enabled": true,
                          "stt_fallback_transcriber_id": "trs_soniox",
                          "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Request validation failed",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Agent",
        "tags": [
          "Agents V1",
          "V1"
        ]
      }
    },
    "/v1/agents/{id}": {
      "delete": {
        "description": "Soft-deletes the agent and all its versions.",
        "operationId": "AgentsV1Controller_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Agent ID",
            "schema": {
              "example": "agent_2g7Xy3tY53gRlp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent deleted successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "success": true,
                      "message": "Agent deleted successfully"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Agent deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Agent not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Agent not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete Agent",
        "tags": [
          "Agents V1",
          "V1"
        ]
      },
      "get": {
        "description": "Returns the agent with all versions. Each version includes `agent_functions`, `pronunciations`, and `postcall_analysis` embedded.",
        "operationId": "AgentsV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Agent ID",
            "schema": {
              "example": "agent_2g7Xy3tY53gRlp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent returned with all versions and embedded agent_functions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "agent_2g7Xy3tY53gRlp",
                      "folder_id": null,
                      "current_version_number": 1,
                      "timezone": "Asia/Kolkata",
                      "agent_type": "Single_Prompt_Agent",
                      "pipeline_type": "Cascaded",
                      "webhook_id": null,
                      "current_version": {
                        "agent_id": "agent_2g7Xy3tY53gRlp",
                        "version_number": 1,
                        "version_title": "Version 1",
                        "title": "Customer Support Agent",
                        "is_published": false,
                        "language_id": "lang_en_in",
                        "voice_id": "voice_abc123",
                        "llm_id": "llm_A1B2C3D4E5F6G7",
                        "transcriber_id": "trs_deepgram_nova_2",
                        "fallback_stt_enabled": true,
                        "stt_fallback_transcriber_id": "trs_soniox",
                        "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                      },
                      "versions": [
                        {
                          "agent_id": "agent_2g7Xy3tY53gRlp",
                          "version_number": 1,
                          "version_title": "Version 1",
                          "title": "Customer Support Agent",
                          "is_published": false,
                          "language_id": "lang_en_in",
                          "voice_id": "voice_abc123",
                          "llm_id": "llm_A1B2C3D4E5F6G7",
                          "transcriber_id": "trs_deepgram_nova_2",
                          "fallback_stt_enabled": true,
                          "stt_fallback_transcriber_id": "trs_soniox",
                          "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid agent ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid query parameters",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - agent does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Agent not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Agent not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Agent Details",
        "tags": [
          "Agents V1",
          "V1"
        ]
      },
      "patch": {
        "description": "Updates the specified draft version of an agent. `version_number` is required.\n\n**Managing functions via this endpoint:**\n- Pass `agent_functions: [...]` to fully replace all functions for that version.\n- Pass `agent_functions: []` to remove all functions.\n- Omit `agent_functions` entirely to leave existing functions untouched.\n\n**Post-call analysis LLM:**\n- Pass `post_call_analysis_llm_id`, for example `llm_A1B2C3D4E5F6G7`, to set the LLM used for post-call field extraction.\n- Pass `null` to clear the override and revert to the organization default.\n- Omit the field to leave it unchanged.\n\n**Phone number assignment:**\n- `inbound_phone_number_id` and `outbound_phone_number_id` are applied to live routing only when `is_published: true` is included in the same request.\n- Sending a phone number ID without `is_published: true` leaves live routing unchanged.\n- Pass an empty string to detach a phone number while publishing.\n- Outbound changes can return `409 Conflict` when active workflows still use the number. Pause those workflows before retrying.\n\nPublished versions cannot be updated, except to set `is_published: true` to publish a draft.",
        "operationId": "AgentsV1Controller_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Agent ID",
            "schema": {
              "example": "agent_2g7Xy3tY53gRlp",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentDto"
              },
              "examples": {
                "request": {
                  "summary": "Update a draft agent version",
                  "value": {
                    "version_number": 1,
                    "title": "Customer Support Agent",
                    "llm_id": "llm_A1B2C3D4E5F6G7",
                    "fallback_stt_enabled": true,
                    "stt_fallback_transcriber_id": "trs_soniox",
                    "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                  }
                },
                "clearPostCallAnalysisLlm": {
                  "summary": "Clear post-call analysis LLM override",
                  "value": {
                    "version_number": 1,
                    "post_call_analysis_llm_id": null
                  }
                },
                "publishWithOutboundNumber": {
                  "summary": "Publish a draft with an outbound number",
                  "value": {
                    "version_number": 1,
                    "is_published": true,
                    "outbound_phone_number_id": "phn_def456"
                  }
                },
                "detachOutboundNumber": {
                  "summary": "Publish while detaching an outbound number",
                  "value": {
                    "version_number": 2,
                    "is_published": true,
                    "outbound_phone_number_id": ""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "agent_2g7Xy3tY53gRlp",
                      "folder_id": null,
                      "current_version_number": 1,
                      "timezone": "Asia/Kolkata",
                      "agent_type": "Single_Prompt_Agent",
                      "pipeline_type": "Cascaded",
                      "webhook_id": null,
                      "current_version": {
                        "agent_id": "agent_2g7Xy3tY53gRlp",
                        "version_number": 1,
                        "version_title": "Version 1",
                        "title": "Customer Support Agent",
                        "is_published": false,
                        "language_id": "lang_en_in",
                        "voice_id": "voice_abc123",
                        "llm_id": "llm_A1B2C3D4E5F6G7",
                        "transcriber_id": "trs_deepgram_nova_2",
                        "fallback_stt_enabled": true,
                        "stt_fallback_transcriber_id": "trs_soniox",
                        "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                      },
                      "versions": [
                        {
                          "agent_id": "agent_2g7Xy3tY53gRlp",
                          "version_number": 1,
                          "version_title": "Version 1",
                          "title": "Customer Support Agent",
                          "is_published": false,
                          "language_id": "lang_en_in",
                          "voice_id": "voice_abc123",
                          "llm_id": "llm_A1B2C3D4E5F6G7",
                          "transcriber_id": "trs_deepgram_nova_2",
                          "fallback_stt_enabled": true,
                          "stt_fallback_transcriber_id": "trs_soniox",
                          "post_call_analysis_llm_id": "llm_A1B2C3D4E5F6G7"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or attempting to update a published version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Request validation failed",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Agent or version not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Agent not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Phone number assignment conflicts with active workflows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "phoneNumberUsedInActiveWorkflows": {
                    "summary": "409 Conflict",
                    "value": {
                      "statusCode": 409,
                      "message": "Cannot bind outbound_phone_number_id \"phn_def456\" to this agent because it is currently used by active workflows. Pause those workflows first, then retry.",
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update Agent",
        "tags": [
          "Agents V1",
          "V1"
        ]
      }
    },
    "/v1/batch-calls": {
      "get": {
        "operationId": "BatchCallsV1Controller_list",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by batch status - can be a single status or comma-separated list. Supported values include draft, waiting, scheduled, running, paused, completed, cancelled, deleted, and legacy active.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch calls returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "batch_abc123"
                          },
                          "title": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "total_records": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "page": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "items": [
                        {
                          "id": "batch_abc123",
                          "title": "Q3 Follow-up Batch",
                          "status": "waiting",
                          "total_records": 250,
                          "createdAt": "2026-07-03T10:30:00.000Z"
                        }
                      ],
                      "total": 1,
                      "page": 1,
                      "limit": 20
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid query parameters",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "Destination country or network prefix is not enabled for this workspace",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Batch Calls",
        "tags": [
          "Batch Calls",
          "Batch Calls V1",
          "V1"
        ],
        "description": "Returns batch call jobs for the authenticated workspace, including status and progress fields."
      },
      "post": {
        "description": "Uploads a CSV or Excel leads file, creates a batch call, and enqueues outbound calls for all leads.",
        "operationId": "BatchCallsV1Controller_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "title",
                  "agent_id",
                  "agent_version_number"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV or Excel file containing leads (max 10 MB)"
                  },
                  "title": {
                    "type": "string",
                    "example": "Q3 Follow-up Batch"
                  },
                  "agent_id": {
                    "type": "string",
                    "example": "agent_abc123"
                  },
                  "agent_version_number": {
                    "type": "number",
                    "example": 1
                  },
                  "starts_at": {
                    "type": "string",
                    "example": "2024-01-15T09:00:00Z",
                    "description": "ISO 8601 datetime - leave empty to start immediately"
                  },
                  "ends_at": {
                    "type": "string",
                    "example": "2024-01-15T18:00:00Z"
                  },
                  "calling_hours_start": {
                    "type": "string",
                    "example": "09:00"
                  },
                  "calling_hours_end": {
                    "type": "string",
                    "example": "18:00"
                  }
                }
              },
              "examples": {
                "request": {
                  "summary": "Request example",
                  "value": {
                    "file": "leads.csv",
                    "title": "Q3 Follow-up Batch",
                    "agent_id": "agent_abc123",
                    "agent_version_number": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Batch call created and calls enqueued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "batch_abc123"
                    },
                    "title": {
                      "type": "string"
                    },
                    "total_records": {
                      "type": "number",
                      "example": 250
                    },
                    "status": {
                      "type": "string",
                      "example": "initiated"
                    },
                    "from_number": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "batch_abc123",
                      "title": "Q3 Follow-up Batch",
                      "total_records": 250,
                      "status": "initiated",
                      "from_number": "+14155552671"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid file or missing required fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "The uploaded file must include a phone_number column",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "Destination country or network prefix is not enabled for this workspace",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Batch Call",
        "tags": [
          "Batch Calls",
          "Batch Calls V1",
          "V1"
        ]
      }
    },
    "/v1/batch-calls/{id}": {
      "get": {
        "operationId": "BatchCallsV1Controller_listCallsInBatch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Batch call ID",
            "schema": {
              "example": "batch_abc123",
              "type": "string"
            }
          },
          {
            "name": "agent_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "call_id",
            "required": false,
            "in": "query",
            "description": "Filter by call ID - can be a single ID or comma-separated list (e.g., call_abc,call_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch_call_id",
            "required": false,
            "in": "query",
            "description": "Filter by batch call ID - can be a single ID or comma-separated list (e.g., batch_abc,batch_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Filter by sender phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Filter by recipient phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by call type(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "web"
              ]
            }
          },
          {
            "name": "call_direction",
            "required": false,
            "in": "query",
            "description": "Filter by call direction(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "latency_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "latency_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agent_version_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent version ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_version_name",
            "required": false,
            "in": "query",
            "description": "Search by agent version name (partial match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "required": false,
            "in": "query",
            "description": "Filter by sentiment(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "positive",
                "neutral",
                "negative",
                "unknown"
              ]
            }
          },
          {
            "name": "start_date",
            "required": false,
            "in": "query",
            "description": "Filter by start date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "required": false,
            "in": "query",
            "description": "Filter by end date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "duration_greater_than",
            "required": false,
            "in": "query",
            "description": "Filter by minimum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_less_than",
            "required": false,
            "in": "query",
            "description": "Filter by maximum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (min: 1, default: 20, max: 200)",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "created_at",
            "required": false,
            "in": "query",
            "description": "Sort by created_at (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "duration",
            "required": false,
            "in": "query",
            "description": "Sort by duration (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by call status(es) - can be a single status or comma-separated list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "export",
            "required": false,
            "in": "query",
            "description": "Set to true to export all data without pagination",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "end_reason",
            "required": false,
            "in": "query",
            "description": "Filter by end/hangup reason - exact match; comma-separate multiple values for OR filtering",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calls in the batch returned successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "callLogs": [
                        {
                          "id": "call_abc123",
                          "agent_id": "agent_2g7Xy3tY53gRlp",
                          "to_number": "+919876543210",
                          "from_number": "+14155552671",
                          "status": "initiated",
                          "call_direction": "outbound",
                          "createdAt": "2026-07-03T10:30:00.000Z",
                          "batch_id": "batch_abc123"
                        }
                      ],
                      "total": 1,
                      "page": 1,
                      "limit": 20,
                      "totalPages": 1
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "callLogs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "call_abc123"
                          },
                          "status": {
                            "type": "string",
                            "example": "completed"
                          },
                          "from_number": {
                            "type": "string",
                            "example": "+14155552671"
                          },
                          "to_number": {
                            "type": "string",
                            "example": "+919876543210"
                          },
                          "duration": {
                            "type": "number",
                            "example": 42
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "page": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "totalPages": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid batch call ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid batch call ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "Destination country or network prefix is not enabled for this workspace",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Batch call not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Batch call not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Batch Call Details",
        "tags": [
          "Batch Calls",
          "Batch Calls V1",
          "V1"
        ],
        "description": "Returns one batch call job and its current processing details."
      }
    },
    "/v1/calls": {
      "get": {
        "operationId": "CallsV1Controller_findAll",
        "parameters": [
          {
            "name": "agent_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "call_id",
            "required": false,
            "in": "query",
            "description": "Filter by call ID - can be a single ID or comma-separated list (e.g., call_abc,call_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch_call_id",
            "required": false,
            "in": "query",
            "description": "Filter by batch call ID - can be a single ID or comma-separated list (e.g., batch_abc,batch_def)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Filter by sender phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Filter by recipient phone number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by call type(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "web"
              ]
            }
          },
          {
            "name": "call_direction",
            "required": false,
            "in": "query",
            "description": "Filter by call direction(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "latency_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "latency_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum latency (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agent_version_id",
            "required": false,
            "in": "query",
            "description": "Filter by agent version ID(s) - can be a single ID or comma-separated list (e.g., 1,2,3)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_version_name",
            "required": false,
            "in": "query",
            "description": "Search by agent version name (partial match, case-insensitive)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "required": false,
            "in": "query",
            "description": "Filter by sentiment(s) - can be a single value or comma-separated list",
            "schema": {
              "type": "string",
              "enum": [
                "positive",
                "neutral",
                "negative",
                "unknown"
              ]
            }
          },
          {
            "name": "start_date",
            "required": false,
            "in": "query",
            "description": "Filter by start date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "required": false,
            "in": "query",
            "description": "Filter by end date (ISO format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "duration_greater_than",
            "required": false,
            "in": "query",
            "description": "Filter by minimum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_less_than",
            "required": false,
            "in": "query",
            "description": "Filter by maximum call duration (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_min",
            "required": false,
            "in": "query",
            "description": "Filter by minimum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration_max",
            "required": false,
            "in": "query",
            "description": "Filter by maximum duration range (in milliseconds)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (min: 1, default: 20, max: 200)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_at",
            "required": false,
            "in": "query",
            "description": "Sort by created_at (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "duration",
            "required": false,
            "in": "query",
            "description": "Sort by duration (asc or desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by call status(es) - can be a single status or comma-separated list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "export",
            "required": false,
            "in": "query",
            "description": "Set to true to export all data without pagination",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "end_reason",
            "required": false,
            "in": "query",
            "description": "Filter by end/hangup reason - exact match; comma-separate multiple values for OR filtering",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calls returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CallLogs"
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": [
                      {
                        "id": "call_abc123",
                        "agent_id": "agent_2g7Xy3tY53gRlp",
                        "to_number": "+919876543210",
                        "from_number": "+14155552671",
                        "status": "initiated",
                        "call_direction": "outbound",
                        "createdAt": "2026-07-03T10:30:00.000Z",
                        "duration": 42,
                        "end_reason": "completed"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid query parameters",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "Destination country or network prefix is not enabled for this workspace",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Calls",
        "tags": [
          "Calls",
          "Calls V1",
          "V1"
        ],
        "description": "Returns calls for the authenticated workspace using the supplied filters, newest records first."
      },
      "post": {
        "description": "Schedules a single outbound call. The call is queued and initiated when resources are available.",
        "operationId": "CallsV1Controller_createCall",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCallDto"
              },
              "examples": {
                "request": {
                  "summary": "Create an outbound call",
                  "value": {
                    "agent_id": "agent_2g7Xy3tY53gRlp",
                    "phone_number": "+919876543210",
                    "agent_version_number": 1,
                    "metadata": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Call created and queued successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCallResponseDto"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "call_abc123",
                      "to_phone_number": "+919876543210",
                      "agent_id": "agent_2g7Xy3tY53gRlp",
                      "agent_version_number": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body - missing required fields or validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "phone_number must be a valid E.164 phone number",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required - insufficient billing wallet balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "402 Payment Required",
                    "value": {
                      "statusCode": 402,
                      "message": "Insufficient billing wallet balance",
                      "error": "Payment Required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - KYC not verified or API key does not have access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "Destination country or network prefix is not enabled for this workspace",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Agent or phone number not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Agent or phone number not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Call",
        "tags": [
          "Calls",
          "Calls V1",
          "V1"
        ]
      }
    },
    "/v1/calls/{id}": {
      "get": {
        "operationId": "CallsV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Call ID",
            "schema": {
              "example": "call_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallLogs"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "call_abc123",
                      "agent_id": "agent_2g7Xy3tY53gRlp",
                      "to_number": "+919876543210",
                      "from_number": "+14155552671",
                      "status": "initiated",
                      "call_direction": "outbound",
                      "createdAt": "2026-07-03T10:30:00.000Z",
                      "duration": 42,
                      "transcript": "Agent: Hello Priya. User: I am interested in the loan offer.",
                      "summary": "Customer asked for details about the loan offer."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid call ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid call ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - call does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this call",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Call not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Call not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Call Details",
        "tags": [
          "Calls",
          "Calls V1",
          "V1"
        ],
        "description": "Returns the current call record, including routing, status, transcript, and analysis fields when available."
      }
    },
    "/v1/knowledge-base": {
      "get": {
        "operationId": "KnowledgeBaseV1Controller_findAll",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "schema": {
              "example": "id",
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ASC",
                "DESC"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge bases returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "meta"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/KnowledgeBase"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "required": [
                        "totalItems",
                        "itemsPerPage",
                        "totalPages",
                        "currentPage"
                      ],
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "example": 1
                        },
                        "itemsPerPage": {
                          "type": "integer",
                          "example": 20
                        },
                        "totalPages": {
                          "type": "integer",
                          "example": 1
                        },
                        "currentPage": {
                          "type": "integer",
                          "example": 1
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "items": [
                        {
                          "id": "kb_abc123",
                          "name": "Loan FAQ"
                        }
                      ],
                      "meta": {
                        "totalItems": 1,
                        "itemsPerPage": 20,
                        "totalPages": 1,
                        "currentPage": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Knowledge Bases",
        "tags": [
          "Knowledge Base",
          "Knowledge Base V1",
          "V1"
        ],
        "description": "Returns knowledge bases for the authenticated workspace in an items and meta pagination envelope."
      },
      "post": {
        "operationId": "KnowledgeBaseV1Controller_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeBaseDto"
              },
              "examples": {
                "request": {
                  "summary": "Request example",
                  "value": {
                    "name": "Product Documentation"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Knowledge base created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBase"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "kb_abc123",
                      "name": "Loan FAQ",
                      "description": "Frequently asked questions for loan calls",
                      "file_name": "loan-faq.pdf",
                      "status": "ready",
                      "createdAt": "2026-07-03T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Knowledge base name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "409 Conflict",
                    "value": {
                      "statusCode": 409,
                      "message": "Knowledge base with this name already exists",
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Knowledge Base",
        "tags": [
          "Knowledge Base",
          "Knowledge Base V1",
          "V1"
        ],
        "description": "Creates an empty knowledge base that can be populated and attached to agent versions."
      }
    },
    "/v1/knowledge-base/{id}": {
      "delete": {
        "operationId": "KnowledgeBaseV1Controller_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge base deleted successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "success": true,
                      "message": "Knowledge base deleted successfully"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Knowledge base deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - knowledge base does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Knowledge base not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Knowledge base not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Knowledge base is still used by one or more agents.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ],
                  "properties": {
                    "agent_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "agent_2g7Xy3tY53gRlp"
                      ]
                    }
                  }
                },
                "examples": {
                  "knowledgeBaseInUse": {
                    "summary": "409 Conflict",
                    "value": {
                      "statusCode": 409,
                      "message": "This knowledge base cannot be deleted because it is being used by 1 agent(s): agent_2g7Xy3tY53gRlp. Please unlink it from these agents before deleting.",
                      "agent_ids": [
                        "agent_2g7Xy3tY53gRlp"
                      ],
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete Knowledge Base",
        "tags": [
          "Knowledge Base",
          "Knowledge Base V1",
          "V1"
        ],
        "description": "Soft-deletes a knowledge base. Deletion is blocked with `409 Conflict` while the knowledge base is still referenced by the current draft or latest published version of any agent in the workspace."
      },
      "get": {
        "operationId": "KnowledgeBaseV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge base returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBase"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "kb_abc123",
                      "name": "Loan FAQ",
                      "description": "Frequently asked questions for loan calls",
                      "file_name": "loan-faq.pdf",
                      "status": "ready",
                      "createdAt": "2026-07-03T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Knowledge Base Details",
        "tags": [
          "Knowledge Base",
          "Knowledge Base V1",
          "V1"
        ],
        "description": "Returns one knowledge base owned by the authenticated workspace."
      },
      "patch": {
        "operationId": "KnowledgeBaseV1Controller_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKnowledgeBaseDto"
              },
              "examples": {
                "request": {
                  "summary": "Update a knowledge base",
                  "value": {
                    "name": "Updated Loan FAQ"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Knowledge base updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBase"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "kb_abc123",
                      "name": "Updated Loan FAQ",
                      "description": "Frequently asked questions for loan calls",
                      "file_name": "loan-faq.pdf",
                      "status": "ready",
                      "createdAt": "2026-07-03T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "New name already in use in this workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "409 Conflict",
                    "value": {
                      "statusCode": 409,
                      "message": "Knowledge base with this name already exists",
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update Knowledge Base",
        "tags": [
          "Knowledge Base",
          "Knowledge Base V1",
          "V1"
        ],
        "description": "Renames one knowledge base without changing its ID or agent attachments."
      }
    },
    "/v1/languages": {
      "get": {
        "operationId": "LanguagesV1Controller_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Languages returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Languages"
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": [
                      {
                        "id": "lang_en_in",
                        "name": "English (India)",
                        "code": "en-IN"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Languages",
        "tags": [
          "Languages V1",
          "V1"
        ],
        "description": "Returns the complete catalog of languages available for agent configuration."
      }
    },
    "/v1/languages/{id}": {
      "get": {
        "operationId": "LanguagesV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Language ID",
            "schema": {
              "example": "lang_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Language returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Languages"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "lang_en_in",
                      "name": "English (India)",
                      "code": "en-IN"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid catalog ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid catalog ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Language not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Language not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Language Details",
        "tags": [
          "Languages V1",
          "V1"
        ],
        "description": "Returns one language catalog record by ID."
      }
    },
    "/v1/llms": {
      "get": {
        "operationId": "LlmsV1Controller_getAll",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "schema": {
              "example": "id",
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ASC",
                "DESC"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "LLMs returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Llm"
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": [
                      {
                        "id": "llm_A1B2C3D4E5F6G7",
                        "name": "GPT-4.1 Mini",
                        "provider": "openai",
                        "supports_structured_output": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid query parameters",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List LLMs",
        "tags": [
          "LLMs",
          "LLMs V1",
          "V1"
        ],
        "description": "Returns the complete catalog of large language models available for agent configuration."
      }
    },
    "/v1/llms/fallback": {
      "get": {
        "operationId": "LlmsV1Controller_getFallback",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "schema": {
              "example": "id",
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ASC",
                "DESC"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fallback LLM returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Llm"
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid query parameters",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Fallback LLMs",
        "tags": [
          "LLMs",
          "LLMs V1",
          "V1"
        ],
        "description": "Returns large language models that can be selected as fallback models."
      }
    },
    "/v1/llms/{id}": {
      "get": {
        "operationId": "LlmsV1Controller_findById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "LLM ID",
            "schema": {
              "example": "llm_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "LLM returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Llm"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "llm_A1B2C3D4E5F6G7",
                      "name": "GPT-4.1 Mini",
                      "provider": "openai",
                      "supports_structured_output": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid catalog ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid catalog ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "LLM not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "LLM not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get LLM Details",
        "tags": [
          "LLMs",
          "LLMs V1",
          "V1"
        ],
        "description": "Returns one large language model catalog record by ID."
      }
    },
    "/v1/organization-phone-numbers": {
      "get": {
        "operationId": "OrganizationPhoneNumbersV1Controller_findAll",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "example": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Phone numbers returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "phn_abc123"
                          },
                          "phone_number": {
                            "type": "string",
                            "example": "+919876543210"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "page": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "items": [
                        {
                          "id": "phn_abc123",
                          "phone_number": "+14155552671",
                          "provider": "plivo",
                          "status": "active",
                          "country_code": "US",
                          "nickname": "US Sales Line"
                        }
                      ],
                      "total": 1,
                      "page": 1,
                      "limit": 20
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Phone Numbers",
        "tags": [
          "Organization Phone Numbers",
          "Organization Phone Numbers V1",
          "V1"
        ],
        "description": "Returns phone numbers owned by the authenticated workspace with pagination metadata."
      }
    },
    "/v1/organization-phone-numbers/plivo-numbers": {
      "get": {
        "description": "Calls the Plivo API with the given country_iso (required) and type (optional, e.g. 'tollfree', 'local', 'mobile') and returns the available numbers with their capabilities and pricing.",
        "operationId": "OrganizationPhoneNumbersV1Controller_getPlivoNumbers",
        "parameters": [
          {
            "name": "country_iso",
            "required": true,
            "in": "query",
            "description": "ISO country code (e.g., US, GB, CA)",
            "schema": {
              "example": "US",
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Type of number (e.g., tollfree, local, mobile)",
            "schema": {
              "example": "tollfree",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available Plivo numbers returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlivoPhoneNumbersResponseDto"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "api_id": "9f6d7c",
                      "objects": [
                        {
                          "number": "+14155552671",
                          "type": "local",
                          "monthly_rental_rate": "0.80",
                          "setup_rate": "0.00",
                          "voice_enabled": true,
                          "sms_enabled": true,
                          "mms_enabled": false,
                          "country_iso": "US",
                          "number_format": "+14155552671"
                        }
                      ],
                      "meta": {
                        "total_count": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "country_iso is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "country_iso is required",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search Plivo Numbers",
        "tags": [
          "Organization Phone Numbers",
          "Organization Phone Numbers V1",
          "V1"
        ]
      }
    },
    "/v1/organization-phone-numbers/purchase": {
      "post": {
        "description": "Unified endpoint for purchasing a phone number from either Plivo or Twilio. Determines which provider to use from telephonyProviderId (1=Plivo, 2=Twilio), calls that provider's API to purchase the number, then creates a database record associating it with the organization in a single operation. This is the recommended endpoint for purchases, since the single-provider endpoints only call the external API without creating a database record.",
        "operationId": "OrganizationPhoneNumbersV1Controller_purchasePhoneNumber",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchasePhoneNumberRequestDto"
              },
              "examples": {
                "request": {
                  "summary": "Purchase a phone number",
                  "value": {
                    "phoneNumber": "+14155552671",
                    "telephonyProviderId": "plivo_123456",
                    "countryISO": "US"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Phone number purchase initiated and record created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchasePhoneNumberResponseDto"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "phoneNumber": "+1234567890",
                      "status": "active",
                      "message": "string",
                      "organizationPhoneNumber": {
                        "sip_trunk_enabled": false
                      }
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Phone number purchased and registered successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "phoneNumber": "+14155552671",
                      "status": "active",
                      "message": "Phone number purchased and registered successfully",
                      "organizationPhoneNumber": {
                        "id": "phn_abc123",
                        "phone_number": "+14155552671",
                        "provider": "plivo",
                        "status": "active",
                        "country_code": "US",
                        "nickname": "US Sales Line"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or failed to purchase",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "country_iso is required",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Purchase Phone Number",
        "tags": [
          "Organization Phone Numbers",
          "Organization Phone Numbers V1",
          "V1"
        ]
      }
    },
    "/v1/organization-phone-numbers/sip-trunks": {
      "post": {
        "operationId": "OrganizationPhoneNumbersV1Controller_linkSipTrunkV1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkSipTrunkDto"
              },
              "examples": {
                "request": {
                  "summary": "Link a SIP trunk",
                  "value": {
                    "phoneNumber": "+14155552671",
                    "terminationUri": "31974861099010243.zt.plivo.com:5060",
                    "nickname": "US BYOC Line"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "SIP trunk linked successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "phn_abc123",
                      "phone_number": "+14155552671",
                      "provider": "plivo",
                      "status": "active",
                      "country_code": "US",
                      "nickname": "US BYOC Line"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or missing configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "country_iso is required",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Phone number already registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "409 Conflict",
                    "value": {
                      "statusCode": 409,
                      "message": "Phone number already registered",
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Media server trunk registration failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "502 Bad Gateway",
                    "value": {
                      "statusCode": 502,
                      "message": "Media server trunk registration failed",
                      "error": "Bad Gateway"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Link SIP Trunk",
        "tags": [
          "Organization Phone Numbers",
          "Organization Phone Numbers V1",
          "V1"
        ],
        "description": "Registers a bring-your-own number with SIP trunk credentials for workspace routing."
      }
    },
    "/v1/organization-phone-numbers/{id}": {
      "get": {
        "operationId": "OrganizationPhoneNumbersV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Phone number ID",
            "schema": {
              "example": "phn_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Phone number returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "phn_abc123"
                    },
                    "phone_number": {
                      "type": "string",
                      "example": "+919876543210"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "phn_abc123",
                      "phone_number": "+14155552671",
                      "provider": "plivo",
                      "status": "active",
                      "country_code": "US",
                      "nickname": "US Sales Line"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - phone number does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Phone number not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Phone number not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Phone Number Details",
        "tags": [
          "Organization Phone Numbers",
          "Organization Phone Numbers V1",
          "V1"
        ],
        "description": "Returns one workspace phone number and its routing configuration."
      },
      "delete": {
        "description": "Soft-deletes an organization phone number. If the number has an active SIP trunk, tears down the trunk on the media server and removes SIP trunk credentials. Releases the Plivo/Twilio rental and deactivates any associated rental subscriptions. Returns 409 if the number is the organization default or has active workflows using it.",
        "operationId": "OrganizationPhoneNumbersV1Controller_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Phone number ID",
            "schema": {
              "example": "phn_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Phone number deleted successfully."
          },
          "400": {
            "description": "Invalid phone number ID format."
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key."
          },
          "403": {
            "description": "Forbidden - phone number does not belong to your organization."
          },
          "404": {
            "description": "Phone number not found."
          },
          "409": {
            "description": "Conflict - phone number is the organization default or has active workflows."
          },
          "500": {
            "description": "Internal server error."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete Phone Number",
        "tags": [
          "Organization Phone Numbers",
          "Organization Phone Numbers V1",
          "V1"
        ]
      }
    },
    "/v1/transcribers": {
      "get": {
        "operationId": "TranscribersV1Controller_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Transcribers returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Transcriber"
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": [
                      {
                        "id": "trs_deepgram_nova_2",
                        "name": "Deepgram Nova 2",
                        "provider": "deepgram",
                        "supports_fallback": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Transcribers",
        "tags": [
          "Transcribers",
          "Transcribers V1",
          "V1"
        ],
        "description": "Returns the complete catalog of speech-to-text transcribers available for agents."
      }
    },
    "/v1/transcribers/{id}": {
      "get": {
        "operationId": "TranscribersV1Controller_findById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Transcriber ID",
            "schema": {
              "example": "trs_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transcriber returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcriber"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "trs_deepgram_nova_2",
                      "name": "Deepgram Nova 2",
                      "provider": "deepgram",
                      "supports_fallback": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid catalog ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid catalog ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transcriber not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Transcriber not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Transcriber Details",
        "tags": [
          "Transcribers",
          "Transcribers V1",
          "V1"
        ],
        "description": "Returns one speech-to-text transcriber catalog record by ID."
      }
    },
    "/v1/user-webhooks": {
      "get": {
        "description": "Returns paginated webhook registrations. Secrets are masked in all list responses.",
        "operationId": "UserWebhooksV1Controller_findAll",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Results per page (default: 10)",
            "schema": {
              "example": 10,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "example": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhooks returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Webhooks fetched successfully"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "webhook_abc123"
                          },
                          "url": {
                            "type": "string",
                            "example": "https://webhook.site/your-endpoint"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "call.completed"
                            ]
                          },
                          "is_active": {
                            "type": "boolean",
                            "example": true
                          },
                          "secret": {
                            "type": "string",
                            "example": "********",
                            "description": "Always masked in list responses"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "page": {
                      "type": "number",
                      "example": 1
                    },
                    "limit": {
                      "type": "number",
                      "example": 10
                    },
                    "total": {
                      "type": "number",
                      "example": 5
                    },
                    "totalPages": {
                      "type": "number",
                      "example": 1
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "total": 1,
                      "page": 1,
                      "limit": 10,
                      "webhooks": [
                        {
                          "id": "webhook_abc123",
                          "url": "https://example.com/dialnexa/webhook",
                          "events": [
                            "call.completed"
                          ],
                          "is_active": true,
                          "createdAt": "2026-07-03T10:30:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Webhooks",
        "tags": [
          "User Webhooks",
          "User Webhooks V1",
          "V1"
        ]
      },
      "post": {
        "description": "Registers a new webhook URL for your organization. The secret is returned only once at creation - store it securely. For v1 call-ended deliveries, DialNexa sends a plain JSON body and an x-nexa-signature header in the format sha256=<hex> computed with HMAC-SHA256 over the raw request body.",
        "operationId": "UserWebhooksV1Controller_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserWebhookDto"
              },
              "examples": {
                "request": {
                  "summary": "Create a webhook",
                  "value": {
                    "url": "https://example.com/dialnexa/webhook",
                    "events": [
                      "call.completed"
                    ],
                    "is_active": true,
                    "secret": "replace-with-a-long-random-secret"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Webhook created successfully"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "webhook_abc123"
                        },
                        "url": {
                          "type": "string",
                          "example": "https://webhook.site/your-endpoint"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "call.completed",
                            "call.failed"
                          ]
                        },
                        "is_active": {
                          "type": "boolean",
                          "example": true
                        },
                        "secret": {
                          "type": "string",
                          "example": "mySuperSecret",
                          "description": "Shown once at creation only"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "webhook_abc123",
                      "url": "https://example.com/dialnexa/webhook",
                      "events": [
                        "call.completed"
                      ],
                      "is_active": true,
                      "createdAt": "2026-07-03T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required fields or invalid URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "url must be a valid URL",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Webhook",
        "tags": [
          "User Webhooks",
          "User Webhooks V1",
          "V1"
        ]
      }
    },
    "/v1/user-webhooks/{id}": {
      "delete": {
        "description": "Soft-deletes the webhook. Events will stop being delivered immediately.",
        "operationId": "UserWebhooksV1Controller_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID",
            "schema": {
              "example": "webhook_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Webhook deleted successfully"
                    },
                    "id": {
                      "type": "string",
                      "example": "webhook_abc123"
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "success": true,
                      "message": "Webhook deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Webhook not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete Webhook",
        "tags": [
          "User Webhooks",
          "User Webhooks V1",
          "V1"
        ]
      },
      "get": {
        "operationId": "UserWebhooksV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID",
            "schema": {
              "example": "webhook_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Webhook fetched successfully"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "webhook_abc123"
                        },
                        "url": {
                          "type": "string",
                          "example": "https://webhook.site/your-endpoint"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "call.completed"
                          ]
                        },
                        "is_active": {
                          "type": "boolean",
                          "example": true
                        },
                        "secret": {
                          "type": "string",
                          "example": "********"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "webhook_abc123",
                      "url": "https://example.com/dialnexa/webhook",
                      "events": [
                        "call.completed"
                      ],
                      "is_active": true,
                      "createdAt": "2026-07-03T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Webhook not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Webhook Details",
        "tags": [
          "User Webhooks",
          "User Webhooks V1",
          "V1"
        ],
        "description": "Returns one webhook registration; its signing secret is masked after creation."
      },
      "patch": {
        "description": "Update URL, events, or active status. Partial updates supported.",
        "operationId": "UserWebhooksV1Controller_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID",
            "schema": {
              "example": "webhook_abc123",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserWebhookDto"
              },
              "examples": {
                "request": {
                  "summary": "Update a webhook",
                  "value": {
                    "is_active": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Webhook updated successfully"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "webhook_abc123"
                        },
                        "url": {
                          "type": "string",
                          "example": "https://webhook.site/new-endpoint"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "call.completed"
                          ]
                        },
                        "is_active": {
                          "type": "boolean",
                          "example": false
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "webhook_abc123",
                      "url": "https://example.com/dialnexa/webhook",
                      "events": [
                        "call.completed"
                      ],
                      "is_active": false,
                      "createdAt": "2026-07-03T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "url must be a valid URL",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Webhook not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update Webhook",
        "tags": [
          "User Webhooks",
          "User Webhooks V1",
          "V1"
        ]
      }
    },
    "/v1/voices": {
      "get": {
        "description": "Returns all available voices with optional filtering by provider, accent, gender, or name.",
        "operationId": "VoicesV1Controller_findAll",
        "parameters": [
          {
            "name": "provider",
            "required": false,
            "in": "query",
            "description": "Filter by TTS provider",
            "schema": {
              "enum": [
                "elevenlabs",
                "smallestai",
                "sarvam",
                "cartesia"
              ],
              "type": "string"
            }
          },
          {
            "name": "accent",
            "required": false,
            "in": "query",
            "description": "Accent of the voice",
            "schema": {
              "enum": [
                "indian",
                "british",
                "american",
                "canadian",
                "african",
                "australian",
                "swedish"
              ],
              "type": "string"
            }
          },
          {
            "name": "gender",
            "required": false,
            "in": "query",
            "description": "Gender of the voice",
            "schema": {
              "enum": [
                "male",
                "female",
                "non-binary"
              ],
              "type": "string"
            }
          },
          {
            "name": "name",
            "required": false,
            "in": "query",
            "description": "Search by voice name",
            "schema": {
              "example": "English",
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "default": "1",
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Max 50",
            "schema": {
              "default": "20",
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "language_id",
            "required": false,
            "in": "query",
            "description": "Filter voices that support a specific language ID",
            "schema": {
              "example": "abc12345678901",
              "type": "string"
            }
          },
          {
            "name": "llm_id",
            "required": false,
            "in": "query",
            "description": "Filter voices compatible with a specific LLM ID (S2S models only)",
            "schema": {
              "example": "abc12345678901",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Voices returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "voices": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "page": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "totalPages": {
                      "type": "number"
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "voices": [
                        {
                          "id": "voice_abc123",
                          "name": "Aditi",
                          "provider": "elevenlabs",
                          "language_code": "en-IN",
                          "gender": "female"
                        }
                      ],
                      "total": 1,
                      "page": 1,
                      "limit": 20,
                      "totalPages": 1
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Voices",
        "tags": [
          "Voices",
          "Voices V1",
          "V1"
        ]
      }
    },
    "/v1/voices/accents": {
      "get": {
        "description": "Returns the distinct accent values across all available voices, optionally filtered by provider.",
        "operationId": "VoicesV1Controller_getUniqueAccents",
        "parameters": [
          {
            "name": "provider",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "elevenlabs",
                "smallestai",
                "sarvam",
                "cartesia"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Voice accents returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "example": "indian"
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": [
                      "indian",
                      "american",
                      "british"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Voice Accents",
        "tags": [
          "Voices",
          "Voices V1",
          "V1"
        ]
      }
    },
    "/v1/voices/s2s": {
      "get": {
        "description": "Returns voices that support speech-to-speech mode, along with their compatible languages and LLMs.",
        "operationId": "VoicesV1Controller_findAllS2SVoices",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Speech to speech voices returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/S2SVoicesResponseDto"
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "voices": [
                        {
                          "id": "voice_s2s_abc123",
                          "name": "Realtime Voice",
                          "provider": "openai",
                          "type": "speech_to_speech",
                          "provider_voice_id": "ash",
                          "gender": "neutral",
                          "accent": null,
                          "icon": null,
                          "recording": null,
                          "languages": [],
                          "llms": []
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Speech To Speech Voices",
        "tags": [
          "Voices",
          "Voices V1",
          "V1"
        ]
      }
    },
    "/v1/voices/{id}": {
      "get": {
        "operationId": "VoicesV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Voice ID",
            "schema": {
              "example": "voice_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Voice returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "voice_abc123"
                    },
                    "name": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "gender": {
                      "type": "string"
                    },
                    "accent": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "voice_abc123",
                      "name": "Aditi",
                      "provider": "elevenlabs",
                      "language_code": "en-IN",
                      "gender": "female",
                      "preview_url": "https://example.com/preview.mp3"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid catalog ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid catalog ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Voice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Voice not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Voice Details",
        "tags": [
          "Voices",
          "Voices V1",
          "V1"
        ],
        "description": "Returns one voice catalog record by ID."
      }
    },
    "/v1/voices/{id}/languages": {
      "get": {
        "operationId": "VoicesV1Controller_getVoiceLanguages",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Voice ID",
            "schema": {
              "example": "voice_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Voice languages returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "lang_abc123"
                      },
                      "code": {
                        "type": "string",
                        "example": "en"
                      },
                      "name": {
                        "type": "string",
                        "example": "English"
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": [
                      {
                        "id": "lang_en_in",
                        "name": "English (India)",
                        "code": "en-IN"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid catalog ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid catalog ID format",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Voice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Voice not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Voice Language Details",
        "tags": [
          "Voices",
          "Voices V1",
          "V1"
        ],
        "description": "Returns the languages supported by one voice."
      }
    },
    "/v1/workflows": {
      "get": {
        "operationId": "WorkflowsV1Controller_findAll",
        "parameters": [
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ASC",
                "DESC"
              ],
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "schema": {
              "example": "createdAt",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "example": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflows fetched successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "Workflows fetched successfully"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "workflow_abc123"
                          },
                          "title": {
                            "type": "string",
                            "example": "Q3 Outreach Workflow"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "active",
                              "paused",
                              "completed",
                              "cancelled"
                            ],
                            "example": "active"
                          },
                          "description": {
                            "type": "string",
                            "nullable": true,
                            "example": "Automated follow-up sequence"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "number",
                          "example": 50
                        },
                        "itemsPerPage": {
                          "type": "number",
                          "example": 20
                        },
                        "totalPages": {
                          "type": "number",
                          "example": 3
                        },
                        "currentPage": {
                          "type": "number",
                          "example": 1
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Workflows fetched successfully",
                      "data": [
                        {
                          "id": "workflow_abc123",
                          "title": "Q3 Outreach Workflow",
                          "status": "active",
                          "description": "Automated follow-up sequence",
                          "createdAt": "2026-07-03T10:30:00.000Z",
                          "updatedAt": "2026-07-03T10:45:00.000Z"
                        }
                      ],
                      "meta": {
                        "totalItems": 1,
                        "itemsPerPage": 20,
                        "totalPages": 1,
                        "currentPage": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Workflow validation failed",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Workflows",
        "tags": [
          "Workflows V1",
          "V1"
        ],
        "description": "Returns workflows for the authenticated workspace in a data and meta pagination envelope."
      }
    },
    "/v1/workflows/{id}": {
      "get": {
        "operationId": "WorkflowsV1Controller_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow fetched successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "Workflow fetched successfully"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "workflow_abc123"
                        },
                        "title": {
                          "type": "string",
                          "example": "Q3 Outreach Workflow"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "active",
                            "paused",
                            "completed",
                            "cancelled"
                          ],
                          "example": "active"
                        },
                        "description": {
                          "type": "string",
                          "nullable": true,
                          "example": "Automated follow-up sequence"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Workflow fetched successfully",
                      "data": {
                        "id": "workflow_abc123",
                        "title": "Q3 Outreach Workflow",
                        "status": "active",
                        "description": "Automated follow-up sequence",
                        "createdAt": "2026-07-03T10:30:00.000Z",
                        "updatedAt": "2026-07-03T10:45:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid workflow ID format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Workflow validation failed",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Workflow Details",
        "tags": [
          "Workflows V1",
          "V1"
        ],
        "description": "Returns one workflow and its current lifecycle state."
      }
    },
    "/v1/workflows/{workflowId}/leads": {
      "get": {
        "operationId": "WorkflowLeadsV1Controller_findAll",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          },
          {
            "name": "leadIds",
            "required": false,
            "in": "query",
            "description": "Comma-separated lead IDs to filter",
            "schema": {
              "example": "id1,id2",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Leads returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "Leads fetched successfully"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "lead_abc123"
                          },
                          "phone_number": {
                            "type": "string",
                            "example": "+919876543210"
                          },
                          "dynamic_variables": {
                            "type": "object",
                            "example": {
                              "name": "John",
                              "company": "Acme"
                            }
                          },
                          "status": {
                            "type": "string",
                            "example": "pending"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number",
                      "example": 42
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Leads fetched successfully",
                      "data": [
                        {
                          "id": "lead_abc123",
                          "phone_number": "+919876543210",
                          "dynamic_variables": {
                            "customer_name": "Priya Sharma",
                            "loan_amount": "500000"
                          },
                          "status": "pending",
                          "createdAt": "2026-07-03T10:30:00.000Z"
                        }
                      ],
                      "count": 1
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - workflow does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this workflow",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Workflow Leads",
        "tags": [
          "Workflow Leads V1",
          "V1"
        ],
        "description": "Returns leads enrolled in one workflow."
      },
      "post": {
        "operationId": "WorkflowLeadsV1Controller_uploadFile",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV or Excel file with leads data"
                  }
                }
              },
              "examples": {
                "request": {
                  "summary": "Upload workflow leads file",
                  "value": {
                    "file": "workflow-leads.csv"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File processed successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 201,
                      "message": "Leads uploaded successfully",
                      "data": {
                        "+919876543210": [
                          "lead_abc123"
                        ]
                      },
                      "count": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "File must be a CSV or Excel file (.csv, .xlsx, .xls)",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - workflow does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this workflow",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload Workflow Leads",
        "tags": [
          "Workflow Leads V1",
          "V1"
        ],
        "description": "Uploads and enrolls leads in one workflow from a supported file."
      }
    },
    "/v1/workflows/{workflowId}/leads/variable-keys": {
      "get": {
        "operationId": "WorkflowLeadsV1Controller_getVariableKeys",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Variable keys returned successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Variable keys fetched successfully",
                      "data": {
                        "keys": [
                          "customer_name",
                          "loan_amount",
                          "product"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - workflow does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this workflow",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Workflow Lead Variables",
        "tags": [
          "Workflow Leads V1",
          "V1"
        ],
        "description": "Returns dynamic variable keys discovered across leads in one workflow."
      }
    },
    "/v1/workflows/{workflowId}/leads/{id}": {
      "delete": {
        "operationId": "WorkflowLeadsV1Controller_softDelete",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Lead ID",
            "schema": {
              "example": "lead_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead soft-deleted successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Lead soft-deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - workflow does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this workflow",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lead not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow lead not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete Workflow Lead",
        "tags": [
          "Workflow Leads V1",
          "V1"
        ],
        "description": "Soft deletes one lead from a workflow."
      }
    },
    "/v1/workflows/{workflowId}/leads/{id}/history": {
      "get": {
        "operationId": "WorkflowLeadsV1Controller_getLeadHistory",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Lead ID",
            "schema": {
              "example": "lead_abc123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead execution history returned successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Lead history fetched successfully",
                      "data": {
                        "lead": {
                          "id": "lead_abc123",
                          "phone_number": "+919876543210",
                          "dynamic_variables": {
                            "customer_name": "Priya Sharma",
                            "loan_amount": "500000"
                          },
                          "status": "pending",
                          "createdAt": "2026-07-03T10:30:00.000Z"
                        },
                        "history": [
                          {
                            "node_id": "node_start",
                            "node_type": "VOICE_CALL",
                            "label": "Initial call",
                            "status": "completed",
                            "call_id": "call_abc123",
                            "started_at": "2026-07-03T10:30:00.000Z",
                            "ended_at": "2026-07-03T10:32:00.000Z"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - workflow does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this workflow",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lead not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow lead not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Lead Execution History",
        "tags": [
          "Workflow Leads V1",
          "V1"
        ],
        "description": "Returns node-by-node execution history for one workflow lead."
      }
    },
    "/voices": {
      "get": {
        "operationId": "VoicesController_findAll",
        "parameters": [
          {
            "name": "provider",
            "required": false,
            "in": "query",
            "description": "Filter by provider name",
            "schema": {
              "enum": [
                "elevenlabs",
                "smallestai",
                "sarvam",
                "cartesia"
              ],
              "type": "string"
            }
          },
          {
            "name": "accent",
            "required": false,
            "in": "query",
            "description": "Filter by accent",
            "schema": {
              "enum": [
                "indian",
                "british",
                "american",
                "canadian",
                "african",
                "australian",
                "swedish"
              ],
              "type": "string"
            }
          },
          {
            "name": "gender",
            "required": false,
            "in": "query",
            "description": "Filter by gender",
            "schema": {
              "enum": [
                "male",
                "female",
                "non-binary"
              ],
              "type": "string"
            }
          },
          {
            "name": "name",
            "required": false,
            "in": "query",
            "description": "Search by voice name",
            "schema": {
              "example": "English",
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number (starts from 1)",
            "schema": {
              "default": "1",
              "example": "1",
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of records per page (default: 20, max: 50)",
            "schema": {
              "default": "20",
              "example": "20",
              "type": "number"
            }
          },
          {
            "name": "language_id",
            "required": false,
            "in": "query",
            "description": "Filter voices that support a specific language ID",
            "schema": {
              "example": "abc12345678901",
              "type": "string"
            }
          },
          {
            "name": "llm_id",
            "required": false,
            "in": "query",
            "description": "Filter voices compatible with a specific LLM ID (S2S models only)",
            "schema": {
              "example": "abc12345678901",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return voices with optional filtering and pagination",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "voices": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "page": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "totalPages": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter parameters"
          }
        },
        "summary": "Get all voices with optional filtering and pagination",
        "tags": [
          "Voices"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/voices/accents": {
      "get": {
        "operationId": "VoicesController_getUniqueAccents",
        "parameters": [
          {
            "name": "provider",
            "required": false,
            "in": "query",
            "description": "Filter by provider name",
            "schema": {
              "enum": [
                "elevenlabs",
                "smallestai",
                "sarvam",
                "cartesia"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return all unique accents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "summary": "Get all unique accents from voices",
        "tags": [
          "Voices"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/voices/s2s": {
      "get": {
        "operationId": "VoicesController_findAllS2SVoices",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Returns all S2S voices with their supported languages and LLMs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/S2SVoicesResponseDto"
                }
              }
            }
          }
        },
        "summary": "Get all S2S voices with supported languages and LLMs",
        "tags": [
          "Voices"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/voices/{id}": {
      "get": {
        "operationId": "VoicesController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return the voice."
          },
          "404": {
            "description": "Voice not found."
          }
        },
        "summary": "Get a specific voice by ID",
        "tags": [
          "Voices"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/voices/{id}/languages": {
      "get": {
        "operationId": "VoicesController_getVoiceLanguages",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns all languages supported by the specified voice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "lang_id_1"
                      },
                      "code": {
                        "type": "string",
                        "example": "en"
                      },
                      "name": {
                        "type": "string",
                        "example": "English"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Voice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get all languages supported by a specific voice",
        "tags": [
          "Voices"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/voices/{id}/voice-models": {
      "get": {
        "operationId": "VoicesController_getAllVoiceModels",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns all voice models linked to the specified voice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VoiceModelVoice"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Voice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get all voice models associated with a specific voice",
        "tags": [
          "Voices"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/webcall": {
      "post": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nCreates a new webcall session by creating a call log entry and processing it to initiate the actual call. Requires a valid API key in the X-API-Key header belonging to the organization making the request. If agent_version_number is provided, that specific version is used (webcalls allow unpublished versions, unlike regular outbound calls); otherwise the latest published version of the agent is used. Organization, agent, and phone number are validated before the session is created. A call log entry with type 'web' is created and processed through the outbound call processor with isWebCall=true, which updates the call's status from 'created' to 'initiated' on success. Returns session_id (the call log ID) for webcall tracking.",
        "operationId": "WebcallController_createWebcall",
        "parameters": [
          {
            "name": "X-API-Key",
            "in": "header",
            "description": "API key for authentication (alternative to JWT token)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebcallDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webcall session created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebcallResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - validation error (invalid phone number, agent_id, or metadata format)"
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key"
          },
          "404": {
            "description": "Not found - organization, agent, or agent version not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Create and initiate a webcall session",
        "tags": [
          "Webcall"
        ],
        "deprecated": true
      }
    },
    "/webcall/{callId}/terminate": {
      "post": {
        "operationId": "WebcallController_terminateWebcallV1",
        "parameters": [
          {
            "name": "callId",
            "required": true,
            "in": "path",
            "description": "Call ID of the webcall session to terminate",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "description": "API key for authentication",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TerminateWebcallRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webcall session terminated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminateWebcallResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Terminate an active webcall session by call ID (V1 alias)",
        "tags": [
          "Webcall"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows": {
      "get": {
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. \n\nReturns a paginated list of workflows. Defaults to page 1, limit 10 when no params are supplied.",
        "operationId": "WorkflowsController_findAll",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflows fetched successfully"
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "List workflows with pagination",
        "tags": [
          "Workflows"
        ],
        "deprecated": true
      },
      "post": {
        "operationId": "WorkflowsController_create",
        "parameters": [
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Workflow created successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a new workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}": {
      "patch": {
        "operationId": "WorkflowsController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workflow updated successfully"
          },
          "404": {
            "description": "Workflow not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Update a workflow by ID",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "get": {
        "operationId": "WorkflowsController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow fetched successfully"
          },
          "404": {
            "description": "Workflow not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a single workflow by ID",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "WorkflowsController_softDelete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow soft-deleted successfully"
          },
          "404": {
            "description": "Workflow not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Soft-delete a workflow by ID",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/activate": {
      "post": {
        "operationId": "WorkflowsController_activateWorkflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow activated successfully"
          },
          "400": {
            "description": "Bad Request - Invalid workflow status or validation failed"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "summary": "Activate a workflow and start execution for all leads",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/cancel": {
      "post": {
        "operationId": "WorkflowsController_cancelWorkflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow cancelled successfully"
          },
          "400": {
            "description": "Bad Request - Invalid workflow status"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "summary": "Cancel a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/duplicate": {
      "post": {
        "operationId": "WorkflowsController_duplicate",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Workflow duplicated successfully"
          },
          "404": {
            "description": "Workflow not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "summary": "Duplicate a workflow by ID",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/edges": {
      "get": {
        "operationId": "WorkflowsController_getEdges",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Edges fetched successfully"
          }
        },
        "summary": "Get all edges in a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "WorkflowsController_createEdge",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEdgeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Edge created successfully"
          }
        },
        "summary": "Create an edge in a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/edges/{edgeId}": {
      "delete": {
        "operationId": "WorkflowsController_deleteEdge",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "edgeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Edge deleted successfully"
          }
        },
        "summary": "Delete an edge from a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/nodes": {
      "get": {
        "operationId": "WorkflowsController_getNodes",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Nodes fetched successfully"
          }
        },
        "summary": "Get all nodes in a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "WorkflowsController_createNode",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNodeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Node created successfully"
          }
        },
        "summary": "Create a node in a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/nodes/{nodeId}": {
      "patch": {
        "operationId": "WorkflowsController_updateNode",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Node updated successfully"
          }
        },
        "summary": "Update a node in a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "delete": {
        "operationId": "WorkflowsController_deleteNode",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nodeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Node deleted successfully"
          }
        },
        "summary": "Delete a node from a workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/pause": {
      "post": {
        "operationId": "WorkflowsController_pauseWorkflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow paused successfully"
          },
          "400": {
            "description": "Bad Request - Invalid workflow status"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "summary": "Pause a running workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{id}/resume": {
      "post": {
        "operationId": "WorkflowsController_resumeWorkflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow resumed successfully"
          },
          "400": {
            "description": "Bad Request - Invalid workflow status"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "summary": "Resume a paused workflow",
        "tags": [
          "Workflows"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{workflowId}/leads": {
      "get": {
        "operationId": "WorkflowLeadsController_findAll",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "leadIds",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of leads"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get all leads for a specific workflow",
        "tags": [
          "Workflow Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      },
      "post": {
        "operationId": "WorkflowLeadsController_uploadFile",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV or Excel file with leads data"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File processed successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Upload CSV or Excel file with leads data",
        "tags": [
          "Workflow Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{workflowId}/leads/variable-keys": {
      "get": {
        "operationId": "WorkflowLeadsController_getVariableKeys",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of variable keys"
          }
        },
        "summary": "Get distinct dynamic variable keys from workflow leads (CSV columns)",
        "tags": [
          "Workflow Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{workflowId}/leads/{id}": {
      "delete": {
        "operationId": "WorkflowLeadsController_softDelete",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead soft deleted successfully"
          },
          "404": {
            "description": "Lead not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Soft delete a lead (mark as deleted)",
        "tags": [
          "Workflow Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/workflows/{workflowId}/leads/{id}/history": {
      "get": {
        "operationId": "WorkflowLeadsController_getLeadHistory",
        "parameters": [
          {
            "name": "workflowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-organization-id",
            "in": "header",
            "description": "RSA encrypted organization ID (base64 format)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BASE64_ENCRYPTED_ORG_ID_HERE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead history fetched successfully"
          },
          "404": {
            "description": "Lead not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get lead history with node details",
        "tags": [
          "Workflow Leads"
        ],
        "deprecated": true,
        "description": "**Legacy endpoint - deprecated, scheduled for removal on July 31, 2026.** Use the `/v1` version for new integrations. "
      }
    },
    "/v1/batch-calls/{id}/status": {
      "patch": {
        "operationId": "BatchCallsV1Controller_updateStatus",
        "summary": "Update Batch Call Status",
        "description": "Changes the execution status of a batch call. Use `pause` to halt new outbound calls, `resume` to continue a paused batch, or `cancel` to permanently stop the batch and remove queued calls.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Batch call ID",
            "schema": {
              "example": "batch_abc123",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "pause",
                      "resume",
                      "cancel"
                    ],
                    "example": "pause",
                    "description": "The status transition to apply."
                  }
                }
              },
              "examples": {
                "pause": {
                  "summary": "Pause a batch call",
                  "value": {
                    "action": "pause"
                  }
                },
                "resume": {
                  "summary": "Resume a batch call",
                  "value": {
                    "action": "resume"
                  }
                },
                "cancel": {
                  "summary": "Cancel a batch call",
                  "value": {
                    "action": "cancel"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch call status updated successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "success": true,
                      "message": "Campaign paused successfully",
                      "campaign": {
                        "id": "batch_abc123",
                        "status": "paused",
                        "title": "Q3 Follow-up Batch"
                      },
                      "affectedCalls": {
                        "initiated": 0,
                        "queued": 0,
                        "removedFromQueue": 12,
                        "cancelledCallLogs": 0,
                        "resumedCallLogs": 0
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Campaign paused successfully"
                    },
                    "campaign": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "batch_abc123"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "initiated",
                            "draft",
                            "waiting",
                            "scheduled",
                            "running",
                            "paused",
                            "completed",
                            "cancelled",
                            "deleted"
                          ],
                          "example": "paused"
                        },
                        "title": {
                          "type": "string",
                          "example": "Q3 Follow-up Batch"
                        }
                      }
                    },
                    "affectedCalls": {
                      "type": "object",
                      "properties": {
                        "initiated": {
                          "type": "number",
                          "example": 0
                        },
                        "queued": {
                          "type": "number",
                          "example": 0
                        },
                        "removedFromQueue": {
                          "type": "number",
                          "example": 12
                        },
                        "cancelledCallLogs": {
                          "type": "number",
                          "example": 0
                        },
                        "resumedCallLogs": {
                          "type": "number",
                          "example": 0
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid action, or action not allowed for the current batch call status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid action. Must be one of: pause, resume, cancel",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - batch call does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Batch call not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Batch call not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "Batch Calls V1",
          "V1"
        ]
      }
    },
    "/v1/workflows/{id}/status": {
      "patch": {
        "operationId": "WorkflowsV1Controller_updateStatus",
        "summary": "Update Workflow Status",
        "description": "Changes a workflow status. Use `activate` to start execution for all leads, `deactivate` to pause a currently active workflow, `pause` to pause a running workflow, or `resume` to continue a paused workflow.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Workflow ID",
            "schema": {
              "example": "workflow_abc123",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "activate",
                      "deactivate",
                      "pause",
                      "resume"
                    ],
                    "example": "activate",
                    "description": "The workflow status transition to apply."
                  }
                }
              },
              "examples": {
                "activate": {
                  "summary": "Activate a workflow",
                  "value": {
                    "action": "activate"
                  }
                },
                "deactivate": {
                  "summary": "Deactivate a workflow",
                  "value": {
                    "action": "deactivate"
                  }
                },
                "pause": {
                  "summary": "Pause a workflow",
                  "value": {
                    "action": "pause"
                  }
                },
                "resume": {
                  "summary": "Resume a workflow",
                  "value": {
                    "action": "resume"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workflow status updated successfully.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Successful response",
                    "value": {
                      "statusCode": 200,
                      "message": "Workflow activated successfully",
                      "data": {
                        "id": "workflow_abc123",
                        "title": "Q3 Outreach Workflow",
                        "status": "active",
                        "description": "Automated follow-up sequence",
                        "createdAt": "2026-07-03T10:30:00.000Z",
                        "updatedAt": "2026-07-03T10:45:00.000Z"
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "Workflow activated successfully"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "workflow_abc123"
                        },
                        "title": {
                          "type": "string",
                          "example": "Q3 Outreach Workflow"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "active",
                            "paused",
                            "completed",
                            "cancelled"
                          ],
                          "example": "active"
                        },
                        "description": {
                          "type": "string",
                          "nullable": true,
                          "example": "Automated follow-up sequence"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid action, invalid workflow status, or workflow validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "400 Bad Request",
                    "value": {
                      "statusCode": 400,
                      "message": "Invalid action. Must be one of: activate, deactivate, pause, resume",
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "401 Unauthorized",
                    "value": {
                      "statusCode": 401,
                      "message": "API key is missing or invalid",
                      "error": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - workflow does not belong to your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "403 Forbidden",
                    "value": {
                      "statusCode": 403,
                      "message": "You do not have permission to access this resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "404 Not Found",
                    "value": {
                      "statusCode": 404,
                      "message": "Workflow not found",
                      "error": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "summary": "500 Internal Server Error",
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error",
                      "error": "Internal Server Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "Workflows V1",
          "V1"
        ]
      }
    },
    "/v1/transcribers/fallback": {
      "get": {
        "description": "Returns all transcribers eligible for use as a fallback STT provider. Use this list to populate the Fallback STT selector when configuring per-agent STT fallback settings.",
        "operationId": "TranscribersV1Controller_findFallbacks",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Fallback-eligible transcribers returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "trs_tr0deepnova3xx"
                      },
                      "name": {
                        "type": "string",
                        "example": "Deepgram Nova 2"
                      },
                      "provider": {
                        "type": "string",
                        "example": "deepgram"
                      },
                      "model_id": {
                        "type": "string",
                        "example": "nova-2"
                      },
                      "description": {
                        "type": "string",
                        "nullable": true
                      },
                      "supported_language_codes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "nullable": true,
                        "example": null,
                        "description": "null means all languages supported"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key."
          },
          "403": {
            "description": "Forbidden - API key does not have access to this organization."
          },
          "500": {
            "description": "Internal server error."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Fallback Transcribers",
        "tags": [
          "Transcribers",
          "Transcribers V1",
          "V1"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "Agents": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "agent_2g7Xy3tY53gRlp",
            "description": "Signed agent ID"
          },
          "folder_id": {
            "type": "string",
            "nullable": true
          },
          "current_version_number": {
            "type": "integer",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          },
          "agent_type": {
            "type": "string",
            "enum": [
              "Single_Prompt_Agent",
              "Conversational_Flow_Agent"
            ]
          },
          "pipeline_type": {
            "type": "string",
            "enum": [
              "Cascaded",
              "Speech_To_Speech"
            ],
            "nullable": true
          },
          "webhook_id": {
            "type": "string",
            "nullable": true
          },
          "current_version": {
            "type": "object",
            "properties": {
              "agent_id": {
                "type": "string"
              },
              "version_number": {
                "type": "integer"
              },
              "version_title": {
                "type": "string",
                "nullable": true
              },
              "title": {
                "type": "string",
                "nullable": true
              },
              "is_published": {
                "type": "boolean"
              },
              "language_id": {
                "type": "string",
                "nullable": true
              },
              "voice_id": {
                "type": "string",
                "nullable": true
              },
              "llm_id": {
                "type": "string",
                "nullable": true
              },
              "transcriber_id": {
                "type": "string",
                "nullable": true
              },
              "fallback_stt_enabled": {
                "type": "boolean"
              },
              "stt_fallback_transcriber_id": {
                "type": "string",
                "nullable": true
              },
              "post_call_analysis_llm_id": {
                "type": "string",
                "nullable": true
              }
            },
            "nullable": true
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "agent_id": {
                  "type": "string"
                },
                "version_number": {
                  "type": "integer"
                },
                "version_title": {
                  "type": "string",
                  "nullable": true
                },
                "title": {
                  "type": "string",
                  "nullable": true
                },
                "is_published": {
                  "type": "boolean"
                },
                "language_id": {
                  "type": "string",
                  "nullable": true
                },
                "voice_id": {
                  "type": "string",
                  "nullable": true
                },
                "llm_id": {
                  "type": "string",
                  "nullable": true
                },
                "transcriber_id": {
                  "type": "string",
                  "nullable": true
                },
                "fallback_stt_enabled": {
                  "type": "boolean"
                },
                "stt_fallback_transcriber_id": {
                  "type": "string",
                  "nullable": true
                },
                "post_call_analysis_llm_id": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "agent_type"
        ]
      },
      "Agents2AnalysisDto": {
        "type": "object",
        "properties": {
          "postcall_analysis": {
            "description": "Post-call analysis fields to create on the agent version",
            "example": [
              {
                "field_name": "customer_satisfaction",
                "field_type": "NUMBER",
                "field_description": "Customer satisfaction rating"
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agents2PostCallAnalysisItemDto"
            }
          }
        }
      },
      "Agents2LlmDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Primary LLM id (llms.id)",
            "example": "llm_xxxxx"
          },
          "settings": {
            "$ref": "#/components/schemas/Agents2LlmSettingsDto"
          },
          "fallback": {
            "$ref": "#/components/schemas/Agents2LlmFallbackDto"
          }
        }
      },
      "Agents2LlmFallbackDto": {
        "type": "object",
        "properties": {
          "fallback_llm_enabled": {
            "type": "boolean",
            "description": "Enable fallback LLM for this agent version",
            "example": false
          },
          "llm_fallback_model": {
            "type": "string",
            "description": "ID (llms.id) of the LLM to use as fallback",
            "example": "abc123xyz789ab",
            "nullable": true
          },
          "fall_back_llm_id": {
            "type": "string",
            "description": "Alias for llm_fallback_model (llms.id); llm_ prefix is stripped",
            "example": "llm_abc123xyz789ab",
            "nullable": true
          },
          "llm_fallback_delay_ms": {
            "type": "number",
            "description": "Milliseconds to wait before triggering the fallback LLM",
            "example": 500,
            "nullable": true
          }
        }
      },
      "Agents2LlmSettingsDto": {
        "type": "object",
        "properties": {
          "temperature": {
            "type": "number",
            "description": "LLM temperature (0.0 to 2.0)",
            "example": 0.1
          },
          "structured_output": {
            "type": "boolean",
            "description": "Enable structured JSON output",
            "example": true
          }
        }
      },
      "Agents2PostCallAnalysisItemDto": {
        "type": "object",
        "properties": {
          "field_name": {
            "type": "string",
            "example": "customer_satisfaction",
            "description": "Name of the PCA field"
          },
          "field_description": {
            "type": "string",
            "example": "Customer satisfaction rating from 1 to 5",
            "description": "Description of the PCA field"
          },
          "field_type": {
            "type": "string",
            "example": "NUMBER",
            "description": "Type of the PCA field",
            "enum": [
              "TEXT",
              "SELECTOR",
              "BOOLEAN",
              "NUMBER"
            ]
          },
          "additional_fields": {
            "example": [
              "positive",
              "neutral",
              "negative"
            ],
            "description": "Selector choices (required for SELECTOR type)",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "field_name",
          "field_type"
        ]
      },
      "Agents2VersionResponseDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "number",
            "example": 0
          },
          "is_published": {
            "type": "boolean",
            "example": false
          },
          "llm": {
            "$ref": "#/components/schemas/Agents2LlmDto"
          },
          "fallback_llm_enabled": {
            "type": "boolean",
            "example": false
          },
          "llm_fallback_model": {
            "type": "string",
            "example": "llm_abc123xyz789ab",
            "nullable": true
          },
          "fall_back_llm_id": {
            "type": "string",
            "example": "llm_abc123xyz789ab",
            "nullable": true
          },
          "llm_fallback_delay_ms": {
            "type": "number",
            "example": 500,
            "nullable": true
          },
          "transcriber_id": {
            "type": "string",
            "example": "tr0deepnova3xx",
            "nullable": true
          },
          "analysis": {
            "$ref": "#/components/schemas/Agents2AnalysisDto"
          }
        },
        "required": [
          "number",
          "is_published"
        ]
      },
      "AssignDefaultPhoneNumberDto": {
        "type": "object",
        "properties": {
          "telephonyProviderId": {
            "type": "string",
            "example": "prov_123456789012",
            "description": "ID of the telephony provider (14 character string)"
          },
          "countryCode": {
            "type": "string",
            "example": "US",
            "description": "2-letter country  code determining which default number to assign"
          }
        },
        "required": [
          "telephonyProviderId",
          "countryCode"
        ]
      },
      "CallLogs": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "call_abc123",
            "description": "Signed call ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "CampaignLead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "lead_abc123",
            "description": "Signed lead ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "CreateAgentDto": {
        "type": "object",
        "properties": {
          "voicemail_detection": {
            "type": "boolean",
            "description": "Indicates whether voicemail detection is enabled",
            "default": true,
            "example": true
          },
          "hangup_on_voicemail": {
            "type": "boolean",
            "description": "Hang up immediately when voicemail is detected instead of leaving a message",
            "default": false,
            "example": false
          },
          "voicemail_message": {
            "type": "string",
            "description": "Message played when voicemail is detected (only used when hangup_on_voicemail is false)",
            "example": "Hi, please call us back at your convenience.",
            "default": "Please leave a message after the beep."
          },
          "listen_for_keypad": {
            "type": "boolean",
            "description": "Whether the agent listens for keypad (DTMF) input from the caller",
            "example": true,
            "default": true
          },
          "keypad_timeout_sec": {
            "type": "number",
            "description": "Seconds to wait for keypad input before timing out (0-15)",
            "example": 5,
            "default": 5,
            "minimum": 0,
            "maximum": 15
          },
          "termination_key": {
            "type": "string",
            "description": "Single character key that ends the call (digits, * or #)",
            "example": "#",
            "default": "#"
          },
          "digit_limit": {
            "type": "number",
            "description": "Maximum number of DTMF digits to collect from the caller (1-50)",
            "example": 1,
            "default": 1,
            "minimum": 1,
            "maximum": 50
          },
          "end_call_on_silence_sec": {
            "type": "number",
            "description": "Seconds of silence after which the call is automatically ended (0-1800)",
            "example": 180,
            "default": 180,
            "minimum": 0,
            "maximum": 1800
          },
          "max_call_duration_sec": {
            "type": "number",
            "description": "Maximum call duration in seconds before the call is forcibly ended",
            "example": 600,
            "default": 600,
            "minimum": 0
          },
          "pause_before_speaking_sec": {
            "type": "number",
            "description": "Seconds of silence inserted before the agent starts speaking",
            "example": 0,
            "default": 2,
            "minimum": 0
          },
          "ring_duration_sec": {
            "type": "number",
            "description": "How long to let the phone ring before treating the call as unanswered (seconds)",
            "example": 30,
            "default": 5,
            "minimum": 1
          },
          "background_sound": {
            "type": "string",
            "description": "Background sound file or identifier"
          },
          "background_sound_volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "default": 1,
            "description": "Volume of background sound (0 to 2)"
          },
          "ambient_noise": {
            "type": "boolean",
            "description": "Enable or disable ambient noise playback on the call"
          },
          "responsiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.5,
            "description": "Responsiveness level from 0 to 1."
          },
          "interruption_sensitivity": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.5,
            "description": "Interruption sensitivity level (0 to 1)"
          },
          "response_eagerness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 1,
            "description": "How eagerly the agent responds (0 to 1). Only applied when transcriber is Soniox."
          },
          "backchanneling": {
            "type": "boolean",
            "default": false,
            "description": "Enable or disable backchanneling"
          },
          "backchannel_frequency": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.5,
            "description": "Backchannel frequency from (0 to 1)"
          },
          "transcription_mode": {
            "type": "string",
            "enum": [
              "optimize_for_speed",
              "optimize_for_accuracy"
            ],
            "default": "optimize_for_speed",
            "description": "Mode for transcription"
          },
          "denoising_mode": {
            "type": "string",
            "enum": [
              "remove_noise",
              "remove_noise_and_speech"
            ],
            "description": "Mode for denoising audio input"
          },
          "speech_normalization": {
            "type": "boolean",
            "default": false,
            "description": "Enable or disable speech normalization"
          },
          "transcript_formatting": {
            "type": "boolean",
            "default": false,
            "description": "Enable or disable transcript formatting"
          },
          "backchannel_keywords": {
            "type": "string",
            "description": "Comma-separated list of backchannel keywords"
          },
          "boosted_keywords": {
            "type": "string",
            "description": "Comma-separated list of boosted keywords"
          },
          "reminder_message_interval": {
            "type": "number",
            "default": 9,
            "description": "Interval between reminder messages (in seconds)"
          },
          "reminder_message_frequency": {
            "type": "number",
            "default": 1,
            "description": "Frequency of reminder messages"
          },
          "transcriber_id": {
            "type": "string",
            "nullable": true,
            "description": "ID of the transcriber catalog entry"
          },
          "fallback_stt_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Enable parallel fallback STT for this agent"
          },
          "stt_fallback_transcriber_id": {
            "type": "string",
            "nullable": true,
            "description": "Fallback STT transcriber catalog entry"
          },
          "stt_fallback_wait_ms": {
            "type": "number",
            "minimum": 0,
            "description": "Milliseconds to wait for primary STT after fallback finalizes first"
          },
          "audio_cache_enabled": {
            "type": "boolean",
            "description": "Enable TTS audio caching for this agent"
          },
          "folder_id": {
            "type": "string",
            "description": "ID of the folder this agent belongs to",
            "example": "fld_abc123xyz789"
          },
          "agent_type": {
            "type": "string",
            "description": "Type of the agent",
            "enum": [
              "Single_Prompt_Agent",
              "Conversational_Flow_Agent"
            ],
            "example": "Single_Prompt_Agent",
            "default": "Single_Prompt_Agent"
          },
          "pipeline_type": {
            "type": "string",
            "description": "Pipeline subtype for Single_Prompt_Agent. Cascaded = ASR→LLM→TTS pipeline. Speech_To_Speech = direct speech model. Null for Conversational_Flow_Agent.",
            "enum": [
              "Cascaded",
              "Speech_To_Speech"
            ],
            "example": "Cascaded",
            "default": "Cascaded"
          },
          "title": {
            "type": "string",
            "description": "Title of the agent (max 70 characters)",
            "example": "Customer Support Agent",
            "maxLength": 70
          },
          "version_title": {
            "type": "string",
            "description": "Version title (optional, will be auto-generated if not provided, max 35 characters)",
            "example": null,
            "nullable": true,
            "maxLength": 35
          },
          "description": {
            "type": "string",
            "description": "Description of the agent",
            "example": "This agent handles customer support inquiries"
          },
          "timezone": {
            "type": "string",
            "description": "Timezone for the agent",
            "example": "Asia/Kolkata"
          },
          "outbound_phone_number_id": {
            "type": "string",
            "description": "ID of the outbound phone number to use for this agent. Must be an existing phone number ID in your organization. Stored on the draft at creation; live outbound routing is claimed when the version is published."
          },
          "inbound_phone_number_id": {
            "type": "string",
            "description": "ID of the inbound phone number to use for this agent. Must be an existing phone number ID in your organization. Stored on the draft at creation; live inbound routing is claimed when the version is published."
          },
          "llm_id": {
            "type": "string",
            "description": "ID of the LLM associated with the agent",
            "example": "A1B2C3D4E5F6G7"
          },
          "language_id": {
            "type": "string",
            "description": "ID of the language the agent speaks",
            "example": "1"
          },
          "voice_id": {
            "type": "string",
            "description": "ID of the voice used by the agent",
            "example": "VOICE123456789"
          },
          "webhook_id": {
            "type": "string",
            "description": "ID of the webhook associated with the agent",
            "example": "wh_12345678901234"
          },
          "prompt_text": {
            "type": "string",
            "description": "Prompt text used by the agent",
            "example": "Hello, how can I assist you today?"
          },
          "system_prompt_text": {
            "type": "string",
            "description": "System prompt text for the agent",
            "example": "You are a helpful customer support agent named Sarah."
          },
          "node_positions": {
            "type": "string",
            "description": "Node positions for Conversational_Flow_Agent type (stored as JSON string)",
            "example": "{\"node1\": {\"x\": 100, \"y\": 200}}"
          },
          "conversation_start_type": {
            "type": "string",
            "description": "Who starts the conversation",
            "example": "user",
            "enum": [
              "user",
              "agent_dynamic",
              "agent_defined"
            ]
          },
          "welcome_message": {
            "type": "string",
            "description": "Welcome message for the agent",
            "example": "Welcome to our service!"
          },
          "allow_interruptions": {
            "type": "boolean",
            "description": "Whether the agent allows interruptions",
            "example": true
          },
          "json_output_instructions": {
            "type": "object",
            "description": "Instructions for JSON output",
            "example": {
              "format": "detailed"
            }
          },
          "knowledge_base_ids": {
            "description": "IDs of the knowledge bases attached to this agent version",
            "example": [
              "kb_abc123",
              "kb_def456"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "kb_max_chunks": {
            "type": "number",
            "description": "Maximum number of RAG chunks to fetch (1-10)",
            "example": 5,
            "minimum": 1,
            "maximum": 10
          },
          "kb_min_score": {
            "type": "number",
            "description": "Minimum similarity score threshold for RAG results (0-1)",
            "example": 0.5,
            "minimum": 0,
            "maximum": 1
          },
          "default_dynamic_variables": {
            "type": "object",
            "description": "Default values for dynamic variables used in templates",
            "example": {
              "firstName": "John",
              "lastName": "Doe",
              "courseType": "Math"
            }
          },
          "voice_model_id": {
            "type": "string",
            "description": "Voice model ID to use for the agent",
            "example": "voice_model_abc123"
          },
          "voice_speed": {
            "type": "number",
            "description": "Voice speed (0.25 to 4.0)",
            "example": 1,
            "minimum": 0.25,
            "maximum": 4
          },
          "voice_temperature": {
            "type": "number",
            "description": "Voice temperature (0.0 to 2.0)",
            "example": 1,
            "minimum": 0,
            "maximum": 2
          },
          "voice_volume": {
            "type": "number",
            "description": "Voice volume (0 to 10)",
            "example": 1,
            "minimum": 0,
            "maximum": 10
          },
          "voice_pitch": {
            "type": "number",
            "description": "Pitch adjustment of the voice (-1 to 1)",
            "example": 0,
            "minimum": -1,
            "maximum": 1
          },
          "llm_temperature": {
            "type": "number",
            "description": "LLM temperature (0.0 to 2.0)",
            "example": 0.1,
            "minimum": 0,
            "maximum": 2
          },
          "opt_out_sensitive_data_storage": {
            "type": "boolean",
            "description": "Opt out of sensitive data storage",
            "example": false
          },
          "opt_in_secure_urls": {
            "type": "boolean",
            "description": "Opt in to secure URLs",
            "example": false
          },
          "fallback_llm_enabled": {
            "type": "boolean",
            "description": "Enable fallback LLM for this agent",
            "example": false
          },
          "predictive_preprocessing_enabled": {
            "type": "boolean",
            "description": "Enable predictive preprocessing for this agent version",
            "example": false
          },
          "llm_fallback_delay_ms": {
            "type": "number",
            "description": "Milliseconds to wait before triggering the fallback LLM",
            "example": 500,
            "nullable": true
          },
          "llm_fallback_model": {
            "type": "string",
            "description": "ID (llms.id) of the LLM to use as fallback",
            "example": "abc123xyz789ab",
            "nullable": true
          },
          "fallback_voices": {
            "type": "array",
            "description": "Fallback voices for TTS. Used when the primary voice is unavailable.",
            "items": {
              "type": "object",
              "properties": {
                "voice_id": {
                  "type": "string",
                  "example": "VOICE123456789"
                },
                "voice_name": {
                  "type": "string",
                  "example": "Fallback Voice"
                },
                "provider_voice_id": {
                  "type": "string",
                  "example": "en-US-JennyNeural"
                },
                "provider": {
                  "type": "string",
                  "example": "azure"
                }
              }
            }
          },
          "agent_functions": {
            "type": "array",
            "description": "Functions the agent can invoke during a call (e.g. end call, transfer, booking). Passed at create time; use PATCH to replace later.",
            "items": {
              "type": "object",
              "required": [
                "displayName",
                "type",
                "description"
              ],
              "properties": {
                "displayName": {
                  "type": "string",
                  "example": "Book Calendar"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "end_call",
                    "call_transfer",
                    "custom",
                    "check_calendar_availability",
                    "book_calendar",
                    "integration"
                  ],
                  "example": "book_calendar"
                },
                "description": {
                  "type": "string",
                  "example": "Books a calendar appointment for the caller"
                },
                "config": {
                  "type": "object",
                  "example": {
                    "api_key": "xxx",
                    "calendar_id": "primary"
                  }
                }
              }
            }
          },
          "post_call_analysis": {
            "type": "array",
            "description": "Fields to extract from the call transcript after the call ends.",
            "items": {
              "type": "object",
              "required": [
                "field_name",
                "field_type",
                "field_description"
              ],
              "properties": {
                "field_name": {
                  "type": "string",
                  "example": "customer_satisfaction"
                },
                "field_type": {
                  "type": "string",
                  "enum": [
                    "NUMBER",
                    "STRING",
                    "BOOLEAN",
                    "ENUM"
                  ],
                  "example": "NUMBER"
                },
                "field_description": {
                  "type": "string",
                  "example": "Customer satisfaction rating from 1 to 5"
                }
              }
            }
          },
          "postcall_analysis": {
            "type": "array",
            "description": "Alias for post_call_analysis (backward compatibility).",
            "items": {
              "type": "object",
              "properties": {
                "field_name": {
                  "type": "string",
                  "example": "customer_satisfaction"
                },
                "field_type": {
                  "type": "string",
                  "enum": [
                    "NUMBER",
                    "STRING",
                    "BOOLEAN",
                    "ENUM"
                  ],
                  "example": "NUMBER"
                },
                "field_description": {
                  "type": "string",
                  "example": "Customer satisfaction rating from 1 to 5"
                }
              }
            }
          },
          "agent_identity": {
            "type": "string",
            "description": "Agent identity (required for Conversational_Flow_Agent type on update)",
            "example": "You are a helpful customer support agent named Sarah."
          },
          "agent_background": {
            "type": "string",
            "description": "Agent background (required for Conversational_Flow_Agent type on update)",
            "example": "You have 5 years of experience in customer support and specialize in helping customers with technical issues."
          }
        },
        "required": [
          "title",
          "language_id",
          "voice_id",
          "prompt_text"
        ]
      },
      "CreateAgentFunctionDto": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "description": "Display name of the function (max 35 characters)",
            "example": "End Call Function",
            "maxLength": 35
          },
          "description": {
            "type": "string",
            "description": "Description of the function",
            "example": "This function ends the call"
          },
          "type": {
            "type": "string",
            "description": "Type of the function",
            "enum": [
              "end_call",
              "call_transfer",
              "custom",
              "check_calendar_availability",
              "book_calendar",
              "integration"
            ],
            "example": "end_call"
          },
          "config": {
            "type": "object",
            "description": "Configuration object for the function",
            "example": {
              "timeout": 30,
              "message": "Goodbye!"
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "CreateAgents2BodyDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Customer Support Agent"
          },
          "llm": {
            "$ref": "#/components/schemas/Agents2LlmDto"
          },
          "fallback_llm_enabled": {
            "type": "boolean",
            "description": "Enable fallback LLM (flat alias; prefer llm.fallback.fallback_llm_enabled)",
            "example": false
          },
          "llm_fallback_model": {
            "type": "string",
            "description": "Fallback LLM id (flat alias; prefer llm.fallback.llm_fallback_model)",
            "example": "abc123xyz789ab",
            "nullable": true
          },
          "llm_fallback_delay_ms": {
            "type": "number",
            "description": "Fallback delay ms (flat alias; prefer llm.fallback.llm_fallback_delay_ms)",
            "example": 500,
            "nullable": true
          },
          "analysis": {
            "description": "Post-call analysis (PCA) fields for the agent version",
            "allOf": [
              {
                "$ref": "#/components/schemas/Agents2AnalysisDto"
              }
            ]
          }
        }
      },
      "CreateApiKeyDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Docs Key",
            "description": "Label for the API key"
          },
          "expire_now": {
            "type": "boolean",
            "example": false,
            "description": "Expire previous key immediately if true, else in 24 hours"
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateCallDto": {
        "type": "object",
        "properties": {
          "phone_number": {
            "type": "string",
            "example": "+911234567890",
            "description": "Phone number to call (must include country code). Format: +[country code][phone number]"
          },
          "agent_id": {
            "type": "string",
            "example": "mgao6051Rk718Y",
            "description": "Agent ID to use for the call. Must belong to the authenticated organization."
          },
          "agent_version_number": {
            "type": "number",
            "example": 2,
            "description": "Specific agent version number to use (optional). If provided, must be a published version. If not provided, will use the latest published version."
          },
          "metadata": {
            "type": "object",
            "example": {
              "customer_name": "John Doe",
              "customer_email": "john@example.com",
              "priority": "high"
            },
            "description": "Metadata for the call including customer information and any additional context. This data will be available during the call for personalization."
          },
          "notes": {
            "type": "object",
            "example": {
              "customer_name": "John Doe",
              "follow_up_required": true,
              "source": "dashboard"
            },
            "description": "Optional notes stored on the call log. Must be a JSON object with at most 15 top-level keys."
          }
        },
        "required": [
          "phone_number",
          "agent_id",
          "metadata"
        ]
      },
      "CreateCallResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "call_mfgsn90vwcozgb",
            "description": "Unique call ID for tracking. Use this ID to reference the call in other API endpoints."
          },
          "to_phone_number": {
            "type": "string",
            "example": "+911234567890",
            "description": "The phone number that will receive the call."
          },
          "agent_id": {
            "type": "string",
            "example": "agent_mfgsn90vwcozgb",
            "description": "The ID of the agent used for this call."
          },
          "agent_version_number": {
            "type": "number",
            "example": 2,
            "description": "The version number of the agent used for this call."
          }
        },
        "required": [
          "id",
          "to_phone_number",
          "agent_id"
        ]
      },
      "CreateCampaignDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Title of the campaign (max 150 characters)",
            "example": "New Product Launch",
            "maxLength": 150
          },
          "agent_id": {
            "type": "string",
            "description": "Agent ID associated with the campaign",
            "example": 101
          },
          "agent_version_number": {
            "type": "number",
            "description": "Agent Version ID associated with the campaign",
            "example": 1
          },
          "starts_at": {
            "type": "string",
            "description": "Start timestamp of the campaign (ISO string)",
            "example": "2025-05-10T09:00:00Z"
          },
          "ends_at": {
            "type": "string",
            "description": "End timestamp of the campaign (ISO string)",
            "example": "2025-05-20T18:00:00Z"
          },
          "calling_hours_start": {
            "type": "string",
            "description": "Start of allowed calling hours (HH:mm format only, not full datetime)",
            "example": "09:00"
          },
          "calling_hours_end": {
            "type": "string",
            "description": "End of allowed calling hours (HH:mm format only, not full datetime)",
            "example": "18:00"
          },
          "total_lead_count": {
            "type": "number",
            "description": "Total Number of Leads for this Campaign",
            "example": "10"
          },
          "status": {
            "type": "string",
            "description": "Status of the campaign",
            "enum": [
              "draft",
              "waiting",
              "running",
              "paused",
              "completed",
              "cancelled",
              "deleted",
              "scheduled"
            ],
            "example": "draft"
          },
          "number_of_retries": {
            "type": "number",
            "description": "Number of retries for the campaign (0-5)",
            "example": 3
          },
          "interval_between_retries": {
            "type": "number",
            "description": "Interval between retries in minutes (0-1440)",
            "example": 15
          }
        },
        "required": [
          "title",
          "agent_id"
        ]
      },
      "CreateCampaignLeadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "John Doe",
            "description": "Name of the lead"
          },
          "phoneNumber": {
            "type": "string",
            "example": 9876543210,
            "description": "Phone number without country code"
          },
          "countryCode": {
            "type": "string",
            "example": "+91",
            "description": "Country code of the lead. Default is \"+91\"."
          },
          "organisationId": {
            "type": "string",
            "example": "org_abc123xyz789",
            "description": "Organisation ID to which the lead belongs (string of length 14)"
          },
          "campaignId": {
            "type": "string",
            "example": 5,
            "description": "Campaign ID to which the lead is associated"
          },
          "notes": {
            "type": "object",
            "example": {
              "customer_id": "123",
              "follow_up": true,
              "tags": [
                "vip",
                "renewal"
              ]
            },
            "description": "Optional notes JSON for the lead. Maximum 15 top-level keys."
          }
        },
        "required": [
          "name",
          "phoneNumber",
          "organisationId",
          "campaignId"
        ]
      },
      "CreateEdgeDto": {
        "type": "object",
        "properties": {
          "from_node_id": {
            "type": "string",
            "description": "ID of the source node",
            "example": "node_abc123"
          },
          "to_node_id": {
            "type": "string",
            "description": "ID of the target node",
            "example": "node_xyz789"
          },
          "label": {
            "type": "string",
            "description": "Label for the edge (e.g., \"FAILED\", \"COMPLETED\", \"true\", \"false\")",
            "example": "COMPLETED",
            "maxLength": 50
          }
        },
        "required": [
          "from_node_id",
          "to_node_id"
        ]
      },
      "CreateKnowledgeBaseDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the knowledge base (must be unique within the workspace)",
            "example": "Product Documentation",
            "maxLength": 150
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateNodeDto": {
        "type": "object",
        "properties": {
          "node_type": {
            "type": "string",
            "description": "Type of the node",
            "enum": [
              "VOICE_CALL",
              "CONDITIONAL",
              "TIME",
              "APPLICATION",
              "CONVERTED",
              "DROPPED"
            ],
            "example": "VOICE_CALL"
          },
          "label": {
            "type": "string",
            "description": "Label/name of the node",
            "example": "Initial Call"
          },
          "position_x": {
            "type": "number",
            "description": "X position for UI",
            "example": 100
          },
          "position_y": {
            "type": "number",
            "description": "Y position for UI",
            "example": 200
          },
          "config": {
            "description": "Node-specific configuration (varies by node type)",
            "oneOf": [
              {
                "$ref": "#/components/schemas/VoiceCallNodeConfig"
              },
              {
                "$ref": "#/components/schemas/ConditionalNodeConfig"
              },
              {
                "$ref": "#/components/schemas/TimeNodeConfig"
              },
              {
                "$ref": "#/components/schemas/ApplicationNodeConfig"
              }
            ]
          }
        },
        "required": [
          "node_type",
          "label"
        ]
      },
      "CreateOrganizationPhoneNumberDto": {
        "type": "object",
        "properties": {
          "country_iso": {
            "type": "string",
            "example": "91",
            "description": "Country calling code digits only (e.g. \"91\" for India, \"1\" for US); stored as VARCHAR(3)"
          },
          "phone_number": {
            "type": "number",
            "example": 1234567890,
            "description": "Phone number assigned to organization (without country code)"
          },
          "telephony_provider_id": {
            "type": "string",
            "example": "prov_xxxxxx",
            "description": "ID of telephony provider (14-char string)"
          },
          "status": {
            "type": "string",
            "example": "pending",
            "enum": [
              "pending",
              "active"
            ],
            "description": "Current status of the organization phone number"
          },
          "inbound_agent_id": {
            "type": "string",
            "example": "agent_in_123",
            "description": "Inbound agent ID to associate with this number"
          },
          "outbound_agent_id": {
            "type": "string",
            "example": "agent_out_456",
            "description": "Outbound agent ID to associate with this number"
          },
          "inbound_agent_version_number": {
            "type": "number",
            "example": 1,
            "description": "Inbound agent version number for this phone number"
          },
          "outbound_agent_version_number": {
            "type": "number",
            "example": 2,
            "description": "Outbound agent version number for this phone number"
          },
          "sip_trunk_enabled": {
            "type": "boolean",
            "default": false,
            "description": "When true, Speech IO uses SIP trunking (e.g. asterisk) for this number."
          },
          "rental_start_date": {
            "type": "string",
            "example": "2026-04-07",
            "description": "Rental start date in YYYY-MM-DD format"
          },
          "rental_end_date": {
            "type": "string",
            "example": "2026-05-07",
            "description": "Rental end date in YYYY-MM-DD format"
          },
          "rental_status": {
            "type": "string",
            "example": "active",
            "enum": [
              "active",
              "expired",
              "available_for_reassignment"
            ],
            "description": "Rental lifecycle status for this phone number"
          },
          "nickname": {
            "type": "string",
            "example": "Sales Line",
            "description": "Human-readable nickname for this phone number"
          }
        },
        "required": [
          "country_iso",
          "phone_number",
          "telephony_provider_id"
        ]
      },
      "CreatePhoneNumberPricingDto": {
        "type": "object",
        "properties": {
          "telephony_provider_id": {
            "type": "string",
            "example": "tp_abc123xyz",
            "description": "ID of telephony provider"
          },
          "country_iso": {
            "type": "string",
            "example": "US",
            "description": "Country ISO code (3 characters)"
          },
          "country_name": {
            "type": "string",
            "example": "United States",
            "description": "Country name"
          },
          "credit_cost": {
            "type": "number",
            "example": 10.5,
            "description": "Credit cost for phone number rental"
          }
        },
        "required": [
          "telephony_provider_id",
          "country_iso",
          "country_name",
          "credit_cost"
        ]
      },
      "CreateUserWebhookDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "example": "https://webhook.site/your-endpoint",
            "description": "The URL to which webhook events will be sent."
          },
          "events": {
            "example": [
              "order.paid",
              "order.failed"
            ],
            "description": "List of events this webhook is subscribed to.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_active": {
            "type": "boolean",
            "example": true,
            "description": "Whether the webhook is active."
          },
          "secret": {
            "type": "string",
            "example": "mySuperSecret",
            "description": "Secret used to sign webhook payloads."
          }
        },
        "required": [
          "url",
          "events",
          "secret"
        ]
      },
      "CreateWebcallDto": {
        "type": "object",
        "properties": {
          "phone_number": {
            "type": "string",
            "example": "+1234567890",
            "description": "Phone number to call (must include country code). Format: +[country code][phone number]"
          },
          "agent_id": {
            "type": "string",
            "example": "ag_12345678901234",
            "description": "Agent ID to use for the call. Must belong to the authenticated organization."
          },
          "agent_version_number": {
            "type": "number",
            "example": 2,
            "description": "Specific agent version number to use (optional). If provided, must be a published version. If not provided, will use the latest published version."
          },
          "metadata": {
            "type": "object",
            "example": {
              "customer_name": "John Doe",
              "customer_email": "john@example.com",
              "lead_source": "website",
              "priority": "high"
            },
            "description": "Metadata for the call including customer information and any additional context. This data will be available during the call for personalization."
          }
        },
        "required": [
          "phone_number",
          "agent_id",
          "metadata"
        ]
      },
      "CreateWebcallResponseDto": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "example": "mf0x4riongyz6h",
            "description": "Unique session ID for the webcall. This is the call log ID that can be used to track the webcall session."
          },
          "agent_id": {
            "type": "string",
            "example": "0e709fd2-8339-46fa-8e28-ca8c66e00f43",
            "description": "Agent ID used for the webcall"
          },
          "call_id": {
            "type": "string",
            "example": "mf0x4riongyz6h",
            "description": "Call ID from Nexa Speech API"
          },
          "state": {
            "type": "string",
            "example": "created",
            "description": "Current state of the webcall session"
          },
          "websocket_url": {
            "type": "string",
            "example": "/webcall/ws/mf0x4riongyz6h",
            "description": "WebSocket URL for connecting to the webcall session"
          },
          "message": {
            "type": "string",
            "example": "Webcall session created successfully",
            "description": "Success message from the API"
          }
        },
        "required": [
          "session_id",
          "agent_id",
          "call_id",
          "state",
          "websocket_url",
          "message"
        ]
      },
      "CreateWorkflowDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Title of the workflow (max 100 characters)",
            "example": "Customer Onboarding Workflow",
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "description": "Description of the workflow",
            "example": "Automated workflow for customer onboarding process"
          },
          "status": {
            "type": "string",
            "description": "Status of the workflow",
            "enum": [
              "draft",
              "active",
              "paused",
              "completed",
              "cancelled"
            ],
            "example": "draft"
          }
        },
        "required": [
          "title"
        ]
      },
      "DeleteKnowledgeBasesDto": {
        "type": "object",
        "properties": {
          "org_id": {
            "type": "string",
            "description": "Organization ID - all KBs to delete must belong to this org",
            "example": "org_A1B2C3D4E5F6G7"
          },
          "knowledge_base_ids": {
            "description": "Array of knowledge base IDs to delete (optional - if omitted, all KBs for the org are deleted)",
            "example": [
              "kb_abc123",
              "kb_def456"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "org_id"
        ]
      },
      "GetProviderPhoneNumbersResponseDto": {
        "type": "object",
        "properties": {
          "telephonyProviderId": {
            "type": "string",
            "description": "ID of telephony provider (14-char string)"
          },
          "providerName": {
            "type": "string",
            "description": "Provider name (Plivo or Twilio)"
          },
          "data": {
            "description": "Phone numbers data from the provider",
            "oneOf": [
              {
                "$ref": "#/components/schemas/PlivoPhoneNumbersResponseDto"
              },
              {
                "$ref": "#/components/schemas/TwilioPhoneNumbersResponseDto"
              }
            ]
          }
        },
        "required": [
          "telephonyProviderId",
          "providerName",
          "data"
        ]
      },
      "KnowledgeBase": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "kb_abc123",
            "description": "Signed knowledge base ID."
          },
          "name": {
            "type": "string",
            "example": "Loan FAQ",
            "maxLength": 150
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Languages": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "lang_abc123",
            "description": "Signed language ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "LinkSipTrunkDto": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "example": "+14155552671",
            "description": "E.164 phone number"
          },
          "terminationUri": {
            "type": "string",
            "example": "31974861099010243.zt.plivo.com:5060",
            "description": "SIP termination host[:port]; must not use a sip: URI prefix"
          },
          "sipTrunkUserName": {
            "type": "string",
            "description": "SIP authentication username"
          },
          "sipTrunkPassword": {
            "type": "string",
            "description": "SIP authentication password (stored encrypted)"
          },
          "nickname": {
            "type": "string",
            "description": "Display nickname for this trunk"
          }
        },
        "required": [
          "phoneNumber",
          "terminationUri"
        ]
      },
      "Llm": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "llm_abc123",
            "description": "Signed LLM ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "MakeCallDto": {
        "type": "object",
        "properties": {
          "recipient_phone_number": {
            "type": "string",
            "description": "The phone number of the recipient"
          },
          "from_phone_number": {
            "type": "string",
            "description": "The phone number to call from"
          },
          "agent_id": {
            "type": "string",
            "description": "The ID of the agent version to use for the call"
          },
          "agent_version_id": {
            "type": "number",
            "description": "The ID of the agent version to use for the call"
          },
          "dynamic_variables": {
            "description": "Dynamic variables to use in the call. Should be a JSON object with key-value pairs.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "recipient_phone_number",
          "from_phone_number",
          "agent_id",
          "agent_version_id",
          "dynamic_variables"
        ]
      },
      "OrganizationPhoneNumber": {
        "type": "object",
        "properties": {
          "sip_trunk_enabled": {
            "type": "boolean",
            "description": "When true, Speech IO uses SIP trunking (e.g. asterisk) for this number.",
            "default": false
          }
        },
        "required": [
          "sip_trunk_enabled"
        ]
      },
      "PhoneNumberPricing": {
        "type": "object",
        "properties": {}
      },
      "PlivoPhoneNumberDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "The phone number"
          },
          "type": {
            "type": "string",
            "description": "The type of phone number (local, tollfree, etc.)"
          },
          "monthly_rental_rate": {
            "type": "string",
            "description": "The monthly rental rate for the phone number"
          },
          "setup_rate": {
            "type": "string",
            "description": "The setup fee for the phone number"
          },
          "voice_enabled": {
            "type": "boolean",
            "description": "Voice capability of the phone number"
          },
          "sms_enabled": {
            "type": "boolean",
            "description": "SMS capability of the phone number"
          },
          "mms_enabled": {
            "type": "boolean",
            "description": "MMS capability of the phone number"
          },
          "country_iso": {
            "type": "string",
            "description": "Country ISO code"
          },
          "number_format": {
            "type": "string",
            "description": "The number in international format"
          }
        },
        "required": [
          "number",
          "type",
          "monthly_rental_rate",
          "setup_rate",
          "voice_enabled",
          "sms_enabled",
          "mms_enabled",
          "country_iso",
          "number_format"
        ]
      },
      "PlivoPhoneNumbersResponseDto": {
        "type": "object",
        "properties": {
          "api_id": {
            "type": "string",
            "description": "API ID for the request"
          },
          "objects": {
            "description": "List of available phone numbers",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlivoPhoneNumberDto"
            }
          },
          "meta": {
            "type": "object",
            "description": "Total count of available numbers"
          }
        },
        "required": [
          "api_id",
          "objects",
          "meta"
        ]
      },
      "PurchasePhoneNumberDto": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "example": "+1234567890",
            "description": "Phone number to purchase"
          }
        },
        "required": [
          "phoneNumber"
        ]
      },
      "PurchasePhoneNumberRequestDto": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "example": "+1234567890",
            "description": "Phone number to purchase"
          },
          "telephonyProviderId": {
            "type": "string",
            "example": "plivo_123456",
            "description": "ID of telephony provider (14-char string)"
          },
          "countryISO": {
            "type": "string",
            "example": "US",
            "description": "Country ISO code (e.g., US, IN)"
          }
        },
        "required": [
          "phoneNumber",
          "telephonyProviderId",
          "countryISO"
        ]
      },
      "PurchasePhoneNumberResponseDto": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "example": "+1234567890",
            "description": "Phone number"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "pending"
            ],
            "description": "Status of the phone number"
          },
          "message": {
            "type": "string",
            "description": "Status message"
          },
          "organizationPhoneNumber": {
            "description": "Organization phone number record",
            "allOf": [
              {
                "$ref": "#/components/schemas/OrganizationPhoneNumber"
              }
            ]
          }
        },
        "required": [
          "phoneNumber",
          "status"
        ]
      },
      "PurchaseTwilioPhoneNumberDto": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "example": "+448085310432",
            "description": "Phone number to purchase"
          }
        },
        "required": [
          "phoneNumber"
        ]
      },
      "RotateWebhookSecretDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Optional name for the new webhook secret",
            "example": "Production Secret"
          }
        }
      },
      "S2SLanguageSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "mj17k2hwviopty"
          },
          "name": {
            "type": "string",
            "example": "Hindi"
          },
          "code": {
            "type": "string",
            "example": "hi"
          }
        },
        "required": [
          "id",
          "name",
          "code"
        ]
      },
      "S2SLlmSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "llm_abc123456789"
          },
          "name": {
            "type": "string",
            "example": "GPT Realtime 2"
          },
          "provider": {
            "type": "string",
            "example": "openai"
          },
          "provider_id": {
            "type": "string",
            "example": "gpt-realtime-2"
          }
        },
        "required": [
          "id",
          "name",
          "provider",
          "provider_id"
        ]
      },
      "S2SVoiceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "voice_abc123456789"
          },
          "name": {
            "type": "string",
            "example": "Ash"
          },
          "provider": {
            "type": "string",
            "example": "openai",
            "nullable": true
          },
          "provider_voice_id": {
            "type": "string",
            "example": "ash",
            "nullable": true
          },
          "gender": {
            "type": "string",
            "example": "male"
          },
          "accent": {
            "type": "string",
            "example": "american",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "recording": {
            "type": "string",
            "nullable": true
          },
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/S2SLanguageSummaryDto"
            }
          },
          "llms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/S2SLlmSummaryDto"
            }
          }
        },
        "required": [
          "id",
          "name",
          "provider",
          "provider_voice_id",
          "gender",
          "accent",
          "icon",
          "recording",
          "languages",
          "llms"
        ]
      },
      "S2SVoicesResponseDto": {
        "type": "object",
        "properties": {
          "voices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/S2SVoiceDto"
            }
          }
        },
        "required": [
          "voices"
        ]
      },
      "TerminateWebcallRequestDto": {
        "type": "object",
        "properties": {
          "audio_data": {
            "type": "string",
            "example": "UklGRlzcAQBXQVZFZm10IBAAAAABAAIAQB8AAAB9AAAEABAAZ",
            "description": "Optional base64-encoded audio data to send when terminating the webcall"
          }
        }
      },
      "TerminateWebcallResponseDto": {
        "type": "object",
        "properties": {
          "call_id": {
            "type": "string",
            "example": "cl_1234567890abcd",
            "description": "Call ID of the terminated webcall"
          },
          "message": {
            "type": "string",
            "example": "Webcall terminated successfully",
            "description": "Success message from the API"
          },
          "status": {
            "type": "string",
            "example": "terminated",
            "description": "Status of the webcall after termination"
          }
        },
        "required": [
          "call_id",
          "message",
          "status"
        ]
      },
      "Transcriber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "trs_abc123",
            "description": "Signed transcriber ID"
          }
        },
        "required": [
          "id"
        ]
      },
      "TwilioPhoneNumberCapabilitiesDto": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "boolean",
            "description": "Voice capability of the phone number"
          },
          "SMS": {
            "type": "boolean",
            "description": "SMS capability of the phone number"
          },
          "MMS": {
            "type": "boolean",
            "description": "MMS capability of the phone number"
          }
        },
        "required": [
          "voice",
          "SMS",
          "MMS"
        ]
      },
      "TwilioPhoneNumberDto": {
        "type": "object",
        "properties": {
          "phone_number": {
            "type": "string",
            "description": "The phone number"
          },
          "friendly_name": {
            "type": "string",
            "description": "The friendly name of the phone number"
          },
          "iso_country": {
            "type": "string",
            "description": "Country ISO code"
          },
          "capabilities": {
            "description": "Capabilities of the phone number",
            "allOf": [
              {
                "$ref": "#/components/schemas/TwilioPhoneNumberCapabilitiesDto"
              }
            ]
          }
        },
        "required": [
          "phone_number",
          "friendly_name",
          "iso_country",
          "capabilities"
        ]
      },
      "TwilioPhoneNumbersResponseDto": {
        "type": "object",
        "properties": {
          "available_phone_numbers": {
            "description": "List of available phone numbers",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwilioPhoneNumberDto"
            }
          },
          "uri": {
            "type": "string",
            "description": "URI for the resource"
          }
        },
        "required": [
          "available_phone_numbers",
          "uri"
        ]
      },
      "UpdateAgentDto": {
        "type": "object",
        "properties": {
          "background_sound": {
            "type": "string",
            "description": "Background sound file or identifier"
          },
          "background_sound_volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "description": "Volume of background sound (0 to 2)"
          },
          "ambient_noise": {
            "type": "boolean",
            "description": "Enable or disable ambient noise playback on the call"
          },
          "responsiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 5,
            "description": "Responsiveness level from 0 to 1."
          },
          "interruption_sensitivity": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Interruption sensitivity level (0 to 1)"
          },
          "response_eagerness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "How eagerly the agent responds (0 to 1). Only applied when transcriber is Soniox."
          },
          "backchanneling": {
            "type": "boolean",
            "description": "Enable or disable backchanneling"
          },
          "backchannel_frequency": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Frequency of backchannel responses",
            "example": 0.5
          },
          "transcription_mode": {
            "type": "string",
            "enum": [
              "optimize_for_speed",
              "optimize_for_accuracy"
            ],
            "description": "Mode for transcription"
          },
          "denoising_mode": {
            "type": "string",
            "enum": [
              "remove_noise",
              "remove_noise_and_speech"
            ],
            "nullable": true,
            "description": "Mode for denoising audio input"
          },
          "speech_normalization": {
            "type": "boolean",
            "description": "Enable or disable speech normalization"
          },
          "transcript_formatting": {
            "type": "boolean",
            "description": "Enable or disable transcript formatting"
          },
          "backchannel_keywords": {
            "type": "string",
            "description": "Comma-separated list of backchannel keywords"
          },
          "boosted_keywords": {
            "type": "string",
            "description": "Comma-separated list of boosted keywords"
          },
          "reminder_message_interval": {
            "type": "number",
            "description": "Interval between reminder messages (in seconds)"
          },
          "reminder_message_frequency": {
            "type": "number",
            "description": "Frequency of reminder messages"
          },
          "transcriber_id": {
            "type": "string",
            "nullable": true,
            "description": "ID of the transcriber catalog entry"
          },
          "fallback_stt_enabled": {
            "type": "boolean",
            "description": "Enable parallel fallback STT for this agent"
          },
          "stt_fallback_transcriber_id": {
            "type": "string",
            "nullable": true,
            "description": "Fallback STT transcriber catalog entry"
          },
          "stt_fallback_wait_ms": {
            "type": "number",
            "minimum": 0,
            "description": "Milliseconds to wait for primary STT after fallback finalizes first"
          },
          "audio_cache_enabled": {
            "type": "boolean",
            "description": "Enable TTS audio caching for this agent"
          },
          "version_number": {
            "type": "number",
            "description": "Version number of the agent to update",
            "example": 1
          },
          "folder_id": {
            "type": "string",
            "description": "ID of the folder this agent belongs to",
            "example": "fld_abc123xyz789"
          },
          "pipeline_type": {
            "type": "string",
            "description": "Pipeline subtype for Single_Prompt_Agent. Cascaded = ASR→LLM→TTS pipeline. Speech_To_Speech = direct speech model.",
            "enum": [
              "Cascaded",
              "Speech_To_Speech"
            ],
            "example": "Cascaded"
          },
          "title": {
            "type": "string",
            "description": "Title of the agent (max 70 characters)",
            "example": "Customer Support Agent",
            "maxLength": 70
          },
          "version_title": {
            "type": "string",
            "description": "Version title (optional, will be auto-generated if not provided, max 35 characters)",
            "example": "Version 1.1",
            "nullable": true,
            "maxLength": 35
          },
          "description": {
            "type": "string",
            "description": "Description of the agent",
            "example": "This agent handles customer support inquiries"
          },
          "timezone": {
            "type": "string",
            "description": "Timezone for the agent",
            "example": "Asia/Kolkata"
          },
          "inbound_phone_number_id": {
            "type": "string",
            "description": "ID of the inbound phone number to use for this agent. Must be an existing phone number ID in your organization. Applied to live inbound routing only when `is_published: true` is sent in the same request. Pass an empty string to detach while publishing."
          },
          "system_prompt_text": {
            "type": "string",
            "description": "System prompt text for the agent",
            "example": "You are a helpful customer support agent named Sarah."
          },
          "outbound_phone_number_id": {
            "type": "string",
            "description": "ID of the outbound phone number to use for this agent. Must be an existing phone number ID in your organization. Applied to live outbound routing only when `is_published: true` is sent in the same request. Pass an empty string to detach while publishing. Active workflows using the number can cause a 409 conflict."
          },
          "language_id": {
            "type": "string",
            "description": "ID of the language the agent speaks",
            "example": "lng_59a9ce4a91334686933a"
          },
          "llm_id": {
            "type": "string",
            "description": "ID of the LLM associated with the agent",
            "example": "A1B2C3D4E5F6G7"
          },
          "llm_temperature": {
            "type": "number",
            "description": "temperature value for the LLM which controls how creative the model responses are",
            "example": 0.1,
            "default": 0.1
          },
          "voice_id": {
            "type": "string",
            "description": "ID of the voice used by the agent",
            "example": "VOICE123456789"
          },
          "webhook_id": {
            "type": "string",
            "description": "ID of the webhook associated with the agent",
            "example": "wh_12345678901234"
          },
          "prompt_text": {
            "type": "string",
            "description": "Prompt text used by the agent",
            "example": "Hello, how can I assist you today?"
          },
          "node_positions": {
            "type": "string",
            "description": "Node positions for Conversational_Flow_Agent type (stored as JSON string)",
            "example": "{\"id\" : 1, \"positions\" : {\"x\": 100, \"y\": 200}}"
          },
          "conversation_start_type": {
            "type": "string",
            "description": "Who starts the conversation",
            "example": "user",
            "enum": [
              "user",
              "agent_dynamic",
              "agent_defined"
            ]
          },
          "welcome_message": {
            "type": "string",
            "description": "Welcome message for the agent",
            "example": "Welcome to our service!"
          },
          "allow_interruptions": {
            "type": "boolean",
            "description": "Whether the agent allows interruptions",
            "example": true
          },
          "structured_output": {
            "type": "boolean",
            "description": "Whether the reponse should adhere to a structure or not",
            "example": true
          },
          "json_output_instructions": {
            "type": "object",
            "description": "Instructions for JSON output",
            "example": {
              "format": "detailed"
            }
          },
          "knowledge_base_ids": {
            "description": "IDs of the knowledge bases attached to this agent version",
            "example": [
              "kb_abc123",
              "kb_def456"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "kb_max_chunks": {
            "type": "number",
            "description": "Maximum number of RAG chunks to fetch (1-10)",
            "example": 5,
            "minimum": 1,
            "maximum": 10
          },
          "kb_min_score": {
            "type": "number",
            "description": "Minimum similarity score threshold for RAG results (0-1)",
            "example": 0.5,
            "minimum": 0,
            "maximum": 1
          },
          "is_published": {
            "type": "boolean",
            "description": "Publish this draft version. When true, phone number IDs in the same request are claimed for live routing.",
            "example": false
          },
          "update_deployment": {
            "type": "boolean",
            "description": "Whether to allow updating a published version",
            "example": false
          },
          "default_dynamic_variables": {
            "type": "object",
            "description": "Default values for dynamic variables used in templates",
            "example": {
              "firstName": "John",
              "lastName": "Doe",
              "courseType": "Math"
            }
          },
          "fallback_llm_enabled": {
            "type": "boolean",
            "description": "Enable fallback LLM for this agent",
            "example": false
          },
          "llm_fallback_delay_ms": {
            "type": "number",
            "description": "Milliseconds to wait before triggering the fallback LLM",
            "example": 500,
            "nullable": true
          },
          "llm_fallback_model": {
            "type": "string",
            "description": "ID (llms.id) of the LLM to use as fallback",
            "example": "abc123xyz789ab",
            "nullable": true
          },
          "predictive_preprocessing_enabled": {
            "type": "boolean",
            "description": "Enable predictive preprocessing for this agent version",
            "example": false
          },
          "voice_model_id": {
            "type": "string",
            "description": "Voice model ID to use for the agent",
            "example": "254"
          },
          "agent_identity": {
            "type": "string",
            "description": "Agent identity (required for Conversational_Flow_Agent type on update)",
            "example": "You are a helpful customer support agent named Sarah."
          },
          "agent_background": {
            "type": "string",
            "description": "Agent background (required for Conversational_Flow_Agent type on update)",
            "example": "You have 5 years of experience in customer support and specialize in helping customers with technical issues."
          },
          "post_call_analysis": {
            "description": "Post call analysis configuration",
            "example": [
              {
                "field_name": "customer_satisfaction",
                "field_type": "NUMBER",
                "field_description": "Customer satisfaction rating"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field_name",
                "field_type",
                "field_description"
              ],
              "properties": {
                "field_name": {
                  "type": "string"
                },
                "field_type": {
                  "type": "string",
                  "enum": [
                    "NUMBER",
                    "STRING",
                    "BOOLEAN",
                    "ENUM"
                  ]
                },
                "field_description": {
                  "type": "string"
                }
              }
            }
          },
          "postcall_analysis": {
            "description": "Post call analysis configuration (alternative field name)",
            "example": [
              {
                "field_name": "customer_satisfaction",
                "field_type": "NUMBER",
                "field_description": "Customer satisfaction rating"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field_name",
                "field_type",
                "field_description"
              ],
              "properties": {
                "field_name": {
                  "type": "string"
                },
                "field_type": {
                  "type": "string",
                  "enum": [
                    "NUMBER",
                    "STRING",
                    "BOOLEAN",
                    "ENUM"
                  ]
                },
                "field_description": {
                  "type": "string"
                }
              }
            }
          },
          "agent_functions": {
            "type": "array",
            "description": "Agent functions - full replace for this version. Pass empty array to clear all.",
            "items": {
              "type": "object",
              "properties": {
                "displayName": {
                  "type": "string",
                  "example": "Book Calendar"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "end_call",
                    "call_transfer",
                    "custom",
                    "check_calendar_availability",
                    "book_calendar",
                    "integration"
                  ]
                },
                "description": {
                  "type": "string",
                  "example": "Book appointments"
                },
                "config": {
                  "type": "object",
                  "example": {
                    "api_key": "xxx"
                  }
                }
              }
            }
          },
          "post_call_analysis_llm_id": {
            "type": "string",
            "nullable": true,
            "description": "LLM ID used for post-call analysis extraction. Pass a signed LLM ID such as llm_A1B2C3D4E5F6G7 to set an override, null to clear it, or omit the field to leave the existing setting unchanged.",
            "example": "llm_A1B2C3D4E5F6G7"
          }
        },
        "required": [
          "version_number"
        ]
      },
      "UpdateAgentFunctionDto": {
        "type": "object",
        "properties": {}
      },
      "UpdateAgents2BodyDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Customer Support Agent"
          },
          "llm": {
            "$ref": "#/components/schemas/Agents2LlmDto"
          },
          "fallback_llm_enabled": {
            "type": "boolean",
            "description": "Enable fallback LLM (flat alias; prefer llm.fallback.fallback_llm_enabled)",
            "example": false
          },
          "llm_fallback_model": {
            "type": "string",
            "description": "Fallback LLM id (flat alias; prefer llm.fallback.llm_fallback_model)",
            "example": "abc123xyz789ab",
            "nullable": true
          },
          "llm_fallback_delay_ms": {
            "type": "number",
            "description": "Fallback delay ms (flat alias; prefer llm.fallback.llm_fallback_delay_ms)",
            "example": 500,
            "nullable": true
          },
          "analysis": {
            "description": "Post-call analysis (PCA) fields for the agent version",
            "allOf": [
              {
                "$ref": "#/components/schemas/Agents2AnalysisDto"
              }
            ]
          },
          "version_number": {
            "type": "number",
            "description": "Agent version number to update",
            "example": 1
          },
          "is_published": {
            "type": "boolean",
            "description": "Publish this agent version",
            "example": false
          },
          "update_deployment": {
            "type": "boolean",
            "description": "Allow updating an already-published version",
            "example": false
          }
        }
      },
      "UpdateApiKeyNameDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "CI Pipeline Key",
            "description": "New label for the API key"
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateCampaignDto": {
        "type": "object",
        "properties": {
          "sent_lead_count": {
            "type": "number",
            "description": "Total Number Failed Leads for this Campaign",
            "example": "10"
          },
          "picked_up_lead_count": {
            "type": "number",
            "description": "Total Number Leads who picked up for this Campaign",
            "example": "10"
          },
          "success_lead_count": {
            "type": "number",
            "description": "Total Number Successful Leads for this Campaign",
            "example": "10"
          },
          "completed_leads": {
            "type": "number",
            "description": "Total Number of Completed Leads for this Campaign",
            "example": "10"
          },
          "failed_leads": {
            "type": "number",
            "description": "Total Number of Failed Leads for this Campaign",
            "example": "10"
          },
          "number_of_retries": {
            "type": "number",
            "description": "Number of retries for the campaign (0-5)",
            "example": 3
          },
          "interval_between_retries": {
            "type": "number",
            "description": "Interval between retries in minutes (0-1440)",
            "example": 15
          }
        }
      },
      "UpdateCampaignLeadDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Jane Doe",
            "description": "Updated name of the lead"
          },
          "phoneNumber": {
            "type": "number",
            "example": "+919876543211",
            "description": "Updated phone number of the lead"
          },
          "countryCode": {
            "type": "string",
            "example": "+91",
            "description": "Updated country code"
          },
          "organisationId": {
            "type": "string",
            "example": "org_abc123xyz789",
            "description": "Updated organisation ID (string of length 14)"
          },
          "campaignId": {
            "type": "string",
            "example": 6,
            "description": "Updated campaign ID"
          },
          "notes": {
            "type": "object",
            "example": {
              "customer_id": "123",
              "follow_up": true,
              "tags": [
                "vip",
                "renewal"
              ]
            },
            "description": "Optional notes JSON for the lead. Maximum 15 top-level keys."
          }
        }
      },
      "UpdateKnowledgeBaseDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the knowledge base",
            "example": "Updated Product Documentation"
          }
        }
      },
      "UpdateOrganizationPhoneNumberDto": {
        "type": "object",
        "properties": {
          "country_iso": {
            "type": "string",
            "example": "91",
            "description": "Country calling code digits only (e.g. \"91\" for India, \"1\" for US); stored as VARCHAR(3)"
          },
          "phone_number": {
            "type": "number",
            "example": 1234567890,
            "description": "Phone number assigned to organization (without country code)"
          },
          "telephony_provider_id": {
            "type": "string",
            "example": "prov_xxxxxx",
            "description": "ID of telephony provider (14-char string)"
          },
          "status": {
            "type": "string",
            "example": "active",
            "enum": [
              "pending",
              "active"
            ],
            "description": "Status of the phone number"
          },
          "inbound_agent_id": {
            "type": "string",
            "example": "A1B2C3D4E5F6G7",
            "description": "Inbound agent ID"
          },
          "outbound_agent_id": {
            "type": "string",
            "example": "B1C2D3E4F5G6H7",
            "description": "Outbound agent ID"
          },
          "inbound_agent_version_number": {
            "type": "number",
            "example": 1,
            "description": "Inbound agent version number"
          },
          "outbound_agent_version_number": {
            "type": "number",
            "example": 2,
            "description": "Outbound agent version number"
          },
          "sip_trunk_enabled": {
            "type": "boolean",
            "default": false,
            "description": "When true, Speech IO uses SIP trunking (e.g. asterisk) for this number."
          },
          "rental_start_date": {
            "type": "string",
            "example": "2026-04-07",
            "description": "Rental start date in YYYY-MM-DD format"
          },
          "rental_end_date": {
            "type": "string",
            "example": "2026-05-07",
            "description": "Rental end date in YYYY-MM-DD format"
          },
          "rental_status": {
            "type": "string",
            "example": "active",
            "enum": [
              "active",
              "expired",
              "available_for_reassignment"
            ],
            "description": "Rental lifecycle status for this phone number"
          },
          "nickname": {
            "type": "string",
            "example": "Sales Line",
            "description": "Human-readable nickname for this phone number"
          }
        }
      },
      "UpdatePhoneNumberPricingDto": {
        "type": "object",
        "properties": {
          "country_name": {
            "type": "string",
            "example": "United States",
            "description": "Country name"
          },
          "credit_cost": {
            "type": "number",
            "example": 10.5,
            "description": "Credit cost for phone number rental"
          }
        }
      },
      "UpdatePostCallAnalysisLlmModelDto": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "example": "A1B2C3D4E5F6G7",
            "description": "ID of the agent"
          },
          "version_number": {
            "type": "number",
            "example": 1,
            "description": "Agent version number"
          },
          "llm_id": {
            "type": "string",
            "example": "A1B2C3D4E5F6G7",
            "description": "FK to llms.id - LLM used for post-call extraction. Pass null to clear.",
            "nullable": true
          }
        },
        "required": [
          "agent_id",
          "version_number"
        ]
      },
      "UpdateRentalStatusDto": {
        "type": "object",
        "properties": {
          "rental_status": {
            "type": "string",
            "example": "active",
            "description": "Rental status",
            "enum": [
              "active",
              "expired",
              "available_for_reassignment"
            ]
          },
          "rental_end_date": {
            "type": "string",
            "example": "2025-01-01",
            "description": "Rental end date"
          }
        }
      },
      "UpdateUserWebhookDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "example": "https://webhook.site/updated-endpoint",
            "description": "The new URL for the webhook."
          },
          "events": {
            "example": [
              "order.paid"
            ],
            "description": "Updated list of events.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_active": {
            "type": "boolean",
            "example": false,
            "description": "Whether the webhook is active."
          },
          "secret": {
            "type": "string",
            "example": "newSecret",
            "description": "New secret for signing payloads."
          }
        }
      },
      "UpdateWebhookSecretDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "New name for the webhook secret",
            "example": "Production Secret V2",
            "maxLength": 50
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateWorkflowDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Title of the workflow (max 100 characters)",
            "example": "Updated Customer Onboarding Workflow",
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "description": "Description of the workflow",
            "example": "Updated description"
          },
          "status": {
            "type": "string",
            "description": "Status of the workflow",
            "enum": [
              "draft",
              "active",
              "paused",
              "completed",
              "cancelled"
            ],
            "example": "active"
          },
          "fallback_variables": {
            "description": "Workflow-level default values for lead variables missing on a lead",
            "example": [
              {
                "key": "school_name",
                "default_value": "Unknown School"
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowFallbackVariableDto"
            }
          }
        }
      },
      "VoiceModelVoice": {
        "type": "object",
        "properties": {}
      },
      "WorkflowFallbackVariableDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Lead variable key",
            "example": "school_name"
          },
          "default_value": {
            "type": "string",
            "description": "Default value when the lead does not have this variable",
            "example": "Unknown School"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 400
          },
          "message": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "example": "phone_number must be a valid E.164 phone number"
          },
          "error": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "required": [
          "statusCode",
          "message",
          "error"
        ]
      }
    }
  }
}