{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Call Studio public API",
    "version": "1",
    "description": "Place calls, read their outcomes, keep contacts and the Do-Not-Call list in step, run campaigns, send WhatsApp, SMS and email messages, run saved reports and hear about every call and message through webhooks, from your own systems. A token reaches only the endpoints listed here."
  },
  "servers": [
    {
      "url": "https://aicallstudio.com"
    }
  ],
  "security": [
    {
      "bearerToken": []
    }
  ],
  "paths": {
    "/api/analytics/calls": {
      "get": {
        "tags": [
          "calls"
        ],
        "summary": "List calls",
        "description": "The call log, a page at a time, newest first, with totals for everything that matches.\n\nEach call comes with its outcome, score, summary, cost and who answered it, and `stats` counts\nevery matching call, not just this page. By default the last 30 days; `date_from` and\n`date_to` (IST calendar days) pick a range instead. Test calls are left out unless asked for.\nA page holds at most 200 calls. A recording link expires: fetch the call again when you need it.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page Size"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(newest|oldest)$",
              "description": "By start time: newest or oldest first.",
              "default": "newest",
              "title": "Sort"
            },
            "description": "By start time: newest or oldest first."
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "The last this many days, 1 to 365. date_from overrides it.",
              "default": 30,
              "title": "Days"
            },
            "description": "The last this many days, 1 to 365. date_from overrides it."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The call's status, such as completed, no_answer, busy or failed.",
              "title": "Status"
            },
            "description": "The call's status, such as completed, no_answer, busy or failed."
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Lead classification: hot, warm or cold.",
              "title": "Classification"
            },
            "description": "Lead classification: hot, warm or cold."
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls answered by this AI agent.",
              "title": "Agent Id"
            },
            "description": "Calls answered by this AI agent."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls answered by this AI team.",
              "title": "Team Id"
            },
            "description": "Calls answered by this AI team."
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls with this contact.",
              "title": "Contact Id"
            },
            "description": "Calls with this contact."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "inbound or outbound.",
              "title": "Direction"
            },
            "description": "inbound or outbound."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls this campaign placed.",
              "title": "Campaign Id"
            },
            "description": "Calls this campaign placed."
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls with this outcome key.",
              "title": "Disposition"
            },
            "description": "Calls with this outcome key."
          },
          {
            "name": "initiator",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "What started the call, comma-separated: manual,campaign,web,inbound,workflow,workspace,test,api,callback",
              "title": "Initiator"
            },
            "description": "What started the call, comma-separated: manual,campaign,web,inbound,workflow,workspace,test,api,callback"
          },
          {
            "name": "missed",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true: calls where nobody spoke to the customer (not answered, a machine, or a failed attempt); false: the others.",
              "title": "Missed"
            },
            "description": "true: calls where nobody spoke to the customer (not answered, a machine, or a failed attempt); false: the others."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Text to find in the contact's name, a number on the call, or the summary.",
              "title": "Search"
            },
            "description": "Text to find in the contact's name, a number on the call, or the summary."
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "IST calendar day, YYYY-MM-DD. Beats `days`.",
              "title": "Date From"
            },
            "description": "IST calendar day, YYYY-MM-DD. Beats `days`."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "IST calendar day, inclusive.",
              "title": "Date To"
            },
            "description": "IST calendar day, inclusive."
          },
          {
            "name": "campaign_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only calls a campaign placed.",
              "default": false,
              "title": "Campaign Only"
            },
            "description": "Only calls a campaign placed."
          },
          {
            "name": "did",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated: your own numbers. Matches every stored spelling of each line (+91…, 91…, 0…, national).",
              "title": "Did"
            },
            "description": "Comma-separated: your own numbers. Matches every stored spelling of each line (+91…, 91…, 0…, national)."
          },
          {
            "name": "handover",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "yes",
                    "no",
                    "answered",
                    "missed",
                    "not_rung"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Handed to a person: yes, no, answered (someone came on), missed (someone was rung, nobody came on) or not_rung (nobody was rung: outside the hours).",
              "title": "Handover"
            },
            "description": "Handed to a person: yes, no, answered (someone came on), missed (someone was rung, nobody came on) or not_rung (nobody was rung: outside the hours)."
          },
          {
            "name": "handover_user",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only hand-overs this staff member answered.",
              "title": "Handover User"
            },
            "description": "Only hand-overs this staff member answered."
          },
          {
            "name": "answered_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "agent",
                    "team",
                    "staff"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Any AI agent working alone, any AI team, or staff (a person's own call from the Workspace, no AI on it).",
              "title": "Answered By"
            },
            "description": "Any AI agent working alone, any AI team, or staff (a person's own call from the Workspace, no AI on it)."
          },
          {
            "name": "staff_user",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls this staff member took: hand-overs they answered and calls they dialled from the Workspace.",
              "title": "Staff User"
            },
            "description": "Calls this staff member took: hand-overs they answered and calls they dialled from the Workspace."
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated call ids (at most 500): the rows someone selected.",
              "title": "Ids"
            },
            "description": "Comma-separated call ids (at most 500): the rows someone selected."
          },
          {
            "name": "desk_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it.",
              "title": "Desk Id"
            },
            "description": "Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it."
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "phone",
                    "web"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "What carried the call: phone (a phone line) or web (in a browser). With direction=inbound, web is the website widget's calls.",
              "title": "Channel"
            },
            "description": "What carried the call: phone (a phone line) or web (in a browser). With direction=inbound, web is the website widget's calls."
          },
          {
            "name": "hide_test",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Leave out test calls (the default, as on Home and Analytics). initiator=test shows them regardless.",
              "default": true,
              "title": "Hide Test"
            },
            "description": "Leave out test calls (the default, as on Home and Analytics). initiator=test shows them regardless."
          },
          {
            "name": "scored",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "yes",
                    "no"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the call has a score (Call Scoring's coverage).",
              "title": "Scored"
            },
            "description": "Whether the call has a score (Call Scoring's coverage)."
          },
          {
            "name": "qa",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "graded",
                    "not_graded",
                    "pass",
                    "review",
                    "fail",
                    "disputed"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Call QA: graded, not_graded, or by the call's QA band (the worst of its grades: pass, review, fail), or disputed (a grade with an open dispute).",
              "title": "Qa"
            },
            "description": "Call QA: graded, not_graded, or by the call's QA band (the worst of its grades: pass, review, fail), or disputed (a grade with an open dispute)."
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "ai",
                    "power"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Campaign mode: power (calls a power-dialer campaign placed for your staff) or ai (every other call).",
              "title": "Mode"
            },
            "description": "Campaign mode: power (calls a power-dialer campaign placed for your staff) or ai (every other call)."
          },
          {
            "name": "insights",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "none",
                    "read"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Conversation insights: none (connected, 15 seconds or longer, with a transcript, not read yet: what Intelligence counts as unread) or read.",
              "title": "Insights"
            },
            "description": "Conversation insights: none (connected, 15 seconds or longer, with a transcript, not read yet: what Intelligence counts as unread) or read."
          },
          {
            "name": "call_class",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "ai",
                    "human",
                    "hybrid"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Who worked the call: ai (the AI alone), human (people only) or hybrid (the AI, then a person who came on).",
              "title": "Call Class"
            },
            "description": "Who worked the call: ai (the AI alone), human (people only) or hybrid (the AI, then a person who came on)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallLogPage"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "calls:read"
      }
    },
    "/api/analytics/classification-breakdown": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Calls by classification",
        "description": "Calls counted by lead classification (hot, warm, cold, unclassified), most common first.\n\nBy default the last 30 days; `date_from` and `date_to` (IST calendar days) pick a range instead.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "The last this many days, 1 to 365. date_from overrides it.",
              "default": 30,
              "title": "Days"
            },
            "description": "The last this many days, 1 to 365. date_from overrides it."
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "IST calendar day, YYYY-MM-DD. Beats `days`.",
              "title": "Date From"
            },
            "description": "IST calendar day, YYYY-MM-DD. Beats `days`."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "IST calendar day, inclusive (default today).",
              "title": "Date To"
            },
            "description": "IST calendar day, inclusive (default today)."
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls this AI agent answered.",
              "title": "Agent Id"
            },
            "description": "Only calls this AI agent answered."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls this AI team answered.",
              "title": "Team Id"
            },
            "description": "Only calls this AI team answered."
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "ai",
                    "power"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Campaign mode: power or ai.",
              "title": "Mode"
            },
            "description": "Campaign mode: power or ai."
          },
          {
            "name": "desk_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it.",
              "title": "Desk Id"
            },
            "description": "Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it."
          },
          {
            "name": "staff_user",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "One team member's calls, as Call Logs' Person filter counts them: hand-overs they answered, calls they dialled from the Workspace, and calls passed or put through to them.",
              "title": "Staff User"
            },
            "description": "One team member's calls, as Call Logs' Person filter counts them: hand-overs they answered, calls they dialled from the Workspace, and calls passed or put through to them."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls this campaign placed.",
              "title": "Campaign Id"
            },
            "description": "Calls this campaign placed."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "inbound",
                    "outbound"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls in or out. A web call is inbound, as on Call Logs.",
              "title": "Direction"
            },
            "description": "Calls in or out. A web call is inbound, as on Call Logs."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassificationCount"
                  },
                  "title": "Response 200 Classification Breakdown Api Analytics Classification Breakdown Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "analytics:read"
      }
    },
    "/api/analytics/disposition-breakdown": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Calls by outcome",
        "description": "Calls counted by outcome, most common first, each with its name in your workspace.\n\nBy default the last 30 days; `date_from` and `date_to` (IST calendar days) pick a range instead.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "The last this many days, 1 to 365. date_from overrides it.",
              "default": 30,
              "title": "Days"
            },
            "description": "The last this many days, 1 to 365. date_from overrides it."
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "IST calendar day, YYYY-MM-DD. Beats `days`.",
              "title": "Date From"
            },
            "description": "IST calendar day, YYYY-MM-DD. Beats `days`."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "IST calendar day, inclusive (default today).",
              "title": "Date To"
            },
            "description": "IST calendar day, inclusive (default today)."
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls this AI agent answered.",
              "title": "Agent Id"
            },
            "description": "Only calls this AI agent answered."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls this AI team answered.",
              "title": "Team Id"
            },
            "description": "Only calls this AI team answered."
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "ai",
                    "power"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Campaign mode: power or ai.",
              "title": "Mode"
            },
            "description": "Campaign mode: power or ai."
          },
          {
            "name": "desk_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it.",
              "title": "Desk Id"
            },
            "description": "Calls attributed to this desk: to or from one of its numbers, or handed over through an 'A desk' step and taken by someone on it."
          },
          {
            "name": "staff_user",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "One team member's calls, as Call Logs' Person filter counts them: hand-overs they answered, calls they dialled from the Workspace, and calls passed or put through to them.",
              "title": "Staff User"
            },
            "description": "One team member's calls, as Call Logs' Person filter counts them: hand-overs they answered, calls they dialled from the Workspace, and calls passed or put through to them."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls this campaign placed.",
              "title": "Campaign Id"
            },
            "description": "Calls this campaign placed."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "inbound",
                    "outbound"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls in or out. A web call is inbound, as on Call Logs.",
              "title": "Direction"
            },
            "description": "Calls in or out. A web call is inbound, as on Call Logs."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispositionCount"
                  },
                  "title": "Response 200 Disposition Breakdown Api Analytics Disposition Breakdown Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "analytics:read"
      }
    },
    "/api/analytics/summary": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Call summary",
        "description": "Call totals for the last `days` days: calls, connected calls, minutes, duration and score.\n\nA connected call is one someone picked up; an answering machine does not count.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "The period: the last this many days, 1 to 365.",
              "default": 30,
              "title": "Days"
            },
            "description": "The period: the last this many days, 1 to 365."
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls this AI agent answered.",
              "title": "Agent Id"
            },
            "description": "Only calls this AI agent answered."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls this AI team answered.",
              "title": "Team Id"
            },
            "description": "Only calls this AI team answered."
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "ai",
                    "power"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Campaign mode: power or ai.",
              "title": "Mode"
            },
            "description": "Campaign mode: power or ai."
          },
          {
            "name": "campaign_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Count only calls a campaign placed.",
              "default": false,
              "title": "Campaign Only"
            },
            "description": "Count only calls a campaign placed."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSummary"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "analytics:read"
      }
    },
    "/api/calls/dial": {
      "post": {
        "tags": [
          "calls"
        ],
        "summary": "Place a call",
        "description": "Ring one number now, with an AI agent or team speaking. A real call, billed like any other.\n\nSend `phone` (a 10-digit Indian mobile) or `contact_id`, and exactly one of `agent_id` or\n`team_id`. The same checks as any outbound call apply first: the plan, Do-Not-Call, the\nagent's calling hours and the calls-at-once limits. The answer means ringing has started, not\nthat anyone picked up: the outcome arrives with the call.completed webhook and in the call log.\n\n`variables` fills your agent's script for this person (a name, an amount, a due date): they\nare saved on the contact, and a number that is not a contact yet is saved as one, under `name`.\nSend an Idempotency-Key header so that a retried request never rings the person twice.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManualDialRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DialStarted"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The plan has no calls left, or does not include this voice tier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. The number cannot be called: on a Do-Not-Call or Do-Not-Disturb list, no consent, or outside the workspace's calling window.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The agent, team or contact was not found, or is switched off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The call cannot start now: the plan's calls-at-once limit, the agent's own limit, the agent's calling hours, a draft or paused agent, or no phone line to call from.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The call could not be started. Nothing was rung; try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Calling is halted for a moment by the platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "calls:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "x-billable": true
      }
    },
    "/api/contacts": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "List contacts",
        "description": "List your contacts, a page at a time.\n\nEvery filter is optional, and they combine. A page holds at most 200 contacts: read `total`,\nthen ask for the next `page` until you have them all. Deleted contacts are never listed.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page Size"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Words found anywhere in the name, email or number, in any order. A number matches in any format.",
              "title": "Search"
            },
            "description": "Words found anywhere in the name, email or number, in any order. A number matches in any format."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The contact's status, such as new.",
              "title": "Status"
            },
            "description": "The contact's status, such as new."
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Lead classification: hot, warm or cold.",
              "title": "Classification"
            },
            "description": "Lead classification: hot, warm or cold."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Where the contact came from, exactly as the contact's source field says.",
              "title": "Source"
            },
            "description": "Where the contact came from, exactly as the contact's source field says."
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The contact's latest outcome key.",
              "title": "Disposition"
            },
            "description": "The contact's latest outcome key."
          },
          {
            "name": "min_score",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call scored at least this (0 to 100).",
              "title": "Min Score"
            },
            "description": "Has a call scored at least this (0 to 100)."
          },
          {
            "name": "max_score",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call scored at most this (0 to 100).",
              "title": "Max Score"
            },
            "description": "Has a call scored at most this (0 to 100)."
          },
          {
            "name": "min_duration",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call at least this many seconds long.",
              "title": "Min Duration"
            },
            "description": "Has a call at least this many seconds long."
          },
          {
            "name": "max_duration",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call at most this many seconds long.",
              "title": "Max Duration"
            },
            "description": "Has a call at most this many seconds long."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call placed by this campaign.",
              "title": "Campaign Id"
            },
            "description": "Has a call placed by this campaign."
          },
          {
            "name": "lead_set",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The lead set the contact was imported into.",
              "title": "Lead Set"
            },
            "description": "The lead set the contact was imported into."
          },
          {
            "name": "dnd",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true: only Do-Not-Call contacts; false: only callable ones.",
              "title": "Dnd"
            },
            "description": "true: only Do-Not-Call contacts; false: only callable ones."
          },
          {
            "name": "needs",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "callback",
                    "stale_high"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "callback: a call back is owed; stale_high: hot, callable, and not rung in the last 7 days.",
              "title": "Needs"
            },
            "description": "callback: a call back is owed; stale_high: hot, callable, and not rung in the last 7 days."
          },
          {
            "name": "added_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Added at or after this time (ISO 8601).",
              "title": "Added From"
            },
            "description": "Added at or after this time (ISO 8601)."
          },
          {
            "name": "added_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Added at or before this time (ISO 8601).",
              "title": "Added To"
            },
            "description": "Added at or before this time (ISO 8601)."
          },
          {
            "name": "added_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 366,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Added in the last N days",
              "title": "Added Days"
            },
            "description": "Added in the last N days"
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call answered by this AI agent.",
              "title": "Agent Id"
            },
            "description": "Has a call answered by this AI agent."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call answered by this AI team.",
              "title": "Team Id"
            },
            "description": "Has a call answered by this AI team."
          },
          {
            "name": "answered_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "agent",
                    "team"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call answered by any AI agent working alone, or by any AI team.",
              "title": "Answered By"
            },
            "description": "Has a call answered by any AI agent working alone, or by any AI team."
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Given to: a team member's user id, or `none`",
              "title": "Assigned To"
            },
            "description": "Given to: a team member's user id, or `none`"
          },
          {
            "name": "last_message_status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 12
                },
                {
                  "type": "null"
                }
              ],
              "description": "The latest campaign message to the contact has this status (delivered, read, replied, failed...)",
              "title": "Last Message Status"
            },
            "description": "The latest campaign message to the contact has this status (delivered, read, replied, failed...)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "name",
                "source",
                "score",
                "last_called",
                "added"
              ],
              "type": "string",
              "default": "name",
              "title": "Sort"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "active",
                "held"
              ],
              "type": "string",
              "description": "held: contacts held over the plan's contact limit",
              "default": "active",
              "title": "View"
            },
            "description": "held: contacts held over the plan's contact limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPage"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "contacts:read"
      },
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Create a contact",
        "description": "Add one contact.\n\n`name` and `phone` are required. One number is one contact: the same number in another format\n(\"98765 43210\", \"+919876543210\") is refused with 409. A number deleted earlier brings that\ncontact back with its history. Adding a contact starts the workspace's New Contact workflows,\nas adding one by hand does, and those may call or message the person.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The plan's contact limit is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A contact already has this number, in any format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ]
      }
    },
    "/api/contacts/export": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Export contacts",
        "description": "Download every contact matching the filters as one file, CSV or Excel.\n\nThe same filters as listing contacts, in one file with no paging. Pass `ids` to export just\nthose contacts (at most 1,000), still inside the other filters.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "csv or xlsx",
              "default": "csv",
              "title": "Format"
            },
            "description": "csv or xlsx"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Words found anywhere in the name, email or number, in any order. A number matches in any format.",
              "title": "Search"
            },
            "description": "Words found anywhere in the name, email or number, in any order. A number matches in any format."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The contact's status, such as new.",
              "title": "Status"
            },
            "description": "The contact's status, such as new."
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Lead classification: hot, warm or cold.",
              "title": "Classification"
            },
            "description": "Lead classification: hot, warm or cold."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Where the contact came from, exactly as the contact's source field says.",
              "title": "Source"
            },
            "description": "Where the contact came from, exactly as the contact's source field says."
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The contact's latest outcome key.",
              "title": "Disposition"
            },
            "description": "The contact's latest outcome key."
          },
          {
            "name": "min_score",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call scored at least this (0 to 100).",
              "title": "Min Score"
            },
            "description": "Has a call scored at least this (0 to 100)."
          },
          {
            "name": "max_score",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call scored at most this (0 to 100).",
              "title": "Max Score"
            },
            "description": "Has a call scored at most this (0 to 100)."
          },
          {
            "name": "min_duration",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call at least this many seconds long.",
              "title": "Min Duration"
            },
            "description": "Has a call at least this many seconds long."
          },
          {
            "name": "max_duration",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call at most this many seconds long.",
              "title": "Max Duration"
            },
            "description": "Has a call at most this many seconds long."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call placed by this campaign.",
              "title": "Campaign Id"
            },
            "description": "Has a call placed by this campaign."
          },
          {
            "name": "lead_set",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The lead set the contact was imported into.",
              "title": "Lead Set"
            },
            "description": "The lead set the contact was imported into."
          },
          {
            "name": "dnd",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true: only Do-Not-Call contacts; false: only callable ones.",
              "title": "Dnd"
            },
            "description": "true: only Do-Not-Call contacts; false: only callable ones."
          },
          {
            "name": "needs",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "callback",
                    "stale_high"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "callback: a call back is owed; stale_high: hot, callable, and not rung in the last 7 days.",
              "title": "Needs"
            },
            "description": "callback: a call back is owed; stale_high: hot, callable, and not rung in the last 7 days."
          },
          {
            "name": "added_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Added at or after this time (ISO 8601).",
              "title": "Added From"
            },
            "description": "Added at or after this time (ISO 8601)."
          },
          {
            "name": "added_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Added at or before this time (ISO 8601).",
              "title": "Added To"
            },
            "description": "Added at or before this time (ISO 8601)."
          },
          {
            "name": "added_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 366,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Added in the last N days",
              "title": "Added Days"
            },
            "description": "Added in the last N days"
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call answered by this AI agent.",
              "title": "Agent Id"
            },
            "description": "Has a call answered by this AI agent."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call answered by this AI team.",
              "title": "Team Id"
            },
            "description": "Has a call answered by this AI team."
          },
          {
            "name": "answered_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "agent",
                    "team"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Has a call answered by any AI agent working alone, or by any AI team.",
              "title": "Answered By"
            },
            "description": "Has a call answered by any AI agent working alone, or by any AI team."
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Given to: a team member's user id, or `none`",
              "title": "Assigned To"
            },
            "description": "Given to: a team member's user id, or `none`"
          },
          {
            "name": "last_message_status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 12
                },
                {
                  "type": "null"
                }
              ],
              "description": "The latest campaign message to the contact has this status (delivered, read, replied, failed...)",
              "title": "Last Message Status"
            },
            "description": "The latest campaign message to the contact has this status (delivered, read, replied, failed...)"
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated contact ids: export just this selection",
              "title": "Ids"
            },
            "description": "Comma-separated contact ids: export just this selection"
          }
        ],
        "responses": {
          "200": {
            "description": "The file, as an attachment: CSV by default, an Excel workbook with format=xlsx.",
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/csv": {},
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "contacts:read"
      }
    },
    "/api/sources/import/csv": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Import contacts from a file",
        "description": "Import contacts from a spreadsheet: one contact per row.\n\nSend the file as multipart/form-data. Rows without a name or a dialable phone number are\nskipped and listed in `errors`. A number already in the workspace updates that contact, or is\nskipped with dedupe=skip. New contacts over the plan's contact limit are saved but held, and\ncounted in `held`. New contacts start the New Contact workflows, which may call or message\nthem. One import runs in a workspace at a time, and an address may start at most 3 a minute.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_import_csv_api_sources_import_csv_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResultOut"
                }
              }
            }
          },
          "400": {
            "description": "The file is not .csv or .xlsx, is empty, cannot be read, or has no name or phone column.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The file is over 50 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ]
      }
    },
    "/api/v1/agents": {
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "List agents",
        "description": "Your AI agents, by name, with whether each takes real calls now. Use an agent's id to place\na call or book a call-back.",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PublicAgent"
                  },
                  "type": "array",
                  "title": "Response List Agents Api V1 Agents Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "agents:read"
      }
    },
    "/api/v1/callbacks": {
      "post": {
        "tags": [
          "calls"
        ],
        "summary": "Schedule a call-back",
        "description": "Book an AI call to one person at a set time. A real call, billed like any other.\n\nSend `contact_id`, or `phone` (and `name`) for a number that is not a contact yet, and exactly\none of `agent_id` or `team_id`. When the time comes the usual checks run first: Do-Not-Call,\nyour calling window and the agent's calling hours, and the wallet. A call-back that falls\noutside the hours moves to the next opening. It shows in the Workspace's call-backs list, and\ncan be cancelled until it rings.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__schemas__public_api__CallbackIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallbackOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow. The number is on Do-Not-Call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact, agent or team was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The agent or team is a draft or paused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "calls:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "x-billable": true
      }
    },
    "/api/v1/callbacks/{callback_id}": {
      "delete": {
        "tags": [
          "calls"
        ],
        "summary": "Cancel a call-back",
        "description": "Cancel a booked call-back before it rings. Nobody is called.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "callback_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Callback Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallbackOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No call-back of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "It already rang, or was already cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "calls:write",
        "x-billable": true
      }
    },
    "/api/v1/calls": {
      "get": {
        "tags": [
          "calls"
        ],
        "summary": "List calls",
        "description": "Your calls, newest first, a page at a time.\n\nEach call carries its outcome, lead score and summary. For the transcript, what was captured and\nthe recording, fetch the call by id. Test calls from the dashboard are left out. Page with\n`cursor`: pass the `next_cursor` of one page to get the next, until it is null.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls with this status, such as completed or no-answer.",
              "title": "Status"
            },
            "description": "Only calls with this status, such as completed or no-answer."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "inbound or outbound.",
              "title": "Direction"
            },
            "description": "inbound or outbound."
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls with this outcome key.",
              "title": "Disposition"
            },
            "description": "Only calls with this outcome key."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Campaign Id"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Team Id"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Contact Id"
            }
          },
          {
            "name": "room",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "description": "The `room` that placing a call answered with.",
              "title": "Room"
            },
            "description": "The `room` that placing a call answered with."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls that started at or after this moment (ISO 8601, with a time zone).",
              "title": "Since"
            },
            "description": "Calls that started at or after this moment (ISO 8601, with a time zone)."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calls that started before this moment.",
              "title": "Until"
            },
            "description": "Calls that started before this moment."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Calls per page.",
              "default": 50,
              "title": "Limit"
            },
            "description": "Calls per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "`next_cursor` from the previous page.",
              "title": "Cursor"
            },
            "description": "`next_cursor` from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallList"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "calls:read"
      }
    },
    "/api/v1/calls/{call_id}": {
      "get": {
        "tags": [
          "calls"
        ],
        "summary": "Get a call",
        "description": "One call with its transcript, what it captured and its outcome.\n\n`recording_url` is a link to play the recording that works for a short time; it is filled only\nwhen the token has the `recordings:read` scope and the call was recorded. Fetch the call again\nfor a fresh link rather than storing one.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Call Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCallDetail"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No call of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "calls:read"
      }
    },
    "/api/v1/campaigns": {
      "get": {
        "tags": [
          "campaigns"
        ],
        "summary": "List campaigns",
        "description": "Your campaigns, newest first. Deleted campaigns are left out.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only campaigns with this status, such as running.",
              "title": "Status"
            },
            "description": "Only campaigns with this status, such as running."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "`next_cursor` from the previous page.",
              "title": "Cursor"
            },
            "description": "`next_cursor` from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignList"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "campaigns:read"
      }
    },
    "/api/v1/campaigns/{campaign_id}/contacts": {
      "post": {
        "tags": [
          "campaigns"
        ],
        "summary": "Add contacts to a campaign",
        "description": "Add people to a calling campaign. While it runs they are rung like everyone else in it:\nwithin its schedule, your calling window and the plan's limits. Each call is billed.\n\nSend `contacts` (found or saved by number, as Add or update a contact does) or `contact_ids`.\nA contact on Do-Not-Call is never added; one already in the campaign is not added twice.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Campaign Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignContactsIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignContactsOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No calling campaign of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The campaign has finished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "campaigns:write",
        "x-billable": true
      }
    },
    "/api/v1/campaigns/{campaign_id}/pause": {
      "post": {
        "tags": [
          "campaigns"
        ],
        "summary": "Pause a campaign",
        "description": "Stop a running campaign from placing new calls. Calls already ringing finish.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Campaign Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCampaign"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No campaign of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The campaign is not running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "campaigns:write",
        "x-billable": true
      }
    },
    "/api/v1/campaigns/{campaign_id}/resume": {
      "post": {
        "tags": [
          "campaigns"
        ],
        "summary": "Resume a campaign",
        "description": "Start a paused campaign calling again. It rings real customers and each call is billed.\n\nThe same checks as pressing Resume on the Campaigns page apply: the plan, a phone line, the\nschedule and your calling window. If the campaign paused itself (an empty wallet, say) and the\nreason still holds, it pauses again and says why in `paused_reason`.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Campaign Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCampaign"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The plan's campaign limit is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No campaign of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The campaign is not paused, or has no phone line to call from.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "campaigns:write",
        "x-billable": true
      }
    },
    "/api/v1/campaigns/{campaign_id}/stats": {
      "get": {
        "tags": [
          "campaigns"
        ],
        "summary": "Campaign progress",
        "description": "How far a calling campaign has got: people it may ring, rung and reached, and today's calls.\nCounted the way the Campaigns page counts them.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Campaign Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignStats"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No campaign of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "campaigns:read"
      }
    },
    "/api/v1/contacts": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Add or update a contact",
        "description": "Add a contact, or update the one that already has this number. Never makes a duplicate.\n\nThe number is the key: the same number in any format (\"98765 43210\", \"+919876543210\") is the\nsame contact. A known number is updated with the fields you send, and your own fields are\nmerged in; a new number needs a `name` and is added, which starts your New Contact workflows,\nas adding one by hand does (those may call or message the person). `created` says which.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsert"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactUpserted"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The plan's contact limit is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ]
      }
    },
    "/api/v1/contacts/bulk": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Add or update many contacts",
        "description": "Add or update up to 100 contacts in one request, each exactly as one would be.\n\nOne result per contact, in the order sent. A contact that cannot be saved (a bad number, a\nmissing required field, the plan's limit) is reported with its reason and does not stop the\nothers. The same number twice in one request is one contact.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpsertIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "contacts:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ]
      }
    },
    "/api/v1/contacts/{contact_id}": {
      "patch": {
        "tags": [
          "contacts"
        ],
        "summary": "Update a contact",
        "description": "Change some of a contact's fields. A field you leave out is kept; your own fields are merged.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contact Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicContact"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No contact of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Another contact already has the new number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "contacts:write"
      }
    },
    "/api/v1/contacts/{contact_id}/erasure": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Erase a person's data",
        "description": "Delete one person and their call history, for an erasure request under India's data\nprotection law. It cannot be undone.\n\nThe contact and every call with them are deleted now. Their recordings stop being playable at\nonce and are deleted after our review. If the number is on your Do-Not-Call list it stays there,\nso they are not called again.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contact Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErasureOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No contact of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "contacts:erase"
      }
    },
    "/api/v1/dnc": {
      "post": {
        "tags": [
          "dnc"
        ],
        "summary": "Add a number to Do-Not-Call",
        "description": "Put a number on your Do-Not-Call list. It is never called again, by any campaign, workflow\nor person, until it is taken off. Every contact with the number is marked.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__schemas__public_api__DncIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DncOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "dnc:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ]
      }
    },
    "/api/v1/dnc/{phone}": {
      "delete": {
        "tags": [
          "dnc"
        ],
        "summary": "Take a number off Do-Not-Call",
        "description": "Take a number off your Do-Not-Call list, so it may be called again straight away. Do this\nonly when the person asked to be called again: their opt-out is a legal obligation.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Phone"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DncOut"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "dnc:write"
      }
    },
    "/api/v1/messages/email": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send an email",
        "description": "Send one plain-text email to one contact, through your email connection. A real message,\nbilled per message.\n\nAn address that bounced or complained is never sent to, nor a contact on Do-Not-Call or who\nwithdrew consent, and nothing goes in the quiet hours. It is written on the contact's timeline.\nRequires an Idempotency-Key header.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailSendIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSent"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The wallet cannot cover this message's fee, or the plan does not include this channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or the connection was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not sent: Do-Not-Call, no consent, the customer turned off offers, the address is suppressed, quiet hours, or the connection is not active or not set up. `detail` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "428": {
            "description": "No Idempotency-Key header. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The channel did not take the message. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "messages:send",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. Required here: without it the request is refused with 428 and nothing is sent.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "x-billable": true
      }
    },
    "/api/v1/messages/sms": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send an SMS",
        "description": "Send the SMS connection's registered template to one person. A real message, billed per message.\n\nOnly the registered template goes (India's DLT rules), never free text. Do-Not-Call, consent and\nthe quiet hours apply. It is written on the contact's timeline. Requires an Idempotency-Key header.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsSendIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSent"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The wallet cannot cover this message's fee, or the plan does not include this channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or the connection was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not sent: Do-Not-Call, no consent, the customer turned off offers, the address is suppressed, quiet hours, or the connection is not active or not set up. `detail` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "428": {
            "description": "No Idempotency-Key header. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The channel did not take the message. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "messages:send",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. Required here: without it the request is refused with 428 and nothing is sent.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "x-billable": true
      }
    },
    "/api/v1/messages/whatsapp": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send a WhatsApp template",
        "description": "Send one approved WhatsApp template to one person. A real message, billed per message.\n\nThe same checks as the inbox: the template must be approved for the connection, a customer on\nDo-Not-Call or without consent is never messaged, one who turned off offers is not sent a\nmarketing template, and nothing goes in the quiet hours. The message lands in the WhatsApp inbox\nand the contact's timeline (the inbox.message_sent webhook); delivered and read follow as the\nchannel reports them. Requires an Idempotency-Key header.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsAppSendIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSent"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access. The wallet cannot cover this message's fee, or the plan does not include this channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or the connection was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not sent: Do-Not-Call, no consent, the customer turned off offers, the address is suppressed, quiet hours, or the connection is not active or not set up. `detail` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "428": {
            "description": "No Idempotency-Key header. Nothing was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The channel did not take the message. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "messages:send",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Any unique text up to 255 characters, such as a UUID, chosen by you for this request. Sent again with the same body within 24 hours, the first answer comes back (with Idempotent-Replayed: true) and nothing is done twice. The same key with another body is refused with 422. Required here: without it the request is refused with 428 and nothing is sent.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "x-billable": true
      }
    },
    "/api/v1/reports": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "List saved reports",
        "description": "Your saved custom reports and dashboards (Reports -> Custom): the ones shared with the workspace\nand the key creator's own. Archived ones are left out. Use an id to run one.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^(report|dashboard)$"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only reports, or only dashboards.",
              "title": "Kind"
            },
            "description": "Only reports, or only dashboards."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportList"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "reports:read"
      }
    },
    "/api/v1/reports/{report_id}/run": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Run a saved report",
        "description": "Run a saved custom report or dashboard now and get its figures, exactly as the Custom reports\nscreen would show them to the key's owner. A report comes as JSON or CSV; a dashboard as JSON.\nEach run is a real query, capped at 10 seconds, and a key may run 30 a minute.",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Report Id"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(json|csv)$",
              "description": "json, or csv for a report's table.",
              "default": "json",
              "title": "Format"
            },
            "description": "json, or csv for a report's table."
          }
        ],
        "responses": {
          "200": {
            "description": "JSON, or with format=csv the report's table as a CSV file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportRun"
                }
              },
              "text/csv": {}
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No saved report of yours has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not in the form this endpoint takes. `detail` says which, and why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Reports are switched off on the platform for now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scope": "reports:read"
      }
    },
    "/api/v1/wallet": {
      "get": {
        "tags": [
          "wallet"
        ],
        "summary": "Wallet and this month's usage",
        "description": "What the wallet holds, and what calls have used this calendar month (India time) so far.",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Wallet"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing, unknown or revoked, or its workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The workspace's plan does not include API access. The token is paused, not revoked: it works again as soon as the plan includes API access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have this endpoint's scope, it is a sandbox token, the workspace is suspended, or the request came from a network the workspace, or the token's IP allowlist, does not allow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "This token has made more requests this minute than your plan allows. The Retry-After header says how many seconds to wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-scope": "wallet:read"
      }
    }
  },
  "components": {
    "schemas": {
      "AnalyticsSummary": {
        "properties": {
          "period_days": {
            "type": "integer",
            "title": "Period Days",
            "description": "The period counted: the last `days` days."
          },
          "total_calls": {
            "type": "integer",
            "title": "Total Calls"
          },
          "completed_calls": {
            "type": "integer",
            "title": "Completed Calls",
            "description": "Calls someone picked up. The same number as `connected_calls`."
          },
          "connected_calls": {
            "type": "integer",
            "title": "Connected Calls",
            "description": "Calls someone picked up. An answering machine does not count."
          },
          "completion_rate": {
            "type": "number",
            "title": "Completion Rate",
            "description": "Connected calls as a percentage of all calls, to one decimal place."
          },
          "total_billed_minutes": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Billed Minutes",
            "description": "Minutes billed for these calls."
          },
          "avg_duration_sec": {
            "type": "number",
            "title": "Avg Duration Sec"
          },
          "avg_qa_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Qa Score",
            "description": "Average lead score of the scored calls; null when none was scored."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "period_days",
          "total_calls",
          "completed_calls",
          "connected_calls",
          "completion_rate",
          "avg_duration_sec"
        ],
        "title": "AnalyticsSummary",
        "description": "Call totals for a period."
      },
      "Body_import_csv_api_sources_import_csv_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "description": "A .csv or .xlsx file with a header row. It needs a name and a phone column. At most 50 MB."
          },
          "lead_set": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Set",
            "description": "A lead set to put every imported contact in."
          },
          "clean_names": {
            "type": "boolean",
            "title": "Clean Names",
            "description": "true tidies each name: title case, honorifics and extra spaces removed.",
            "default": false
          },
          "dedupe": {
            "type": "string",
            "title": "Dedupe",
            "description": "A number that is already a contact: update (the default) refreshes that contact, skip leaves it.",
            "default": "update"
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type",
            "description": "The contact type every row is imported as."
          },
          "mapping": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mapping",
            "description": "JSON: which column fills each field, as {\"field name\": \"Column header\"}."
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_import_csv_api_sources_import_csv_post"
      },
      "BulkUpsertIn": {
        "properties": {
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/ContactUpsert"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Contacts",
            "description": "1 to 100 contacts."
          }
        },
        "type": "object",
        "required": [
          "contacts"
        ],
        "title": "BulkUpsertIn"
      },
      "BulkUpsertItem": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "The position of this contact in the list you sent, from 0."
          },
          "created": {
            "type": "boolean",
            "title": "Created",
            "default": false
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Why this one was not saved; null when it was."
          }
        },
        "type": "object",
        "required": [
          "index"
        ],
        "title": "BulkUpsertItem"
      },
      "BulkUpsertOut": {
        "properties": {
          "created": {
            "type": "integer",
            "title": "Created"
          },
          "updated": {
            "type": "integer",
            "title": "Updated"
          },
          "failed": {
            "type": "integer",
            "title": "Failed"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/BulkUpsertItem"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "created",
          "updated",
          "failed",
          "results"
        ],
        "title": "BulkUpsertOut",
        "description": "One result per contact sent, in the order sent. One failing does not stop the others."
      },
      "CallList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicCall"
            },
            "type": "array",
            "title": "Data"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor",
            "description": "Pass as `cursor` for the next page; null on the last page."
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "CallList",
        "description": "One page of calls, newest first."
      },
      "CallLogItem": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direction",
            "description": "inbound or outbound."
          },
          "initiator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initiator",
            "description": "What started the call: manual, campaign, web, inbound, workflow, workspace, test, api or callback. Null on older calls."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "duration_sec": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Sec"
          },
          "billed_minutes": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Minutes"
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification",
            "description": "Lead classification: hot, warm or cold."
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition",
            "description": "The call's outcome key."
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score",
            "description": "Lead score, 0 to 100."
          },
          "sentiment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sentiment"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost",
            "description": "What the call cost in all, in rupees."
          },
          "languages_used": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Languages Used"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "team_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Name"
          },
          "answered_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answered By",
            "description": "The name of the agent, team or person who took the call."
          },
          "placed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Placed By",
            "description": "The person who placed the call, when a person did."
          },
          "campaign_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign Id"
          },
          "campaign_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign Name"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id",
            "description": "Null when there is no contact, or it was deleted."
          },
          "contact_deleted": {
            "type": "boolean",
            "title": "Contact Deleted",
            "default": false
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          },
          "did": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Did",
            "description": "Your own number on the call."
          },
          "has_recording": {
            "type": "boolean",
            "title": "Has Recording",
            "default": false
          },
          "recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Url",
            "description": "A link to play the recording. It expires: fetch it when you need it."
          },
          "missed": {
            "type": "boolean",
            "title": "Missed",
            "description": "Nobody spoke to the customer: not answered, a machine, or a failed attempt.",
            "default": false
          },
          "disposed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposed By",
            "description": "Who set the outcome."
          },
          "callback_requested": {
            "type": "boolean",
            "title": "Callback Requested",
            "default": false
          },
          "callback_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Time"
          },
          "handover": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Handover",
            "description": "Handed to a person: answered, missed or not_rung; null if never."
          },
          "qa": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallQA"
              },
              {
                "type": "null"
              }
            ],
            "description": "The call's quality grade; null when it was never graded."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "id"
        ],
        "title": "CallLogItem",
        "description": "One call in the call log: the fields most integrations use. More may appear."
      },
      "CallLogPage": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CallLogItem"
            },
            "type": "array",
            "title": "Items"
          },
          "stats": {
            "$ref": "#/components/schemas/CallLogStats"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "items",
          "stats"
        ],
        "title": "CallLogPage",
        "description": "One page of the call log."
      },
      "CallLogStats": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Calls matching the filters, across every page."
          },
          "completed": {
            "type": "integer",
            "title": "Completed",
            "description": "Of those, calls someone picked up."
          },
          "talk_minutes": {
            "type": "integer",
            "title": "Talk Minutes"
          },
          "total_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost",
            "description": "What those calls cost in all, in rupees."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "total",
          "completed",
          "talk_minutes"
        ],
        "title": "CallLogStats"
      },
      "CallQA": {
        "properties": {
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "band": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Band",
            "description": "pass, review or fail: the worst band among the call's grades."
          },
          "disputed": {
            "type": "boolean",
            "title": "Disputed",
            "default": false
          },
          "grades": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Grades"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "title": "CallQA"
      },
      "CallbackOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "contact_id": {
            "type": "string",
            "format": "uuid",
            "title": "Contact Id"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "title": "At"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "booked, or cancelled."
          }
        },
        "type": "object",
        "required": [
          "id",
          "contact_id",
          "at",
          "status"
        ],
        "title": "CallbackOut",
        "description": "A booked call-back."
      },
      "CampaignContactsIn": {
        "properties": {
          "contacts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ContactUpsert"
                },
                "type": "array",
                "maxItems": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Contacts",
            "description": "Contacts to add, found or saved by number (1 to 100). Send this or contact_ids."
          },
          "contact_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array",
                "maxItems": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Ids",
            "description": "Existing contacts to add, by id."
          }
        },
        "type": "object",
        "title": "CampaignContactsIn"
      },
      "CampaignContactsOut": {
        "properties": {
          "added": {
            "type": "integer",
            "title": "Added"
          },
          "already": {
            "type": "integer",
            "title": "Already"
          },
          "skipped_do_not_call": {
            "type": "integer",
            "title": "Skipped Do Not Call"
          },
          "not_found": {
            "type": "integer",
            "title": "Not Found"
          },
          "failed": {
            "items": {
              "$ref": "#/components/schemas/BulkUpsertItem"
            },
            "type": "array",
            "title": "Failed",
            "description": "Contacts in `contacts` that could not be saved."
          }
        },
        "type": "object",
        "required": [
          "added",
          "already",
          "skipped_do_not_call",
          "not_found"
        ],
        "title": "CampaignContactsOut",
        "description": "What adding did. A contact on Do-Not-Call, or already in the campaign, is not added again."
      },
      "CampaignList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicCampaign"
            },
            "type": "array",
            "title": "Data"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "CampaignList",
        "description": "One page of campaigns, newest first."
      },
      "CampaignStats": {
        "properties": {
          "campaign_id": {
            "type": "string",
            "format": "uuid",
            "title": "Campaign Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "contacts_total": {
            "type": "integer",
            "title": "Contacts Total",
            "description": "People the campaign may ring in all."
          },
          "contacts_dialled": {
            "type": "integer",
            "title": "Contacts Dialled",
            "description": "Of those, people it has rung."
          },
          "contacts_reached": {
            "type": "integer",
            "title": "Contacts Reached",
            "description": "People who picked up (an answering machine does not count)."
          },
          "calls_today": {
            "type": "integer",
            "title": "Calls Today",
            "description": "Calls the campaign placed today, India time."
          },
          "connected_today": {
            "type": "integer",
            "title": "Connected Today",
            "description": "Of those, calls someone picked up."
          }
        },
        "type": "object",
        "required": [
          "campaign_id",
          "status",
          "contacts_total",
          "contacts_dialled",
          "contacts_reached",
          "calls_today",
          "connected_today"
        ],
        "title": "CampaignStats",
        "description": "A campaign's progress now."
      },
      "ClassificationCount": {
        "properties": {
          "classification": {
            "type": "string",
            "title": "Classification",
            "description": "hot, warm, cold, or unclassified."
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "classification",
          "count"
        ],
        "title": "ClassificationCount"
      },
      "ContactCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "title": "Name",
            "description": "The person's name."
          },
          "phone": {
            "type": "string",
            "maxLength": 20,
            "title": "Phone",
            "description": "8 to 15 digits, optionally starting with +. Stored in one canonical form."
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Optional. Must look like name@example.com."
          },
          "custom_fields": {
            "additionalProperties": true,
            "type": "object",
            "title": "Custom Fields",
            "description": "Your own fields for this contact, by field name. A contact type's required fields must be here."
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type",
            "description": "The contact type's key, which decides the fields it needs. Blank: general."
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source",
            "description": "Where the contact came from, in your words."
          },
          "dnd_flag": {
            "type": "boolean",
            "title": "Dnd Flag",
            "description": "true puts the number on Do-Not-Call: it is never rung.",
            "default": false
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "new"
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification",
            "description": "hot, warm or cold."
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition",
            "description": "An outcome key defined in your workspace."
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language",
            "description": "The language the person prefers, as a code or a name, such as hi-IN or Hindi."
          }
        },
        "type": "object",
        "required": [
          "name",
          "phone"
        ],
        "title": "ContactCreate"
      },
      "ContactListItem": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "phone": {
            "type": "string",
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification"
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition"
          },
          "dnd_flag": {
            "type": "boolean",
            "title": "Dnd Flag"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "last_called_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Called At"
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "assigned_user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned User Id"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "phone",
          "email",
          "lead_type",
          "status",
          "classification",
          "disposition",
          "dnd_flag"
        ],
        "title": "ContactListItem"
      },
      "ContactOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "phone": {
            "type": "string",
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "custom_fields": {
            "additionalProperties": true,
            "type": "object",
            "title": "Custom Fields"
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "dnd_flag": {
            "type": "boolean",
            "title": "Dnd Flag"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification"
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "best_time": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Best Time"
          },
          "assigned_user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned User Id"
          },
          "wa_marketing_opt_out_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Wa Marketing Opt Out At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "name",
          "phone",
          "email",
          "custom_fields",
          "lead_type",
          "source",
          "dnd_flag",
          "status",
          "classification",
          "disposition"
        ],
        "title": "ContactOut"
      },
      "ContactPage": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Contacts matching the filters, across every page."
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "sort": {
            "type": "string",
            "title": "Sort"
          },
          "order": {
            "type": "string",
            "title": "Order"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ContactListItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "sort",
          "order",
          "items"
        ],
        "title": "ContactPage",
        "description": "One page of contacts."
      },
      "ContactPatch": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "A new number. Refused if another contact has it."
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "custom_fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Fields",
            "description": "Merged into the contact's: a field you leave out is kept."
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification",
            "description": "hot, warm or cold."
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition",
            "description": "An outcome key defined in your workspace."
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          }
        },
        "type": "object",
        "title": "ContactPatch",
        "description": "The fields to change. A field you leave out is kept."
      },
      "ContactUpsert": {
        "properties": {
          "phone": {
            "type": "string",
            "maxLength": 20,
            "title": "Phone",
            "description": "8 to 15 digits, optionally starting with +. The same number in any format is the same contact."
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Required for a new number; for a known one it renames it."
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "custom_fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Fields",
            "description": "Your own fields, by field name. Merged into the contact's: a field you leave out is kept."
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type",
            "description": "The contact type's key, which decides the fields it needs."
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Source",
            "description": "Where the contact came from, in your words."
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language",
            "description": "The language the person prefers, as a code or a name, such as hi-IN."
          }
        },
        "type": "object",
        "required": [
          "phone"
        ],
        "title": "ContactUpsert",
        "description": "A contact, found by its number."
      },
      "ContactUpserted": {
        "properties": {
          "created": {
            "type": "boolean",
            "title": "Created",
            "description": "true when the number was new and a contact was added."
          },
          "contact": {
            "$ref": "#/components/schemas/PublicContact"
          }
        },
        "type": "object",
        "required": [
          "created",
          "contact"
        ],
        "title": "ContactUpserted",
        "description": "What one upsert did."
      },
      "DialStarted": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Always dialing: the number is being rung."
          },
          "phone": {
            "type": "string",
            "title": "Phone",
            "description": "The number rung, with +91."
          },
          "answerer": {
            "type": "string",
            "title": "Answerer",
            "description": "The name of the agent or team that will speak."
          },
          "room": {
            "type": "string",
            "title": "Room",
            "description": "An id for this call attempt."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "status",
          "phone",
          "answerer",
          "room"
        ],
        "title": "DialStarted",
        "description": "A call that was started. It has not been answered yet."
      },
      "DispositionCount": {
        "properties": {
          "disposition": {
            "type": "string",
            "title": "Disposition",
            "description": "The outcome key, or unknown for calls with none."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The outcome's name in your workspace."
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Group",
            "description": "The group the outcome belongs to."
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "disposition",
          "label",
          "count"
        ],
        "title": "DispositionCount"
      },
      "DncOut": {
        "properties": {
          "phone": {
            "type": "string",
            "title": "Phone"
          },
          "on_list": {
            "type": "boolean",
            "title": "On List",
            "description": "Whether the number is on the Do-Not-Call list now."
          },
          "changed": {
            "type": "boolean",
            "title": "Changed",
            "description": "false when it already was (adding) or already was not (removing)."
          }
        },
        "type": "object",
        "required": [
          "phone",
          "on_list",
          "changed"
        ],
        "title": "DncOut"
      },
      "EmailSendIn": {
        "properties": {
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id",
            "description": "The contact to send to. Send this or the address."
          },
          "channel_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Id",
            "description": "The connection to send through (Integrations). Left out, the workspace's active connection of this kind is used; with more than one, this is required."
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "The address to send to when you do not send contact_id. It must be a contact's address."
          },
          "subject": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Subject"
          },
          "body": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Body",
            "description": "The message, as plain text."
          }
        },
        "type": "object",
        "required": [
          "subject",
          "body"
        ],
        "title": "EmailSendIn"
      },
      "ErasureOut": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "description": "erased."
          },
          "contact_id": {
            "type": "string",
            "format": "uuid",
            "title": "Contact Id"
          },
          "calls_removed": {
            "type": "integer",
            "title": "Calls Removed"
          },
          "recordings_deletion_requested": {
            "type": "integer",
            "title": "Recordings Deletion Requested",
            "description": "Recordings of those calls we were asked to delete. They are deleted after our review and cannot be played meanwhile."
          }
        },
        "type": "object",
        "required": [
          "status",
          "contact_id",
          "calls_removed",
          "recordings_deletion_requested"
        ],
        "title": "ErasureOut",
        "description": "What an erasure removed."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ImportResultOut": {
        "properties": {
          "source_id": {
            "type": "string",
            "format": "uuid",
            "title": "Source Id",
            "description": "The import, as a lead source in your workspace."
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "New contacts added."
          },
          "updated": {
            "type": "integer",
            "title": "Updated",
            "description": "Existing contacts refreshed from the file."
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped",
            "description": "Rows not imported: rows with a problem (see errors), and existing contacts with dedupe=skip."
          },
          "held": {
            "type": "integer",
            "title": "Held",
            "description": "New contacts over the plan's contact limit: saved, and held until the plan has room.",
            "default": 0
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Errors",
            "description": "Why each skipped row was skipped, by row number."
          }
        },
        "type": "object",
        "required": [
          "source_id",
          "created",
          "updated",
          "skipped",
          "errors"
        ],
        "title": "ImportResultOut"
      },
      "ManualDialRequest": {
        "properties": {
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "A 10-digit Indian mobile number starting with 6 to 9, without +91. Send this or contact_id."
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id",
            "description": "A contact to call, by id: the contact's own number is rung."
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id",
            "description": "The AI agent that speaks. Send this or team_id, not both."
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id",
            "description": "The AI team that speaks. Send this or agent_id, not both."
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "The person's name. A number that is not a contact yet is saved as one under this name; for a known contact it is left as it is."
          },
          "variables": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables",
            "description": "Values your agent's script uses, by name: {\"amount\": \"12,500\", \"due_date\": \"5 December\"} fills {amount} and {due_date}. Up to 30, each name lower-case letters, digits and _, each value up to 500 characters. They are saved on the contact as its fields, so the next call has them too."
          }
        },
        "type": "object",
        "title": "ManualDialRequest"
      },
      "MessageSent": {
        "properties": {
          "channel": {
            "type": "string",
            "title": "Channel",
            "description": "whatsapp, sms or email."
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "sent, or queued when the channel takes it for later delivery. Delivery and reads arrive as webhooks."
          },
          "contact_id": {
            "type": "string",
            "format": "uuid",
            "title": "Contact Id"
          },
          "message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message Id",
            "description": "The channel's id for the message, when it gives one."
          },
          "fee_inr": {
            "type": "number",
            "title": "Fee Inr",
            "description": "What this message cost from your wallet (0 when your plan includes it). The channel's own charge is billed by the channel."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "channel",
          "status",
          "contact_id",
          "fee_inr"
        ],
        "title": "MessageSent",
        "description": "One message, accepted by the channel."
      },
      "PublicAgent": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language",
            "description": "The agent's main language, as a code such as hi-IN."
          },
          "multilingual": {
            "type": "boolean",
            "title": "Multilingual",
            "default": false
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "live (takes real calls), draft (not switched on yet) or paused."
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "status"
        ],
        "title": "PublicAgent"
      },
      "PublicCall": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "completed, no-answer, failed, voicemail or busy."
          },
          "direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direction",
            "description": "inbound or outbound."
          },
          "initiator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initiator",
            "description": "What started the call: manual, campaign, web, inbound, workflow, workspace, api or callback."
          },
          "room": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Room",
            "description": "The call attempt's id, the same `room` that placing a call answers with."
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "answered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answered At",
            "description": "When the customer picked up; null when nobody did."
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "billed_minutes": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Minutes"
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition",
            "description": "The call's outcome key."
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification",
            "description": "Lead classification: hot, warm or cold."
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score",
            "description": "Lead score, 0 to 100."
          },
          "sentiment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sentiment"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "campaign_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign Id"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "from_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Number"
          },
          "to_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "To Number"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "PublicCall",
        "description": "One call. Lists carry these fields; one call by id adds the transcript and what was captured."
      },
      "PublicCallDetail": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "completed, no-answer, failed, voicemail or busy."
          },
          "direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direction",
            "description": "inbound or outbound."
          },
          "initiator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initiator",
            "description": "What started the call: manual, campaign, web, inbound, workflow, workspace, api or callback."
          },
          "room": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Room",
            "description": "The call attempt's id, the same `room` that placing a call answers with."
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "answered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answered At",
            "description": "When the customer picked up; null when nobody did."
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "billed_minutes": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Minutes"
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition",
            "description": "The call's outcome key."
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification",
            "description": "Lead classification: hot, warm or cold."
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score",
            "description": "Lead score, 0 to 100."
          },
          "sentiment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sentiment"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "campaign_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign Id"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "from_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Number"
          },
          "to_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "To Number"
          },
          "disposition_label": {
            "type": "string",
            "title": "Disposition Label",
            "description": "The outcome in your workspace's own words.",
            "default": ""
          },
          "captured_fields": {
            "additionalProperties": true,
            "type": "object",
            "title": "Captured Fields",
            "description": "What the call captured, by field name: the values your agent was asked to collect, such as a promised payment date or a site-visit slot."
          },
          "captured_lead": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Captured Lead",
            "description": "The lead the agent saved during the call, when it saved one."
          },
          "transcript": {
            "type": "string",
            "title": "Transcript",
            "description": "The conversation as text, one line per turn, each labelled with who spoke.",
            "default": ""
          },
          "transcript_turns": {
            "items": {
              "$ref": "#/components/schemas/TranscriptTurn"
            },
            "type": "array",
            "title": "Transcript Turns"
          },
          "handover": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Handover",
            "description": "When the call was handed to a person: how that went."
          },
          "cost_inr": {
            "type": "number",
            "title": "Cost Inr",
            "description": "What the call has cost so far, in rupees.",
            "default": 0
          },
          "has_recording": {
            "type": "boolean",
            "title": "Has Recording",
            "default": false
          },
          "recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Url",
            "description": "A link to play the recording, valid for a short time: fetch it when you need it. Null unless the token has the `recordings:read` scope and the call was recorded."
          },
          "recording_tracks": {
            "items": {
              "$ref": "#/components/schemas/RecordingTrack"
            },
            "type": "array",
            "title": "Recording Tracks",
            "description": "One recording per speaker (the customer, the AI, a person who joined), when the call kept them. Each `url` follows the same rule as `recording_url`."
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "PublicCallDetail",
        "description": "One call with everything an integration usually needs."
      },
      "PublicCampaign": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "draft, scheduled, running, paused, completed or cancelled."
          },
          "mode": {
            "type": "string",
            "title": "Mode",
            "description": "ai (an AI agent calls), power (your people call), whatsapp, sms or email."
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "paused_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paused Reason",
            "description": "Why the campaign paused itself, such as wallet_empty; null when a person paused it or it is not paused."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "mode"
        ],
        "title": "PublicCampaign"
      },
      "PublicContact": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "phone": {
            "type": "string",
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "custom_fields": {
            "additionalProperties": true,
            "type": "object",
            "title": "Custom Fields",
            "description": "Your own fields. The platform's own keys (starting with _) are left out."
          },
          "lead_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Type"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "classification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification"
          },
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "do_not_call": {
            "type": "boolean",
            "title": "Do Not Call",
            "default": false
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "phone"
        ],
        "title": "PublicContact"
      },
      "PublicReport": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "type": "string",
            "title": "Kind",
            "description": "report or dashboard."
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source",
            "description": "What a report counts (calls, messages and so on), in words."
          },
          "shared": {
            "type": "boolean",
            "title": "Shared",
            "description": "Shared with the workspace, or kept by the key's owner."
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "kind",
          "shared"
        ],
        "title": "PublicReport"
      },
      "RecordingTrack": {
        "properties": {
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind",
            "description": "Whose voice it is: customer, ai, staff or supervisor."
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "Who it is, in words."
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "A short-lived link to play it; null without `recordings:read`."
          },
          "missing": {
            "type": "boolean",
            "title": "Missing",
            "description": "The file could not be found in storage.",
            "default": false
          }
        },
        "type": "object",
        "title": "RecordingTrack"
      },
      "ReportList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicReport"
            },
            "type": "array",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ReportList"
      },
      "ReportRun": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result",
            "description": "A report: its columns, rows, totals and range, as the Custom reports screen shows them."
          },
          "pages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages",
            "description": "A dashboard: each page with its widgets' figures."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "id",
          "name",
          "kind"
        ],
        "title": "ReportRun",
        "description": "A saved report or dashboard, run now as the key's owner sees it."
      },
      "SmsSendIn": {
        "properties": {
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id",
            "description": "The contact to send to. Send this or the address."
          },
          "channel_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Id",
            "description": "The connection to send through (Integrations). Left out, the workspace's active connection of this kind is used; with more than one, this is required."
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "The number to send to when you do not send contact_id. A new number is saved as a contact."
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "The person's name, for a new number."
          },
          "template": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Template",
            "description": "The SMS connection's registered template, by its name or id. Only that template is sent, never free text (India's DLT rules)."
          },
          "values": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "maxProperties": 20,
            "title": "Values",
            "description": "The template's variables by name."
          }
        },
        "type": "object",
        "required": [
          "template"
        ],
        "title": "SmsSendIn"
      },
      "TranscriptTurn": {
        "properties": {
          "speaker": {
            "type": "string",
            "title": "Speaker",
            "description": "lead, agent, staff or supervisor."
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "The person's name, when a person spoke."
          }
        },
        "type": "object",
        "required": [
          "speaker",
          "text"
        ],
        "title": "TranscriptTurn"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "Wallet": {
        "properties": {
          "balance_inr": {
            "type": "number",
            "title": "Balance Inr"
          },
          "low_balance_mark_inr": {
            "type": "number",
            "title": "Low Balance Mark Inr",
            "description": "Below this the wallet.low_balance webhook is sent."
          },
          "month_spend_inr": {
            "type": "number",
            "title": "Month Spend Inr",
            "description": "Spent from the wallet this calendar month so far."
          },
          "month_calls": {
            "type": "integer",
            "title": "Month Calls",
            "description": "Calls this calendar month so far."
          },
          "month_billed_minutes": {
            "type": "number",
            "title": "Month Billed Minutes"
          },
          "included_minutes": {
            "type": "integer",
            "title": "Included Minutes",
            "description": "The plan's included minutes a month."
          },
          "included_minutes_left": {
            "type": "number",
            "title": "Included Minutes Left"
          }
        },
        "type": "object",
        "required": [
          "balance_inr",
          "low_balance_mark_inr",
          "month_spend_inr",
          "month_calls",
          "month_billed_minutes",
          "included_minutes",
          "included_minutes_left"
        ],
        "title": "Wallet",
        "description": "The workspace's money, India time."
      },
      "WhatsAppSendIn": {
        "properties": {
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id",
            "description": "The contact to send to. Send this or the address."
          },
          "channel_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Id",
            "description": "The connection to send through (Integrations). Left out, the workspace's active connection of this kind is used; with more than one, this is required."
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "The number to send to when you do not send contact_id: 8 to 15 digits, optionally starting with +. A new number is saved as a contact (send `name` for it)."
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "The person's name, for a new number."
          },
          "template": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Template",
            "description": "The name of a WhatsApp template approved for this connection. Only approved templates are sent; free text is not, because the 24-hour window may be closed."
          },
          "values": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "maxProperties": 20,
            "title": "Values",
            "description": "The template's blanks by their number or name, such as {\"1\": \"Asha\", \"2\": \"12,500\"}. A blank left out is filled from the contact where it can be."
          }
        },
        "type": "object",
        "required": [
          "template"
        ],
        "title": "WhatsAppSendIn"
      },
      "app__schemas__public_api__CallbackIn": {
        "properties": {
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id",
            "description": "The contact to call back. Send this or phone."
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "The number to call back, if it is not a contact yet: 8 to 15 digits, optionally starting with +. It is saved as a contact."
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "The person's name, for a new number."
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id",
            "description": "The AI agent that calls. Send this or team_id, not both."
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id",
            "description": "The AI team that calls. Send this or agent_id, not both."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "title": "At",
            "description": "When to call, with a time zone (2026-12-01T10:30:00+05:30). In the future, at most 30 days ahead."
          }
        },
        "type": "object",
        "required": [
          "at"
        ],
        "title": "CallbackIn"
      },
      "app__schemas__public_api__DncIn": {
        "properties": {
          "phone": {
            "type": "string",
            "maxLength": 20,
            "minLength": 3,
            "title": "Phone",
            "description": "The number never to call, in any format."
          }
        },
        "type": "object",
        "required": [
          "phone"
        ],
        "title": "DncIn"
      },
      "Error": {
        "type": "object",
        "title": "Error",
        "description": "Every error answer. `detail` is a sentence to show or log; for a 422 it may be a list of the fields at fault. `code` is a fixed word to branch on, and `request_id` names the request in your Developers page logs.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            ]
          },
          "code": {
            "type": "string",
            "description": "bad_request, unauthorized, plan_required, forbidden, not_found, conflict, invalid_request, rate_limited, idempotency_key_reused, idempotency_in_progress, idempotency_key_required, server_error, unavailable."
          },
          "request_id": {
            "type": "string",
            "description": "The same as the X-Request-Id header."
          }
        },
        "required": [
          "detail",
          "code",
          "request_id"
        ]
      }
    },
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "A token from Settings, Developers, sent as `Authorization: Bearer mtc_...`."
      }
    }
  },
  "x-token": {
    "prefix": "mtc_",
    "sandbox_prefix": "mtc_sandbox_",
    "rate_limit": "60/minute",
    "rate_limits_by_plan": {
      "Starter": 60,
      "Growth": 60,
      "Professional": 120,
      "Enterprise": 300
    },
    "scopes": [
      "agents:read",
      "analytics:read",
      "calls:read",
      "calls:write",
      "campaigns:read",
      "campaigns:write",
      "contacts:erase",
      "contacts:read",
      "contacts:write",
      "dnc:write",
      "messages:send",
      "recordings:read",
      "reports:read",
      "wallet:read"
    ],
    "billable_scopes": [
      "calls:write",
      "campaigns:write",
      "messages:send"
    ]
  },
  "x-conventions": {
    "idempotency": {
      "header": "Idempotency-Key",
      "replayed_header": "Idempotent-Replayed",
      "ttl_hours": 24,
      "applies_to": "Every POST, PATCH and DELETE.",
      "required_for_scopes": [
        "messages:send"
      ]
    },
    "request_id_header": "X-Request-Id",
    "paging": "Lists answer {data, next_cursor}. Pass next_cursor as `cursor` for the next page; it is null on the last page."
  },
  "x-webhooks": {
    "events": [
      "call.started",
      "call.completed",
      "call.no_answer",
      "call.failed",
      "call.handed_over",
      "call.wrapped_up",
      "lead.captured",
      "contact.opted_out",
      "message.delivered",
      "message.read",
      "message.replied",
      "campaign.status_changed",
      "campaign.completed",
      "qa.graded",
      "wallet.low_balance",
      "inbox.message_received",
      "inbox.message_sent"
    ],
    "event_details": [
      {
        "event": "call.started",
        "description": "A call was answered: the customer picked up an outgoing call, or an incoming call was taken.",
        "sample": {
          "call": {
            "room": "sample-room-1a2b3c4d",
            "direction": "outbound",
            "agent_id": "00000000-0000-0000-0000-000000000003",
            "team_id": null,
            "contact_id": "00000000-0000-0000-0000-000000000002",
            "campaign_id": null,
            "initiator": "api",
            "answered_at": "2026-11-27T10:30:05+05:30"
          }
        }
      },
      {
        "event": "call.completed",
        "description": "A call ended and its outcome is known: answered, or not (no answer, voicemail, failed).",
        "sample": {
          "call": {
            "id": "00000000-0000-0000-0000-000000000001",
            "contact_id": "00000000-0000-0000-0000-000000000002",
            "campaign_id": null,
            "agent_id": "00000000-0000-0000-0000-000000000003",
            "direction": "outbound",
            "status": "completed",
            "duration_seconds": 94,
            "disposition": "interested",
            "disposition_label": "Interested",
            "classification": "hot",
            "score": 82,
            "summary": "Asked for a site visit on Saturday.",
            "transcript": "Agent: Hello, am I speaking with Asha?\nLead: Yes.",
            "transcript_turns": [
              {
                "speaker": "agent",
                "text": "Hello, am I speaking with Asha?"
              },
              {
                "speaker": "lead",
                "text": "Yes."
              }
            ],
            "placed_by": {
              "kind": "ai_agent",
              "id": "00000000-0000-0000-0000-000000000003",
              "name": "Priya"
            },
            "cost_inr": 4.5,
            "disposition_by": "ai"
          }
        }
      },
      {
        "event": "call.no_answer",
        "description": "An outgoing call was not answered: no answer, busy, or an answering machine.",
        "sample": {
          "call": {
            "id": "00000000-0000-0000-0000-000000000001",
            "contact_id": "00000000-0000-0000-0000-000000000002",
            "campaign_id": null,
            "agent_id": "00000000-0000-0000-0000-000000000003",
            "direction": "outbound",
            "status": "no-answer",
            "reason": "no-answer",
            "room": "sample-room-1a2b3c4d"
          }
        }
      },
      {
        "event": "call.failed",
        "description": "An outgoing call could not be connected at all.",
        "sample": {
          "call": {
            "id": "00000000-0000-0000-0000-000000000001",
            "contact_id": "00000000-0000-0000-0000-000000000002",
            "campaign_id": null,
            "agent_id": "00000000-0000-0000-0000-000000000003",
            "direction": "outbound",
            "status": "failed",
            "reason": "dial_failed",
            "room": "sample-room-1a2b3c4d"
          }
        }
      },
      {
        "event": "call.handed_over",
        "description": "The AI tried to hand a call to a person. `outcome` says whether someone took it.",
        "sample": {
          "call": {
            "room": "sample-room-1a2b3c4d",
            "contact_id": "00000000-0000-0000-0000-000000000002",
            "agent_id": "00000000-0000-0000-0000-000000000003",
            "team_id": null
          },
          "outcome": "connected",
          "reason": "The customer asked for a person.",
          "to": "Collections desk",
          "attempt": 1
        }
      },
      {
        "event": "call.wrapped_up",
        "description": "A person saved their wrap-up for a call after call.completed: the outcome they chose.",
        "sample": {
          "call": {
            "id": "00000000-0000-0000-0000-000000000001",
            "contact_id": "00000000-0000-0000-0000-000000000002",
            "disposition": "promise_to_pay",
            "disposition_label": "Promise to pay",
            "disposition_by": "staff",
            "previous_disposition": "callback",
            "wrap_up": {
              "note": "Will pay on the 5th."
            }
          }
        }
      },
      {
        "event": "lead.captured",
        "description": "A finished call captured details: the fields your agent collects, and the lead it saved.",
        "sample": {
          "call_id": "00000000-0000-0000-0000-000000000001",
          "contact_id": "00000000-0000-0000-0000-000000000002",
          "campaign_id": null,
          "fields": {
            "promise_date": "2026-12-05",
            "amount": "12500"
          },
          "lead": {
            "name": "Asha Verma",
            "phone": "+919876543210"
          }
        }
      },
      {
        "event": "contact.opted_out",
        "description": "A number went on the Do-Not-Call list: asked on a call, replied STOP, or added by someone.",
        "sample": {
          "phone": "9876543210",
          "contact_id": "00000000-0000-0000-0000-000000000002",
          "source": "auto",
          "call_id": "00000000-0000-0000-0000-000000000001"
        }
      },
      {
        "event": "message.delivered",
        "description": "A WhatsApp, SMS or email message reached the person. `channel` says which.",
        "sample": {
          "message": {
            "id": "00000000-0000-0000-0000-000000000004",
            "channel": "whatsapp",
            "status": "delivered",
            "campaign_id": "00000000-0000-0000-0000-000000000005",
            "contact_id": "00000000-0000-0000-0000-000000000002"
          }
        }
      },
      {
        "event": "message.read",
        "description": "A WhatsApp message was read, or an email opened.",
        "sample": {
          "message": {
            "id": "00000000-0000-0000-0000-000000000004",
            "channel": "whatsapp",
            "status": "read",
            "campaign_id": "00000000-0000-0000-0000-000000000005",
            "contact_id": "00000000-0000-0000-0000-000000000002"
          }
        }
      },
      {
        "event": "message.replied",
        "description": "The person replied to a message.",
        "sample": {
          "message": {
            "id": "00000000-0000-0000-0000-000000000004",
            "channel": "whatsapp",
            "status": "replied",
            "campaign_id": "00000000-0000-0000-0000-000000000005",
            "contact_id": "00000000-0000-0000-0000-000000000002"
          }
        }
      },
      {
        "event": "campaign.status_changed",
        "description": "A campaign started, paused, finished or was deleted.",
        "sample": {
          "campaign_id": "00000000-0000-0000-0000-000000000005",
          "status": "paused"
        }
      },
      {
        "event": "campaign.completed",
        "description": "A campaign finished: everyone it may ring has been rung.",
        "sample": {
          "campaign_id": "00000000-0000-0000-0000-000000000005",
          "status": "completed"
        }
      },
      {
        "event": "qa.graded",
        "description": "A call was graded against a quality scorecard.",
        "sample": {
          "call_id": "00000000-0000-0000-0000-000000000001",
          "scorecard": "Collections quality",
          "score": 86,
          "band": "pass",
          "graded": "agent"
        }
      },
      {
        "event": "wallet.low_balance",
        "description": "The wallet went below the low-balance mark. Top up before calls stop.",
        "sample": {
          "balance_inr": 180,
          "low_balance_mark_inr": 200
        }
      },
      {
        "event": "inbox.message_received",
        "description": "A customer wrote to you on WhatsApp: a message arrived in the inbox.",
        "sample": {
          "message": {
            "id": "00000000-0000-0000-0000-000000000006",
            "channel": "whatsapp",
            "direction": "inbound",
            "text": "Can I pay on Friday?",
            "kind": "text",
            "at": "2026-11-28T10:30:05+05:30",
            "contact_id": "00000000-0000-0000-0000-000000000002"
          },
          "contact": {
            "name": "Asha Verma",
            "phone": "+919876543210"
          }
        }
      },
      {
        "event": "inbox.message_sent",
        "description": "A WhatsApp message went to a customer one to one: from the inbox, the call screen or the API.",
        "sample": {
          "message": {
            "id": "00000000-0000-0000-0000-000000000007",
            "channel": "whatsapp",
            "direction": "outbound",
            "text": "Your EMI of Rs 12,500 is due on 5 December.",
            "template": "emi_reminder",
            "status": "sent",
            "via": "api",
            "at": "2026-11-28T10:31:00+05:30",
            "contact_id": "00000000-0000-0000-0000-000000000002"
          },
          "contact": {
            "name": "Asha Verma",
            "phone": "+919876543210"
          }
        }
      }
    ],
    "message_events": "One event per kind (message.delivered, message.read, message.replied) for every channel; the message's `channel` says whether it was WhatsApp, SMS or email.",
    "inbox_events": "inbox.message_received and inbox.message_sent are one-to-one WhatsApp messages (the inbox, the call screen and the sending API), not campaign messages.",
    "test_event": "test",
    "signature_header": "X-Aicallstudio-Signature",
    "event_header": "X-Aicallstudio-Event",
    "delivery_header": "X-Aicallstudio-Delivery",
    "signature": "sha256=<hex HMAC-SHA256 of the raw request body, keyed with the webhook's signing secret>",
    "secret_prefix": "whsec_",
    "body": [
      "event",
      "data",
      "ts",
      "id"
    ],
    "timeout_seconds": 10,
    "max_retries": 5,
    "retry_waits_seconds": [
      60,
      120,
      240,
      480,
      960
    ],
    "auto_pause_after_failures": 50
  },
  "x-changelog": [
    {
      "date": "2026-11-28",
      "version": "1",
      "changes": [
        "Send messages: POST /api/v1/messages/whatsapp (an approved template), /sms (your registered template) and /email, to one contact, with the scope messages:send. Each is a real message, billed per message like a campaign message, with the same Do-Not-Call, consent, opt-out, quiet-hours, 24-hour-window and template checks as the dashboard. Idempotency-Key is required on these (428 without it).",
        "Reports: GET /api/v1/reports lists your saved custom reports and dashboards; GET /api/v1/reports/{report_id}/run runs one as JSON, or a report as CSV (format=csv), with the scope reports:read.",
        "New webhook events: inbox.message_received and inbox.message_sent (one-to-one WhatsApp).",
        "Each key can have an IP allowlist (CIDR blocks): a request from anywhere else is refused with 403. Keys show their age, and the workspace is reminded to replace one after 90 days (changeable per key)."
      ]
    },
    {
      "date": "2026-11-27",
      "version": "1",
      "changes": [
        "New endpoints under /api/v1: list and get calls (transcript, captured fields, recording link), schedule and cancel call-backs, add or update contacts by number (one or up to 100), update a contact, erase a person, the Do-Not-Call list, campaigns (list, progress, add contacts, pause, resume), agents and the wallet.",
        "Placing a call takes `name` and `variables` to fill your agent's script.",
        "Idempotency-Key on every write, cursor paging on lists, one error shape with `code` and `request_id`, and an X-Request-Id on every answer.",
        "Rate limits by plan.",
        "New scopes: recordings:read, contacts:erase, dnc:write, campaigns:read, campaigns:write, agents:read, wallet:read.",
        "New webhook events: call.started, call.no_answer, call.failed, call.handed_over, lead.captured, contact.opted_out, message.delivered, message.read, message.replied, campaign.completed, qa.graded, wallet.low_balance. Send test event works for each."
      ]
    },
    {
      "date": "2026-11-09",
      "version": "1",
      "changes": [
        "The first public endpoints: contacts (list, export, add, import), calls (call log, place a call) and analytics, and the call.completed, call.wrapped_up and campaign.status_changed webhooks."
      ]
    }
  ]
}