{
  "swagger": "2.0",
  "info": {
    "title": "pingx.ai API",
    "version": "v1",
    "description": "Public API for the pingx.ai platform. Authenticate with an API key (Authorization: Bearer pk_live_...). See https://docs.pingx.ai for guides."
  },
  "tags": [
    {
      "name": "WhatsApp",
      "description": "WhatsApp Business: numbers, messages, templates, media, contacts and labels, groups, campaigns, reports, Team Inbox chats, opt-out, auto-responses, flows and commerce."
    },
    {
      "name": "Voice",
      "description": "Place AI and human-bridged calls, read call history, transcripts and recordings, and manage voice numbers and human operators."
    },
    {
      "name": "Agents",
      "description": "Configure AI agents, knowledge bases and sources, web-chat links and custom fields, and chat with an agent over text."
    },
    {
      "name": "Analytics",
      "description": "Aggregated metrics: NPS trend, branch leaderboard, custom call metrics and call volume. Read-only."
    },
    {
      "name": "Contact memory",
      "description": "Inspect and correct what AI agents remember about contacts: facts, todos and suppressions."
    },
    {
      "name": "Billing",
      "description": "Your organization's balance, credit changes and usage. Read-only."
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/agents/v1/agents": {
      "get": {
        "summary": "Lists the organization's agents (personas), ordered by id.",
        "operationId": "AgentsService_ListAgents",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListAgentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Maximum agents to return (default 50, max 200).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "post": {
        "summary": "Creates an agent. Only name, systemPrompt and knowledgeBaseIds can be\nset at creation; the other settings start at their defaults (generic chat\nand call playbooks, female voice, filler words and background audio off)\nand are changed afterwards with UpdateAgent. Not idempotent: each call\ncreates a new agent. INVALID_ARGUMENT if name is empty or a knowledge base\nid is not in the organization.",
        "operationId": "AgentsService_CreateAgent",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateAgentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateAgentRequest"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/agents/{agentId}": {
      "get": {
        "summary": "Returns one agent with its full configuration. NOT_FOUND if the agent does\nnot exist in the organization.",
        "operationId": "AgentsService_GetAgent",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetAgentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Id of the agent to read.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "delete": {
        "summary": "Permanently deletes an agent (any agent, including the organization's last\none). Its web-chat link stops working. Not reversible. NOT_FOUND if the\nagent does not exist (so a repeated delete returns NOT_FOUND).",
        "operationId": "AgentsService_DeleteAgent",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteAgentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Id of the agent to delete.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      },
      "patch": {
        "summary": "Partially updates an agent: only the fields present in the request change;\nomitted fields keep their stored value. Idempotent. The script, when\nchanged, is normalized by an AI pass before saving (can take up to a few\nminutes) and the processed text is what is stored. ABORTED if the script\nwas changed by another save while this one was being processed (re-read\nand retry). FAILED_PRECONDITION when enabling supportEscalationEnabled\nwithout JIRA and Google Chat connected in the app. NOT_FOUND for an\nunknown agent.",
        "operationId": "AgentsService_UpdateAgent",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateAgentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Id of the agent to update.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AgentsServiceUpdateAgentBody"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/agents/{agentId}/web-chat": {
      "get": {
        "summary": "Returns whether the agent's web-chat link is enabled and its token. The\ntoken is a bearer capability to chat with the agent publicly: treat it as\nsensitive. NOT_FOUND for an unknown agent.",
        "operationId": "AgentsService_GetWebChatLink",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetWebChatLinkResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Id of the agent.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      }
    },
    "/agents/v1/agents/{agentId}/web-chat:disable": {
      "post": {
        "summary": "Revokes the agent's web-chat link immediately; the old token never works\nagain (re-enabling mints a new one). Idempotent: succeeds when no link is\nactive. NOT_FOUND for an unknown agent.",
        "operationId": "AgentsService_DisableWebChat",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DisableWebChatResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Id of the agent.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/agents/{agentId}/web-chat:enable": {
      "post": {
        "summary": "Enables the agent's public web-chat page and returns its link token.\nIdempotent: while a link is active the same token is returned; a new token\nis minted only after DisableWebChat. NOT_FOUND for an unknown agent.",
        "operationId": "AgentsService_EnableWebChat",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1EnableWebChatResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Id of the agent.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/chat/conversations": {
      "post": {
        "summary": "Starts a text conversation with an agent and returns its id; send turns\nwith SendChatMessage. The server keeps the history. Not idempotent.\nNOT_FOUND for an unknown agent.",
        "operationId": "AgentsService_StartChatConversation",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1StartChatConversationResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1StartChatConversationRequest"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/chat/conversations/{conversationId}/messages": {
      "post": {
        "summary": "Sends one user message and returns the agent's complete reply (the\nrequest/response form of the streaming the app chat; the reply is\nassembled server-side). Can take tens of seconds. Not idempotent: each\ncall appends a turn. NOT_FOUND if the conversation does not belong to the\norganization; UNAVAILABLE if the assistant is temporarily unavailable.",
        "operationId": "AgentsService_SendChatMessage",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/pingxAgentsV1SendChatMessageResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "conversationId",
            "description": "Conversation id from StartChatConversation.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1AgentsServiceSendChatMessageBody"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/custom-fields": {
      "get": {
        "summary": "Lists custom fields visible for a scope (see ListCustomFieldsRequest),\ndefault-scope fields first, then the scope's own, by position.",
        "operationId": "AgentsService_ListCustomFields",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListCustomFieldsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "scopeType",
            "description": "\"default\" returns only the org-wide fields; \"agent\" (with agentId)\nreturns org-wide plus that agent's own; \"human_operators\" returns org-wide\nplus the shared operator set. Required.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Required when scopeType is \"agent\".",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "pageSize",
            "description": "Maximum fields to return (default 50, max 200).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "post": {
        "summary": "Creates a custom field. The key is immutable afterwards and must be unique\nacross scope classes. INVALID_ARGUMENT for a bad scope, empty\nkey/label/description, minValue >= maxValue, or a key already in use;\nNOT_FOUND for an unknown agentId.",
        "operationId": "AgentsService_CreateCustomField",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateCustomFieldResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateCustomFieldRequest"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/custom-fields/{customFieldId}": {
      "delete": {
        "summary": "Deletes a custom field (stored historical values are left untouched).\nNOT_FOUND if unknown.",
        "operationId": "AgentsService_DeleteCustomField",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteCustomFieldResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "customFieldId",
            "description": "Id of the custom field to delete.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      },
      "patch": {
        "summary": "Partially updates a custom field's label, description, range or position;\nomitted fields keep their value. scope, agent and key cannot change.\nIdempotent. NOT_FOUND if unknown.",
        "operationId": "AgentsService_UpdateCustomField",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateCustomFieldResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "customFieldId",
            "description": "Id of the custom field to update.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AgentsServiceUpdateCustomFieldBody"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/knowledge-bases": {
      "get": {
        "summary": "Lists the organization's knowledge bases (without their sources: use\nGetKnowledgeBase or ListKnowledgeSources for those), ordered by id.",
        "operationId": "AgentsService_ListKnowledgeBases",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListKnowledgeBasesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Maximum knowledge bases to return (default 50, max 200).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "post": {
        "summary": "Creates an empty knowledge base. Attach it to agents through\nCreateAgent/UpdateAgent knowledgeBaseIds. Not idempotent.",
        "operationId": "AgentsService_CreateKnowledgeBase",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateKnowledgeBaseResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateKnowledgeBaseRequest"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/knowledge-bases/{knowledgeBaseId}": {
      "get": {
        "summary": "Returns one knowledge base including all its sources and their ingestion\nstatus. NOT_FOUND if it does not exist in the organization.",
        "operationId": "AgentsService_GetKnowledgeBase",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetKnowledgeBaseResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "knowledgeBaseId",
            "description": "Id of the knowledge base.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "delete": {
        "summary": "Permanently deletes a knowledge base with all its sources and their\nindexed content; agents lose the attachment. NOT_FOUND if unknown.",
        "operationId": "AgentsService_DeleteKnowledgeBase",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteKnowledgeBaseResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "knowledgeBaseId",
            "description": "Id of the knowledge base to delete.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      },
      "patch": {
        "summary": "Renames a knowledge base. Idempotent. NOT_FOUND if unknown.",
        "operationId": "AgentsService_UpdateKnowledgeBase",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateKnowledgeBaseResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "knowledgeBaseId",
            "description": "Id of the knowledge base to rename.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AgentsServiceUpdateKnowledgeBaseBody"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/knowledge-bases/{knowledgeBaseId}/sources": {
      "get": {
        "summary": "Lists the sources of one knowledge base, ordered by id. Use this (or\nGetKnowledgeSource) to poll ingestion status.",
        "operationId": "AgentsService_ListKnowledgeSources",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListKnowledgeSourcesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "knowledgeBaseId",
            "description": "Id of the knowledge base whose sources to list.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "pageSize",
            "description": "Maximum sources to return (default 50, max 200).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "post": {
        "summary": "Adds a source to a knowledge base and starts ingesting it (extract, chunk,\nembed) in the background. Returns immediately with status \"pending\"; poll\nGetKnowledgeSource until ingestionFinished. Exactly one payload (text,\nurl, file or site) must be set. Not idempotent: each call adds a source.\nINVALID_ARGUMENT for a missing payload/url/filename or a file over 10 MB;\nNOT_FOUND if the knowledge base is unknown.",
        "operationId": "AgentsService_AddKnowledgeSource",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddKnowledgeSourceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "knowledgeBaseId",
            "description": "Id of the knowledge base to add the source to.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AgentsServiceAddKnowledgeSourceBody"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/knowledge-sources/{sourceId}": {
      "get": {
        "summary": "Returns one source. This is the call to poll after AddKnowledgeSource,\nUpdateKnowledgeSource or RecrawlKnowledgeSource: repeat it every few\nseconds until ingestionFinished is true (status ready, partial or\nfailed). Sites can take minutes; check the pages_* counters for progress.",
        "operationId": "AgentsService_GetKnowledgeSource",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetKnowledgeSourceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sourceId",
            "description": "Id of the source to read (and poll).",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:read"
      },
      "delete": {
        "summary": "Deletes one source and its indexed content. NOT_FOUND if unknown.",
        "operationId": "AgentsService_DeleteKnowledgeSource",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteKnowledgeSourceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sourceId",
            "description": "Id of the source to delete.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      },
      "patch": {
        "summary": "Edits the title and content of a \"text\" source and re-ingests it (status\ngoes back to \"pending\"; poll GetKnowledgeSource). INVALID_ARGUMENT if the\nsource is not a text source; NOT_FOUND if unknown. Idempotent.",
        "operationId": "AgentsService_UpdateKnowledgeSource",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateKnowledgeSourceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sourceId",
            "description": "Id of the text source to edit.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AgentsServiceUpdateKnowledgeSourceBody"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/knowledge-sources/{sourceId}:recrawl": {
      "post": {
        "summary": "Re-crawls an existing \"site\" source from scratch (status back to\n\"pending\", counters reset; poll GetKnowledgeSource). INVALID_ARGUMENT if\nthe source is not a site; FAILED_PRECONDITION if a crawl is already in\nprogress; NOT_FOUND if unknown.",
        "operationId": "AgentsService_RecrawlKnowledgeSource",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RecrawlKnowledgeSourceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sourceId",
            "description": "Id of the site source to re-crawl.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/agents/v1/system-prompts:generate": {
      "post": {
        "summary": "Drafts an agent system prompt from a free-form brief, using Claude. Does\nnot create or modify any agent: copy the returned text into CreateAgent /\nUpdateAgent. Can take up to a few minutes and is billed as AI usage; it is\nnamed as a write RPC so read-only keys cannot trigger it. Not idempotent\n(the wording differs between calls).",
        "operationId": "AgentsService_GenerateSystemPrompt",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GenerateSystemPromptResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1GenerateSystemPromptRequest"
            }
          }
        ],
        "tags": [
          "Agents"
        ],
        "description": "",
        "x-required-scope": "agents:write"
      }
    },
    "/analytics/v1/branch-leaderboard": {
      "get": {
        "summary": "Returns every branch's NPS over the whole lookback window (not per day),\nbest NPS first, with its response and detractor counts. Use it to find\nthe best and worst performing branches/locations. Read-only and\nidempotent.",
        "operationId": "AnalyticsService_GetBranchLeaderboard",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetBranchLeaderboardResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "days",
            "description": "Lookback window in calendar days ending today (inclusive). <= 0 means 30;\nmaximum 180 (larger values are clamped).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Analytics"
        ],
        "description": "",
        "x-required-scope": "analytics:read"
      }
    },
    "/analytics/v1/call-volume": {
      "get": {
        "summary": "Returns how many calls were placed and how many completed in the last\n\"days\" days. Read-only and idempotent. For individual calls use the\nvoice API.",
        "operationId": "AnalyticsService_GetCallVolume",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCallVolumeResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "days",
            "description": "Lookback window in calendar days ending today (inclusive). <= 0 means 30;\nmaximum 180 (larger values are clamped).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Analytics"
        ],
        "description": "",
        "x-required-scope": "analytics:read"
      }
    },
    "/analytics/v1/custom-metrics": {
      "get": {
        "summary": "Returns the organization's custom metrics: numeric fields the AI\nextracts from every call according to the organization's custom-field\nconfiguration (for example \"customer satisfaction 1-5\"), as daily\naverage series per AI agent (persona) or for human operators, together\nwith AI-generated \"what is working / what is not\" insights where enough\ncalls exist. Filter to one agent with agentId, or to human operators\nwith humanOperatorsOnly. Read-only and idempotent.",
        "operationId": "AnalyticsService_GetCustomMetrics",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCustomMetricsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "days",
            "description": "Lookback window in calendar days ending today (inclusive). <= 0 means 30;\nmaximum 180 (larger values are clamped).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agentId",
            "description": "Restrict to the series produced by one AI agent (persona). The id comes\nfrom the agents API. 0 (default) means every scope (\"all personas\").",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "humanOperatorsOnly",
            "description": "When true, restrict to the series produced for human operators (calls\nhandled by people rather than AI agents).",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "Analytics"
        ],
        "description": "",
        "x-required-scope": "analytics:read"
      }
    },
    "/analytics/v1/nps-trend": {
      "get": {
        "summary": "Returns the organization's Net Promoter Score (NPS) as a daily time\nseries for the last \"days\" days, aggregated across all branches, oldest\nday first. NPS ranges from -100 to 100 (percent promoters minus percent\ndetractors). Days with no survey responses are reported with\nresponses = 0 and nps = 0; check \"responses\" before treating an nps of 0\nas a real score. Read-only and idempotent.",
        "operationId": "AnalyticsService_GetNpsTrend",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetNpsTrendResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "days",
            "description": "Lookback window in calendar days ending today (inclusive). <= 0 means 30;\nmaximum 180 (larger values are clamped).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Analytics"
        ],
        "description": "",
        "x-required-scope": "analytics:read"
      }
    },
    "/billing/v1/account": {
      "get": {
        "summary": "Returns the organization's billing mode and wallet balance. When billing\nhas not been set up for the organization, configured = false and the\nother fields are their zero values. Read-only and idempotent.",
        "operationId": "BillingService_GetBilling",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetBillingResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "Billing"
        ],
        "description": "",
        "x-required-scope": "billing:read"
      }
    },
    "/billing/v1/credit-changes": {
      "get": {
        "summary": "Lists the credit changes recorded on the wallet by PingX (credits added\nand credits removed), newest first, each with the balance after the\nchange. Does not include usage charges (see ListUsage). Read-only.",
        "operationId": "BillingService_ListCreditChanges",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListCreditChangesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Maximum changes per page. <= 0 means 25; maximum 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "Opaque token from a previous response's nextPageToken; empty for the\nnewest page. An invalid token is INVALID_ARGUMENT.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Billing"
        ],
        "description": "",
        "x-required-scope": "billing:read"
      }
    },
    "/billing/v1/usage/events": {
      "get": {
        "summary": "Lists individual usage events — charges, refunds and refused (denied)\nattempts — newest first, optionally filtered to one operation. Metering\nthat did not charge anything is not included. Same availability errors as\nGetUsageSummary. Read-only.",
        "operationId": "BillingService_ListUsage",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListUsageResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "operation",
            "description": "Only events of this operation key (see OperationUsage.operation); empty\nmeans every operation.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "Maximum events per page. <= 0 means 25; maximum 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "Opaque token from a previous response's nextPageToken; empty for the\nnewest page. An invalid token is INVALID_ARGUMENT.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Billing"
        ],
        "description": "",
        "x-required-scope": "billing:read"
      }
    },
    "/billing/v1/usage/summary": {
      "get": {
        "summary": "Returns credits used over the last N days broken down by operation (for\nexample \"WhatsApp message\", voice minutes), with totals and the number of\nrefused attempts. FAILED_PRECONDITION when usage reporting is not\navailable for the deployment; UNAVAILABLE when it is temporarily down\n(retry). Read-only and idempotent.",
        "operationId": "BillingService_GetUsageSummary",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetUsageSummaryResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "days",
            "description": "Lookback window in days ending now. <= 0 means 30; maximum 366.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Billing"
        ],
        "description": "",
        "x-required-scope": "billing:read"
      }
    },
    "/memory/v1/contacts": {
      "get": {
        "summary": "Lists the organization's contacts together with their latest\ninteraction and memory counts (active facts and open todos across all\npersonas). Use it to find which contacts the agents hold memory about.\nPaginated: pass the returned nextPageToken as pageToken to get the\nnext page. Read-only.",
        "operationId": "MemoryService_ListContactActivity",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListContactActivityResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "search",
            "description": "Case-insensitive substring matched against the contact's name or phone.\nEmpty returns all contacts.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "includeTest",
            "description": "Include synthetic test contacts (source \"test\"). They are hidden unless\nthis is true.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "pageSize",
            "description": "Maximum rows per page. <= 0 means 50; maximum 200 (larger values are\nclamped).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "Opaque token from a previous response's nextPageToken; empty for the\nfirst page. An invalid token is INVALID_ARGUMENT.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:read"
      }
    },
    "/memory/v1/contacts/{contactId}/memory": {
      "get": {
        "summary": "Returns everything remembered about one contact for one persona: the\ncontact header, every persona that has interacted with (or holds memory\nabout) the contact, and for the selected persona its active facts, todos\n(open first, then recently closed), suppressions, counts, and whether a\ncall is currently in progress. A contact that exists but has no persona\nrelationship yet returns an empty (but valid) memory; an unknown\ncontactId is NOT_FOUND. Read-only.",
        "operationId": "MemoryService_GetContactMemory",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetContactMemoryResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona whose memory to return. 0 (default) means the persona of the\ncontact's most recent interaction (else the first persona seen). An\nagent that does not exist in your organization is NOT_FOUND; an\nexisting agent that never spoke to the contact returns empty memory.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:read"
      }
    },
    "/memory/v1/contacts/{contactId}/messages": {
      "get": {
        "summary": "Returns a contact's most recent WhatsApp messages (both directions),\nnewest first. It is not per persona. A contact with no WhatsApp thread\nreturns an empty list. Read-only. Not paginated: pageSize bounds the\nnumber of most-recent messages returned.",
        "operationId": "MemoryService_ListRecentMessages",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListRecentMessagesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "Maximum number of most-recent messages to return. <= 0 means 50;\nmaximum 200.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:read"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/facts/{factId}/provenance": {
      "get": {
        "summary": "Returns the provenance of one fact: the episode (call) it was learned in\nand the most recent fact that contradicted it, if any. NOT_FOUND when the\nfact does not belong to this contact and persona. Read-only.",
        "operationId": "MemoryService_GetFactProvenance",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetFactProvenanceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona that holds the fact (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "factId",
            "description": "Fact id from GetContactMemory (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:read"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/facts/{factId}:amend": {
      "post": {
        "summary": "Overwrites a fact's value in place (a human correction), keeping its id\nand history (a human correction takes precedence over what the agent\nlearned). Idempotent: amending to the same value twice has the same\nresult. affected = 0 when it is not an active fact of this\ncontact+persona.",
        "operationId": "MemoryService_AmendFact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona that holds the fact (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "factId",
            "description": "Fact id (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceAmendFactBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/facts/{factId}:forget": {
      "post": {
        "summary": "Soft-deletes one active fact (status becomes \"forgotten\", the row is\nkept for audit) AND records a suppression for its factKey so the agent\ndoes not learn it again. Reversible only by LiftSuppression (which lets\nthe key be learned afresh; the forgotten value itself is not restored).\nNOT_FOUND / affected = 0 when it is not an active fact of this\ncontact+persona. Idempotent in effect: forgetting an already-forgotten\nfact affects nothing.",
        "operationId": "MemoryService_ForgetFact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona that holds the fact (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "factId",
            "description": "Fact id (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceForgetFactBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/facts/{factId}:renew": {
      "post": {
        "summary": "Pushes a fact's expiry out to a new RFC 3339 time without touching its\nvalue. expiresAt is required (INVALID_ARGUMENT when missing or not\nRFC 3339). Idempotent. affected = 0 when the fact is not found.",
        "operationId": "MemoryService_RenewFact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona that holds the fact (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "factId",
            "description": "Fact id (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceRenewFactBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/memory:clear": {
      "post": {
        "summary": "DESTRUCTIVE AND IRREVERSIBLE. HARD-deletes everything ONE persona holds\nabout the contact: facts, todos/obligations, do-not-learn rules and call\nepisodes. Other personas are untouched. Unlike EraseSubject it writes no\nerasure marker, so the persona simply starts learning afresh on the next\ninteraction (a clean-slate reset, e.g. for testing). Requires\nconfirm = true. Returns the number of rows deleted in \"affected\".",
        "operationId": "MemoryService_ClearForPersona",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "The persona whose memory of the contact is hard-deleted (path\nparameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceClearForPersonaBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/memory:forgetAll": {
      "post": {
        "summary": "DESTRUCTIVE AND IRREVERSIBLE through this API. Soft-deletes EVERY active\nfact one persona holds about the contact (status \"forgotten\", rows kept\nfor audit); there is no bulk undo. Requires confirm = true. Returns in\n\"affected\" how many facts were forgotten. Other personas' memory of the\ncontact is untouched.",
        "operationId": "MemoryService_ForgetAllForPersona",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "The persona whose facts about the contact are forgotten (path\nparameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceForgetAllForPersonaBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/suppressions:lift": {
      "post": {
        "summary": "Lifts a do-not-learn suppression so the given factKey can be learned\nagain (the opposite of what ForgetFact records). Idempotent.",
        "operationId": "MemoryService_LiftSuppression",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona the suppression applies to (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceLiftSuppressionBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/todos/{todoId}:close": {
      "post": {
        "summary": "Marks an open todo as done (closed by a human), recording the evidence\n(required). Idempotent: closing an already-closed todo affects nothing.",
        "operationId": "MemoryService_CloseTodo",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona that holds the todo (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "todoId",
            "description": "Todo id (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceCloseTodoBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}/personas/{agentId}/todos/{todoId}:reopen": {
      "post": {
        "summary": "Reopens a closed todo (the inverse of CloseTodo). Idempotent.",
        "operationId": "MemoryService_ReopenTodo",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Persona that holds the todo (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "todoId",
            "description": "Todo id (path parameter); must be > 0.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceReopenTodoBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/contacts/{contactId}:erase": {
      "post": {
        "summary": "DESTRUCTIVE AND IRREVERSIBLE. Right-to-be-forgotten: erases every\nfact, todo, suppression and episode held about the contact across ALL\npersonas of the organization, and records an erasure marker so older\ndata is not re-learned. Requires confirm = true. Returns the number of\nrows erased in \"affected\". The contact record itself is not deleted.",
        "operationId": "MemoryService_EraseSubject",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1WriteResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "description": "UUID of the contact to erase from all personas' memory (path parameter).",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MemoryServiceEraseSubjectBody"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/memory/v1/test-contacts": {
      "get": {
        "summary": "Lists the organization's test contacts: synthetic contacts (source\n\"test\") used to try the agents' memory without touching real customers.\nRead-only.",
        "operationId": "MemoryService_ListTestContacts",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListTestContactsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:read"
      },
      "post": {
        "summary": "Creates a synthetic test contact (no phone number, hidden from the\nregular contact list unless includeTest is set). NOT idempotent: every\ncall creates a new contact, even with the same name.",
        "operationId": "MemoryService_CreateTestContact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateTestContactResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateTestContactRequest"
            }
          }
        ],
        "tags": [
          "Contact memory"
        ],
        "description": "",
        "x-required-scope": "memory:write"
      }
    },
    "/voice/v1/calls": {
      "get": {
        "summary": "ListCalls lists the organization's past and in-progress calls (AI agent\ncalls, inbound calls and human-bridged calls), newest first, optionally\nfiltered. Browser test calls from the app are not included. Transcript\ntext and audio are not returned here; use GetCallTranscript and\nDownloadCallRecording.",
        "operationId": "VoiceService_ListCalls",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListCallsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Max calls per page. Default 50, max 200.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "agentId",
            "description": "Only calls handled by this AI agent. Optional (must belong to the\norganization).",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "humanId",
            "description": "Only bridged calls handled by this human. Optional.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "leadId",
            "description": "Only the call(s) from this dial attempt (the dialId from PlaceCall).",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "startedAfter",
            "description": "Only calls started at or after this time (RFC3339). Optional.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "startedBefore",
            "description": "Only calls started before this time (RFC3339). Optional.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      },
      "post": {
        "summary": "PlaceCall starts an outbound phone call from an AI agent to a customer.\nIt validates that the agent belongs to the organization, then queues the\ncall and returns immediately with a dialId; the telephony layer rings the\ncustomer asynchronously (credit checks, caller-ID/number selection and\nnumber-sync checks happen there, exactly as for calls placed from the\nthe app). Poll GetCallStatus with the dialId to follow progress, and call\nEndCall to hang up. Once the call has connected it appears in ListCalls /\nGetCall (find it with ListCalls leadId = dialId).",
        "description": "Not idempotent: every successful request places a new call, so do not\nblindly retry on a timeout; check ListCalls first. Billing is the same as\nfor the app calls; a call refused for insufficient credits is reported by\nGetCallStatus as status \"failed\" with the reason in `outcome`.",
        "operationId": "VoiceService_PlaceCall",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaceCallResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1PlaceCallRequest"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/calls/{callId}": {
      "get": {
        "summary": "GetCall returns one call's details: parties, timing, outcome, AI summary,\nsentiment and scored metrics, and whether a transcript and recording\nexist. NOT_FOUND for an unknown id or another organization's call.",
        "operationId": "VoiceService_GetCall",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCallResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "callId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      }
    },
    "/voice/v1/calls/{callId}/recording": {
      "get": {
        "summary": "DownloadCallRecording returns a call's audio recording (Ogg/Opus, content\ntype \"audio/ogg\") as the response body itself. Over REST this is the raw\naudio file, so `curl -H \"Authorization: Bearer pk_...\" -o call.ogg\nhttps://HOST/voice/v1/calls/123/recording` just works; over Connect/gRPC it\nis a google.api.HttpBody message. The API key authenticates the download\ndirectly: there are no signed or expiring URLs to manage. Whole-file\ndownload only (no HTTP Range). NOT_FOUND when the call is unknown, belongs\nto another organization, or has no recording (check Call.hasRecording);\nFAILED_PRECONDITION if the file exceeds the 32 MiB download cap.",
        "operationId": "VoiceService_DownloadCallRecording",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiHttpBody"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "callId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      }
    },
    "/voice/v1/calls/{callId}/transcript": {
      "get": {
        "summary": "GetCallTranscript returns a call's transcript as speaker-tagged turns\n(voice markup such as \"[laughs]\" is stripped). A call that finished\nwithout a transcript returns an empty list. NOT_FOUND for an unknown id or\nanother organization's call.",
        "operationId": "VoiceService_GetCallTranscript",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCallTranscriptResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "callId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      }
    },
    "/voice/v1/dials/{dialId}/status": {
      "get": {
        "summary": "GetCallStatus reports the live status of a call placed with PlaceCall or\nPlaceHumanCall, identified by the dialId those returned. Poll every 2-5\nseconds while status is \"dialing\" or \"in_progress\". NOT_FOUND for a dialId\nthat does not exist or belongs to another organization.",
        "operationId": "VoiceService_GetCallStatus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCallStatusResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "dialId",
            "description": "dialId returned by PlaceCall or PlaceHumanCall.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      }
    },
    "/voice/v1/dials/{dialId}:end": {
      "post": {
        "summary": "EndCall hangs up an in-progress call immediately (disconnects the customer\nand the AI agent / human). Idempotent: ending a call that already ended\nreturns ended=false without error. NOT_FOUND for an unknown dialId or one\nbelonging to another organization.",
        "operationId": "VoiceService_EndCall",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1EndCallResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "dialId",
            "description": "dialId returned by PlaceCall or PlaceHumanCall.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/human-assignments": {
      "get": {
        "summary": "ListHumanAssignments lists which humans each AI agent may escalate to\n(triage). An agent can only ever reach humans assigned to it.",
        "operationId": "VoiceService_ListHumanAssignments",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListHumanAssignmentsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Max assignments per page. Default 50, max 200.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      }
    },
    "/voice/v1/human-assignments/{agentId}/{humanId}": {
      "put": {
        "summary": "SetHumanAssignment allows (channel \"whatsapp\") or revokes (channel \"\")\nan AI agent's escalation to a human. Idempotent. INVALID_ARGUMENT if the\nagent is unknown or the human has no whatsappMobile.",
        "operationId": "VoiceService_SetHumanAssignment",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetHumanAssignmentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "description": "Path parameter.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "humanId",
            "description": "Path parameter.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/VoiceServiceSetHumanAssignmentBody"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/human-calls": {
      "post": {
        "summary": "PlaceHumanCall starts a bridged call between one of the organization's\nhumans (see ListHumans) and a customer: the human's phone is dialed first,\nthen the customer's, and both are joined on one line. No AI persona\nspeaks; the call is silently recorded, transcribed and scored. Returns\nimmediately with a dialId, same lifecycle and polling as PlaceCall. The\nhuman must have a phone number. Not idempotent.",
        "operationId": "VoiceService_PlaceHumanCall",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaceHumanCallResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1PlaceHumanCallRequest"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/humans": {
      "get": {
        "summary": "ListHumans lists the directory of people the business can reach by phone\n(bridged human calls) and/or WhatsApp (AI agent escalations), oldest first.",
        "operationId": "VoiceService_ListHumans",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListHumansResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Max humans per page. Default 50, max 200.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      },
      "post": {
        "summary": "AddHuman adds a person to the directory. At least one of phone or\nwhatsappMobile is required. ALREADY_EXISTS if the phone is already\nregistered.",
        "operationId": "VoiceService_AddHuman",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddHumanResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1AddHumanRequest"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/humans/{humanId}": {
      "delete": {
        "summary": "RemoveHuman deletes a human and their agent assignments. NOT_FOUND if\nunknown or in another organization.",
        "operationId": "VoiceService_RemoveHuman",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RemoveHumanResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "humanId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      },
      "patch": {
        "summary": "UpdateHuman replaces a human's name, phone, whatsappMobile and purpose\n(full replace, not a merge: send every field you want to keep).",
        "operationId": "VoiceService_UpdateHuman",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateHumanResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "humanId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/VoiceServiceUpdateHumanBody"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/numbers": {
      "get": {
        "summary": "ListNumbers lists the organization's voice phone numbers (the numbers\ncalls are placed from and received on), default number first. WhatsApp\nnumbers are managed by the WhatsApp API, not here.",
        "operationId": "VoiceService_ListNumbers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/pingxVoiceV1ListNumbersResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "Max numbers per page. Default 50, max 200.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "description": "nextPageToken from the previous response; empty for the first page.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:read"
      },
      "post": {
        "summary": "AddNumber registers a phone number the organization owns on Pingx\nTelephony so it can place and receive calls. The first number becomes the\ndefault automatically. If registering it on the telephony trunk fails the\nnumber is still saved and the returned syncError says why it is not yet\ndialable (registration is retried automatically). ALREADY_EXISTS if the\nnumber is already registered.",
        "operationId": "VoiceService_AddNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1AddNumberRequest"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/numbers/{numberId}": {
      "delete": {
        "summary": "RemoveNumber unregisters a voice number and removes it from the telephony\ntrunk; inbound calls to it stop being answered. NOT_FOUND when the number\nis unknown (including already removed) or belongs to another organization.",
        "operationId": "VoiceService_RemoveNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RemoveNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/numbers/{numberId}:setDefault": {
      "post": {
        "summary": "SetDefaultNumber makes a number the one outbound calls are placed from by\ndefault. Idempotent.",
        "operationId": "VoiceService_SetDefaultNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetDefaultNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/voice/v1/numbers/{numberId}:setInboundAgent": {
      "post": {
        "summary": "SetInboundAgent chooses which AI agent answers cold inbound calls to a\nnumber. agentId = 0 clears the binding, after which the number refuses\ninbound calls (there is no fallback agent). Idempotent.",
        "operationId": "VoiceService_SetInboundAgent",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetInboundAgentResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/VoiceServiceSetInboundAgentBody"
            }
          }
        ],
        "tags": [
          "Voice"
        ],
        "description": "",
        "x-required-scope": "voice:write"
      }
    },
    "/whatsapp/v1/auto-responses": {
      "get": {
        "summary": "===================================================================\nAuto-responses - keyword -> canned text reply\n===================================================================\nLists the auto-responses of a number (the complete list, unpaginated).",
        "operationId": "WhatsAppService_ListAutoResponses",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListAutoResponsesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "summary": "Creates an auto-response and returns its id. Not idempotent.",
        "operationId": "WhatsAppService_CreateAutoResponse",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AutoResponseResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateAutoResponseRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/auto-responses/{autoResponseId}": {
      "delete": {
        "summary": "Deletes an auto-response. Idempotent.",
        "operationId": "WhatsAppService_DeleteAutoResponse",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AutoResponseResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "autoResponseId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "phoneNumberId",
            "description": "Query parameter in REST.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      },
      "put": {
        "summary": "Replaces an auto-response's settings (send every field). Idempotent.",
        "operationId": "WhatsAppService_UpdateAutoResponse",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AutoResponseResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "autoResponseId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "int64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceUpdateAutoResponseBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/blocked-numbers": {
      "get": {
        "summary": "Lists blocked (opted-out) numbers: no template or campaign message is\nsent to them. Paginated.",
        "operationId": "WhatsAppService_ListBlockedNumbers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListBlockedNumbersResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "0 = 100; maximum 1000.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "summary": "Blocks a number, as if the customer had opted out. Idempotent.",
        "operationId": "WhatsAppService_BlockNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1BlockNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1BlockNumberRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/blocked-numbers/{mobileNumber}": {
      "delete": {
        "summary": "Unblocks a number so it can receive messages again. Idempotent.",
        "operationId": "WhatsAppService_UnblockNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UnblockNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "mobileNumber",
            "description": "E.164 digits; in REST put it URL-encoded in the path (\"%2B1555...\").",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "description": "Query parameter in REST.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/campaigns": {
      "get": {
        "summary": "Lists the organization's campaigns, newest first (at most the 200 most\nrecent are reachable), without the delivery breakdown (use GetCampaign\nfor that).",
        "operationId": "WhatsAppService_ListCampaigns",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListCampaignsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "description": "0 = 50; maximum 200.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "summary": "Creates a campaign in `draft` status. Validates the template (must be\nAPPROVED), media and carousel settings once for all recipients. Not\nidempotent: every call creates a new campaign, so after a timeout call\nListCampaigns before retrying. Errors: INVALID_ARGUMENT (missing\ntemplateName, bad media), NOT_FOUND (unknown template or number),\nFAILED_PRECONDITION (template not approved), RESOURCE_EXHAUSTED (too\nmany campaigns already running).",
        "operationId": "WhatsAppService_CreateCampaign",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateCampaignResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateCampaignRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/campaigns/{campaignId}": {
      "get": {
        "summary": "Reads one campaign with live progress counters, delivery results from\nMeta's webhooks (delivered/read/deliveryFailed) and the first 100\nper-recipient send failures. NOT_FOUND for a campaign that belongs to\nanother organization.",
        "operationId": "WhatsAppService_GetCampaign",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCampaignResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/campaigns/{campaignId}/recipients:add": {
      "post": {
        "summary": "Adds recipients to a `draft` campaign (up to 5000 per call; call\nrepeatedly for larger audiences). Numbers already on the campaign are\ncounted as duplicates and opted-out numbers are skipped, so retrying a\nchunk is safe.",
        "operationId": "WhatsAppService_AddCampaignRecipients",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddCampaignRecipientsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "campaignId",
            "description": "Campaign id from CreateCampaign. Must still be in `draft` status.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceAddCampaignRecipientsBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/campaigns/{campaignId}:cancel": {
      "post": {
        "summary": "Cancels a campaign: messages not yet sent will not be sent. Messages\nalready sent cannot be recalled. Idempotent; `cancelled` is false if\nthe campaign had already finished.",
        "operationId": "WhatsAppService_CancelCampaign",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CancelCampaignResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceCancelCampaignBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/campaigns/{campaignId}:start": {
      "post": {
        "summary": "Starts a draft campaign (or queues it until its scheduledAt). A\ncampaign that is not a startable draft (already started, or unknown to\nyour organization) returns an error; see the Connect/gRPC code.",
        "operationId": "WhatsAppService_StartCampaign",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1StartCampaignResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceStartCampaignBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/chats": {
      "get": {
        "summary": "===================================================================\nTeam Inbox chats - human conversations with customers\n===================================================================\nLists conversations (one per customer number) with the last message,\nunread count and assignee, most recently active first.",
        "operationId": "WhatsAppService_ListChats",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListChatsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "0 = 100; maximum 500.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "assigneeFilter",
            "description": "Empty = all chats, \"unassigned\", or the user id of one member. \"mine\" is\nnot available to API keys (they have no user).",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/chats/{contact}/messages": {
      "get": {
        "summary": "Reads one conversation's messages (inbound and outbound). The first\npage holds the newest messages; nextPageToken leads to older ones.\nWithin a page messages are ordered oldest to newest.",
        "operationId": "WhatsAppService_ListChatMessages",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListChatMessagesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contact",
            "description": "Customer number (E.164 digits). Required.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "0 = 200; maximum 500.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "summary": "Sends a free-text reply to a customer. Only allowed inside the 24-hour\ncustomer-service window (see ListChatMessages.outsideServiceWindow);\noutside it the call returns success=false and you must send an approved\ntemplate with SendMessage instead. Billed like SendMessage. Not\nidempotent: retrying after a timeout can deliver the reply twice.",
        "operationId": "WhatsAppService_SendChatMessage",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/pingxWhatsappV1SendChatMessageResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contact",
            "description": "Customer number (E.164 digits). Required.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1WhatsAppServiceSendChatMessageBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/chats/{contact}:assign": {
      "post": {
        "summary": "Assigns a conversation to one organization member or clears the\nassignment. Idempotent.",
        "operationId": "WhatsAppService_AssignChat",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AssignChatResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceAssignChatBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/chats/{contact}:markRead": {
      "post": {
        "summary": "Clears the unread badge of one conversation. Idempotent.",
        "operationId": "WhatsAppService_MarkChatRead",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1MarkChatReadResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceMarkChatReadBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/commerce/catalogs": {
      "post": {
        "summary": "Creates a new Meta catalog on the organization's business and connects\nit. Not idempotent.",
        "operationId": "WhatsAppService_CreateCatalog",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateCatalogResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateCatalogRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/commerce/catalogs:connect": {
      "post": {
        "summary": "Connects an existing Meta catalog to a number. Idempotent.",
        "operationId": "WhatsAppService_ConnectCatalog",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CommerceResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1ConnectCatalogRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/commerce/product-batches": {
      "get": {
        "summary": "Lists product batches (the complete list).",
        "operationId": "WhatsAppService_ListProductBatches",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListProductBatchesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "summary": "Creates a batch of products: every item is pushed to the connected Meta\ncatalog in one call and the batch is recorded only if that succeeds\n(Meta errors, e.g. a missing catalog permission, are returned as-is).\nNot idempotent.",
        "operationId": "WhatsAppService_CreateProductBatch",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateProductBatchResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateProductBatchRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/commerce/product-batches/{productBatchId}": {
      "get": {
        "summary": "Reads one product batch with its products.",
        "operationId": "WhatsAppService_GetProductBatch",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetProductBatchResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "productBatchId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "description": "Query parameter in REST.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "delete": {
        "summary": "Deletes a product batch. Idempotent.",
        "operationId": "WhatsAppService_DeleteProductBatch",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CommerceResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "productBatchId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "description": "Query parameter in REST.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/commerce/product-batches/{productBatchId}:setLive": {
      "post": {
        "summary": "Publishes (live=true) or withdraws (live=false) a batch's products in\nthe catalog. Idempotent.",
        "operationId": "WhatsAppService_SetProductBatchLive",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CommerceResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "productBatchId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceSetProductBatchLiveBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/commerce/settings": {
      "get": {
        "summary": "===================================================================\nCommerce - catalog, commerce settings and product batches\n===================================================================\nReads the connected catalog and commerce settings of a number, plus the\ncatalogs available to connect.",
        "operationId": "WhatsAppService_GetCommerceSettings",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetCommerceSettingsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "put": {
        "summary": "Updates catalog visibility and cart settings of a number. Both fields\nare always applied: read first if you only want to change one.\nIdempotent.",
        "operationId": "WhatsAppService_SetCommerceSettings",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CommerceResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1SetCommerceSettingsRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contact-attributes": {
      "get": {
        "summary": "Contact attribute registry: a per-org catalog of customFields keys in\nuse — advisory, not a schema (contacts.customFields stays free-form).\nBacks Manage Contacts > Manage Attributes and the Flow Builder's\nattribute pickers.",
        "operationId": "WhatsAppService_ListContactAttributes",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListContactAttributesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "operationId": "WhatsAppService_CreateContactAttribute",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateContactAttributeResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateContactAttributeRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contact-attributes/{name}": {
      "delete": {
        "operationId": "WhatsAppService_DeleteContactAttribute",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteContactAttributeResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contact-attributes/{name}/contacts": {
      "get": {
        "summary": "Contacts that have a value set for one registered attribute — \"view\ncontacts\" from Manage Attributes.",
        "operationId": "WhatsAppService_ListContactsForAttribute",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListContactsForAttributeResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/contact-groups": {
      "get": {
        "operationId": "WhatsAppService_ListGroups",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListGroupsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "operationId": "WhatsAppService_CreateGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateGroupResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateGroupRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contact-groups/{groupId}": {
      "delete": {
        "operationId": "WhatsAppService_DeleteGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteGroupResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      },
      "patch": {
        "operationId": "WhatsAppService_UpdateGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateGroupResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceUpdateGroupBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contact-groups/{groupId}/members": {
      "get": {
        "operationId": "WhatsAppService_ListGroupContacts",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListGroupContactsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "put": {
        "operationId": "WhatsAppService_SetGroupMembers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetGroupMembersResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceSetGroupMembersBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contact-groups/{groupId}/members:add": {
      "post": {
        "summary": "AddGroupContacts additively inserts contactIds into a group's\nmembership (existing members untouched) — unlike SetGroupMembers, which\nreplaces the whole list. Atomic server-side, so it's safe to call\nconcurrently from two clients without a lost-update race.",
        "operationId": "WhatsAppService_AddGroupContacts",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddGroupContactsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceAddGroupContactsBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contacts": {
      "get": {
        "operationId": "WhatsAppService_ListContacts",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListContactsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "operationId": "WhatsAppService_CreateContact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateContactResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateContactRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contacts/{contactId}": {
      "delete": {
        "operationId": "WhatsAppService_DeleteContact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteContactResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      },
      "patch": {
        "operationId": "WhatsAppService_UpdateContact",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateContactResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceUpdateContactBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contacts:bulkImport": {
      "post": {
        "operationId": "WhatsAppService_BulkImportContacts",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1BulkImportContactsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1BulkImportContactsRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/contacts:byPhone": {
      "get": {
        "summary": "Reads one contact by WhatsApp number (any format; matched on its digits)\nwith its labels, and every label the organization uses (for pickers).",
        "operationId": "WhatsAppService_GetContactByPhone",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetContactByPhoneResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phone",
            "description": "digits, with or without \"+\" / spaces",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/contacts:setTags": {
      "post": {
        "summary": "Adds and/or removes plain labels (\"tags\") on the contact for a WhatsApp\nnumber, creating the contact when the number is new. Adding a label the\ncontact already has, or removing one it does not have, is a no-op, so it\nis safe to call repeatedly and concurrently. This is the call to label\ncustomers from your own systems.",
        "operationId": "WhatsAppService_SetContactTags",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetContactTagsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1SetContactTagsRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/flows": {
      "get": {
        "summary": "Lists flows (summaries without the graph; the complete list).",
        "operationId": "WhatsAppService_ListFlows",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListFlowsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "summary": "Creates an empty, inactive flow and returns its id. Not idempotent.",
        "operationId": "WhatsAppService_CreateFlow",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1FlowResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateFlowRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/flows/{flowId}": {
      "get": {
        "summary": "Reads one flow including its full graph.",
        "operationId": "WhatsAppService_GetFlow",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetFlowResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "description": "Query parameter in REST.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "delete": {
        "summary": "Deletes a flow. Idempotent.",
        "operationId": "WhatsAppService_DeleteFlow",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1FlowResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "description": "Query parameter in REST.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      },
      "put": {
        "summary": "Saves a flow's name, trigger and graph, replacing what was stored. The\ngraph is fully validated (INVALID_ARGUMENT lists the problems).\nIdempotent.",
        "operationId": "WhatsAppService_UpdateFlow",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1FlowResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceUpdateFlowBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/flows/{flowId}:duplicate": {
      "post": {
        "summary": "Copies a flow (inactive, named \"<original> Copy\"). Not idempotent.",
        "operationId": "WhatsAppService_DuplicateFlow",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DuplicateFlowResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceDuplicateFlowBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/flows/{flowId}:setActive": {
      "post": {
        "summary": "Switches a flow on or off. Activation re-validates the flow and can\nfail with INVALID_ARGUMENT (graph problems are listed) or NOT_FOUND.\nIdempotent.",
        "operationId": "WhatsAppService_SetFlowActive",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1FlowResult"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceSetFlowActiveBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/inbound-messages": {
      "get": {
        "summary": "Customer messages/replies received on the connected number(s), newest\nfirst (the dashboard's Inbound Messages report). Paginated.",
        "operationId": "WhatsAppService_ListInboundMessages",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListInboundMessagesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "0 = 50; clamped to [1, 200].",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "query",
            "description": "Free-text match on sender or message text.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "from",
            "description": "RFC 3339 range on received time; empty = open-ended.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "includeTotal",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/media": {
      "get": {
        "operationId": "WhatsAppService_ListMedia",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListMediaResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "operationId": "WhatsAppService_UploadMedia",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UploadMediaResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1UploadMediaRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/media/{mediaId}": {
      "delete": {
        "operationId": "WhatsAppService_DeleteMedia",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteMediaResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/message-reports": {
      "get": {
        "summary": "===================================================================\nMessage reports and inbound messages\n===================================================================\nPer-message delivery log (the dashboard's Report page) with filters.\nThis is the API equivalent of the dashboard's CSV export, which is\nbrowser-session only: walk nextPageToken until it is empty to export\neverything in a time range. Use ListMessages for a simple \"latest N\nsends\" view.",
        "operationId": "WhatsAppService_ListMessageReports",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListMessageReportsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "description": "Number filter; empty = all connected numbers.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "description": "0 = 50; clamped to [1, 200].",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "query",
            "description": "Free-text match on campaign name, template name or recipient.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "category",
            "description": "MARKETING | UTILITY | AUTHENTICATION; empty = any.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "status",
            "description": "sent | delivered | read | failed; \"pending\" = no delivery webhook yet;\nempty = any.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "campaignName",
            "description": "Substring filter on the campaign name (independent of `query`).",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "from",
            "description": "RFC 3339 range on sent time; empty = open-ended.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "includeTotal",
            "description": "If true, totalMatching is filled (extra cost on large ranges).",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/message-stats": {
      "get": {
        "summary": "Aggregate delivery funnel (initiated/sent/delivered/read/failed/replies)\nfor a time range plus a 7-day daily breakdown.",
        "operationId": "WhatsAppService_GetMessageStats",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetMessageStatsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "description": "Empty = across every connected number.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "category",
            "description": "empty = any",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "status",
            "description": "empty = any",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "campaignName",
            "description": "substring filter",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "from",
            "description": "RFC 3339 range. Both required.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/messages": {
      "get": {
        "operationId": "WhatsAppService_ListMessages",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListMessagesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "operationId": "WhatsAppService_SendMessage",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SendMessageResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1SendMessageRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/numbers": {
      "get": {
        "operationId": "WhatsAppService_ListNumbers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/pingxWhatsappV1ListNumbersResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      }
    },
    "/whatsapp/v1/numbers/{phoneNumberId}:disconnect": {
      "post": {
        "operationId": "WhatsAppService_DisconnectNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DisconnectNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/numbers:connect": {
      "post": {
        "operationId": "WhatsAppService_ConnectNumber",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ConnectNumberResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1ConnectNumberRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/opt-out-config": {
      "get": {
        "summary": "===================================================================\nOpt-out / opt-in handling and blocked numbers\n===================================================================\nReads the keyword configuration that makes customers opt out of (e.g.\n\"STOP\") or back into (e.g. \"START\") your messages.",
        "operationId": "WhatsAppService_GetOptOutConfig",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetOptOutConfigResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "put": {
        "summary": "Replaces the whole opt-out/opt-in configuration of a number\n(read-modify-write: send every field). Idempotent.",
        "operationId": "WhatsAppService_SetOptOutConfig",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetOptOutConfigResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1SetOptOutConfigRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/templates": {
      "get": {
        "operationId": "WhatsAppService_ListTemplates",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListTemplatesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "post": {
        "operationId": "WhatsAppService_CreateTemplate",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateTemplateResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateTemplateRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/templates/{templateName}": {
      "get": {
        "operationId": "WhatsAppService_GetTemplate",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetTemplateResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "templateName",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:read"
      },
      "delete": {
        "operationId": "WhatsAppService_DeleteTemplate",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeleteTemplateResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "templateName",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "phoneNumberId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/templates/{templateName}:archive": {
      "patch": {
        "operationId": "WhatsAppService_ArchiveTemplate",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ArchiveTemplateResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "templateName",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WhatsAppServiceArchiveTemplateBody"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    },
    "/whatsapp/v1/webhook": {
      "put": {
        "operationId": "WhatsAppService_SetWebhookConfig",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SetWebhookConfigResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1SetWebhookConfigRequest"
            }
          }
        ],
        "tags": [
          "WhatsApp"
        ],
        "summary": "",
        "description": "",
        "x-required-scope": "whatsapp:write"
      }
    }
  },
  "definitions": {
    "AgentsServiceAddKnowledgeSourceBody": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Optional display title; defaults to \"Note\", the URL or the file name."
        },
        "text": {
          "type": "string",
          "description": "A text note (chunked and embedded like any source)."
        },
        "url": {
          "type": "string",
          "description": "A single web page, fetched and extracted by the platform."
        },
        "file": {
          "$ref": "#/definitions/v1FileSource",
          "description": "An uploaded .txt, .md or .pdf file."
        },
        "site": {
          "$ref": "#/definitions/v1SiteSource",
          "description": "A whole-site crawl."
        }
      }
    },
    "AgentsServiceUpdateAgentBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "New display name; must be non-empty when provided."
        },
        "systemPrompt": {
          "type": "string",
          "description": "New system prompt."
        },
        "chatInstructions": {
          "type": "string",
          "description": "New chat playbook."
        },
        "callInstructions": {
          "type": "string",
          "description": "New call playbook."
        },
        "script": {
          "type": "string",
          "description": "New call script, up to 20,000 characters (an empty string clears it).\nProcessed by an AI normalization pass before saving."
        },
        "fillerWordsEnabled": {
          "type": "boolean",
          "description": "Toggle filler words on voice calls."
        },
        "voiceGender": {
          "type": "string",
          "description": "\"male\" or \"female\"; any other value is stored as \"female\"."
        },
        "supportEscalationEnabled": {
          "type": "boolean",
          "description": "Toggle support escalation (see Agent.supportEscalationEnabled)."
        },
        "backgroundAudioEnabled": {
          "type": "boolean",
          "description": "Toggle the call background-audio bed."
        },
        "backgroundAudioVolume": {
          "type": "integer",
          "format": "int64",
          "description": "Background-audio level percent, 0-100 (INVALID_ARGUMENT above 100)."
        },
        "knowledgeBaseIds": {
          "$ref": "#/definitions/v1KnowledgeBaseIds",
          "description": "When provided, REPLACES the attached knowledge bases with this ordered\nlist (an empty list detaches all). Omit to keep the current attachments."
        }
      }
    },
    "AgentsServiceUpdateCustomFieldBody": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "description": "New label (non-empty)."
        },
        "description": {
          "type": "string",
          "description": "New description (non-empty)."
        },
        "minValue": {
          "type": "integer",
          "format": "int32",
          "description": "New lowest score."
        },
        "maxValue": {
          "type": "integer",
          "format": "int32",
          "description": "New highest score; the resulting range must satisfy minValue < maxValue."
        },
        "position": {
          "type": "integer",
          "format": "int32",
          "description": "New display order."
        }
      }
    },
    "AgentsServiceUpdateKnowledgeBaseBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "New display name (required, non-empty after trimming)."
        }
      }
    },
    "AgentsServiceUpdateKnowledgeSourceBody": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "New title."
        },
        "content": {
          "type": "string",
          "description": "New note text."
        }
      }
    },
    "MemoryServiceAmendFactBody": {
      "type": "object",
      "properties": {
        "factValue": {
          "type": "string",
          "description": "The corrected value. Required."
        }
      }
    },
    "MemoryServiceClearForPersonaBody": {
      "type": "object",
      "properties": {
        "confirm": {
          "type": "boolean",
          "description": "Must be true, acknowledging that this cannot be undone."
        }
      }
    },
    "MemoryServiceCloseTodoBody": {
      "type": "object",
      "properties": {
        "evidence": {
          "type": "string",
          "description": "Free-text evidence/reason recorded as the closing evidence. Required\n(non-empty)."
        }
      }
    },
    "MemoryServiceEraseSubjectBody": {
      "type": "object",
      "properties": {
        "confirm": {
          "type": "boolean",
          "description": "Must be true, acknowledging that this cannot be undone."
        }
      }
    },
    "MemoryServiceForgetAllForPersonaBody": {
      "type": "object",
      "properties": {
        "confirm": {
          "type": "boolean",
          "description": "Must be true, acknowledging that this cannot be undone through the API."
        }
      }
    },
    "MemoryServiceForgetFactBody": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "description": "Optional reason, stored on the suppression for audit."
        }
      }
    },
    "MemoryServiceLiftSuppressionBody": {
      "type": "object",
      "properties": {
        "factKey": {
          "type": "string",
          "description": "The suppressed fact key to release (see Suppression.factKey). Required."
        }
      }
    },
    "MemoryServiceRenewFactBody": {
      "type": "object",
      "properties": {
        "expiresAt": {
          "type": "string",
          "description": "New expiry as an RFC 3339 timestamp. Required."
        }
      }
    },
    "MemoryServiceReopenTodoBody": {
      "type": "object"
    },
    "VoiceServiceSetHumanAssignmentBody": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "\"whatsapp\" to allow escalation; \"\" to revoke the assignment."
        }
      }
    },
    "VoiceServiceSetInboundAgentBody": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "AI agent to answer inbound calls; 0 clears the binding. Must belong to\nthe organization."
        }
      }
    },
    "VoiceServiceUpdateHumanBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Same rules as AddHumanRequest; all fields replace the stored values."
        },
        "phone": {
          "type": "string"
        },
        "whatsappMobile": {
          "type": "string"
        },
        "purpose": {
          "type": "string"
        }
      }
    },
    "WhatsAppServiceAddCampaignRecipientsBody": {
      "type": "object",
      "properties": {
        "recipients": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CampaignRecipient"
          },
          "description": "Up to 5000 recipients per call."
        }
      }
    },
    "WhatsAppServiceAddGroupContactsBody": {
      "type": "object",
      "properties": {
        "contactIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "WhatsAppServiceArchiveTemplateBody": {
      "type": "object",
      "properties": {
        "language": {
          "type": "string"
        },
        "archived": {
          "type": "boolean"
        },
        "phoneNumberId": {
          "type": "string",
          "description": "Which WABA's template to archive. Empty uses the org's default number."
        }
      }
    },
    "WhatsAppServiceAssignChatBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "assigneeId": {
          "type": "string",
          "description": "User id of an organization member; empty = unassign. API keys have no\nuser, so \"me\" is not available to them."
        }
      }
    },
    "WhatsAppServiceCancelCampaignBody": {
      "type": "object"
    },
    "WhatsAppServiceDuplicateFlowBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        }
      }
    },
    "WhatsAppServiceMarkChatReadBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        }
      }
    },
    "WhatsAppServiceSetFlowActiveBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "active": {
          "type": "boolean"
        }
      }
    },
    "WhatsAppServiceSetGroupMembersBody": {
      "type": "object",
      "properties": {
        "contactIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "WhatsAppServiceSetProductBatchLiveBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "live": {
          "type": "boolean"
        }
      }
    },
    "WhatsAppServiceStartCampaignBody": {
      "type": "object"
    },
    "WhatsAppServiceUpdateAutoResponseBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "matchType": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "responseText": {
          "type": "string"
        },
        "active": {
          "type": "boolean"
        }
      }
    },
    "WhatsAppServiceUpdateContactBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "customFields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "WhatsAppServiceUpdateFlowBody": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "matchType": {
          "type": "string",
          "description": "\"exact\" or \"contains\" (the Start node's trigger)."
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "graph": {
          "type": "object",
          "description": "Full replacement graph; see Flow."
        }
      }
    },
    "WhatsAppServiceUpdateGroupBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "apiHttpBody": {
      "type": "object",
      "properties": {
        "contentType": {
          "type": "string",
          "description": "The HTTP Content-Type header value specifying the content type of the body."
        },
        "data": {
          "type": "string",
          "format": "byte",
          "description": "The HTTP request/response body as raw binary."
        },
        "extensions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          },
          "description": "Application specific response metadata. Must be set in the first response\nfor streaming APIs."
        }
      },
      "description": "Message that represents an arbitrary HTTP body. It should only be used for\npayload formats that can't be represented as JSON, such as raw binary or\nan HTML page.\n\n\nThis message can be used both in streaming and non-streaming API methods in\nthe request as well as the response.\n\nIt can be used as a top-level request field, which is convenient if one\nwants to extract parameters from either the URL or HTTP template into the\nrequest fields and also want access to the raw HTTP body.\n\nExample:\n\n    message GetResourceRequest {\n      // A unique request id.\n      string requestId = 1;\n\n      // The raw HTTP body is bound to this field.\n      google.api.HttpBody httpBody = 2;\n\n    }\n\n    service ResourceService {\n      rpc GetResource(GetResourceRequest)\n        returns (google.api.HttpBody);\n      rpc UpdateResource(google.api.HttpBody)\n        returns (google.protobuf.Empty);\n\n    }\n\nExample with streaming methods:\n\n    service CaldavService {\n      rpc GetCalendar(stream google.api.HttpBody)\n        returns (stream google.api.HttpBody);\n      rpc UpdateCalendar(stream google.api.HttpBody)\n        returns (stream google.api.HttpBody);\n\n    }\n\nUse of this type only changes how the request and response bodies are\nhandled, all other features will continue to work unchanged."
    },
    "channelV1CarouselCard": {
      "type": "object",
      "properties": {
        "mediaType": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "mediaUrl": {
          "type": "string"
        },
        "buttonVars": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "channelV1Location": {
      "type": "object",
      "properties": {
        "latitude": {
          "type": "number",
          "format": "double"
        },
        "longitude": {
          "type": "number",
          "format": "double"
        },
        "name": {
          "type": "string"
        },
        "address": {
          "type": "string"
        }
      }
    },
    "channelV1Template": {
      "type": "object",
      "properties": {
        "templateName": {
          "type": "string"
        },
        "bodyVars": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "header": {
          "type": "string"
        },
        "buttonVars": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "buttonUrlPath": {
          "type": "string"
        },
        "mediaType": {
          "type": "string",
          "title": "image | video | document; empty for a text-template send"
        },
        "mediaUrl": {
          "type": "string",
          "title": "exactly one of media_url/media_id, when media_type is set"
        },
        "mediaId": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "description": "Meta requires the template's language code to match how the template was\nregistered (e.g. \"en_US\"). Empty defaults to en_US, which is wrong for\nany template created in another language — callers should set it."
        },
        "cards": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/channelV1CarouselCard"
          }
        }
      }
    },
    "pingxAgentsV1SendChatMessageResponse": {
      "type": "object",
      "properties": {
        "segments": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The reply as separate chat bubbles in order (a turn that searches the\nknowledge base mid-answer yields an acknowledgment bubble, then the\ngrounded answer)."
        },
        "text": {
          "type": "string",
          "description": "All segments joined with a blank line: the whole reply as one text."
        },
        "citations": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ChatCitation"
          },
          "description": "Knowledge passages that grounded the reply, if any."
        },
        "messageId": {
          "type": "string",
          "format": "int64",
          "description": "Id of the stored assistant message."
        }
      }
    },
    "pingxVoiceV1ListNumbersResponse": {
      "type": "object",
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1VoiceNumber"
          }
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken for the next page; empty on the last page."
        }
      }
    },
    "pingxWhatsappV1CarouselCard": {
      "type": "object",
      "properties": {
        "headerFormat": {
          "type": "string",
          "title": "IMAGE | VIDEO"
        },
        "headerSampleFileData": {
          "type": "string",
          "format": "byte"
        },
        "headerSampleFileName": {
          "type": "string"
        },
        "text": {
          "type": "string"
        }
      }
    },
    "pingxWhatsappV1ListNumbersResponse": {
      "type": "object",
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Number"
          }
        }
      }
    },
    "pingxWhatsappV1SendChatMessageResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "false (with `message` explaining) when outside the 24-hour window or\nMeta/billing refused the send."
        },
        "message": {
          "type": "string"
        }
      }
    },
    "pingxWhatsappV1Template": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "header": {
          "type": "string"
        },
        "footer": {
          "type": "string"
        },
        "msgType": {
          "type": "string",
          "title": "text | media"
        },
        "buttons": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1TemplateButton"
          }
        },
        "archived": {
          "type": "boolean"
        },
        "mediaType": {
          "type": "string"
        },
        "rejectedReason": {
          "type": "string",
          "description": "Set only when status is REJECTED — Meta's reason for rejecting it."
        },
        "qualityScore": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Meta's template ID, assigned when the template is created. Empty for\ntemplates Meta has not issued an ID for. It identifies one language\nvariant within one WABA and changes if the template is deleted and\nrecreated, so treat it as an opaque display/lookup value, not a stable\nprimary key; templates are still addressed by name (see DeleteTemplate)."
        },
        "createdAt": {
          "type": "string",
          "description": "RFC 3339 time the template was submitted from the dashboard. Empty for\ntemplates created outside the dashboard, since Meta does not return one."
        },
        "carouselCardCount": {
          "type": "integer",
          "format": "int64"
        },
        "carouselCardTexts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Each card's body text, in card order; empty for a card with no text."
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string",
          "description": "Identifies the type of the serialized Protobuf message with a URI reference\nconsisting of a prefix ending in a slash and the fully-qualified type name.\n\nExample: type.googleapis.com/google.protobuf.StringValue\n\nThis string must contain at least one `/` character, and the content after\nthe last `/` must be the fully-qualified name of the type in canonical\nform, without a leading dot. Do not write a scheme on these URI references\nso that clients do not attempt to contact them.\n\nThe prefix is arbitrary and Protobuf implementations are expected to\nsimply strip off everything up to and including the last `/` to identify\nthe type. `type.googleapis.com/` is a common default prefix that some\nlegacy implementations require. This prefix does not indicate the origin of\nthe type, and URIs containing it are not expected to respond to any\nrequests.\n\nAll type URL strings must be legal URI references with the additional\nrestriction (for the text format) that the content of the reference\nmust consist only of alphanumeric characters, percent-encoded escapes, and\ncharacters in the following set (not including the outer backticks):\n`/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations\nshould not unescape them to prevent confusion with existing parsers. For\nexample, `type.googleapis.com%2FFoo` should be rejected.\n\nIn the original design of `Any`, the possibility of launching a type\nresolution service at these type URLs was considered but Protobuf never\nimplemented one and considers contacting these URLs to be problematic and\na potential security issue. Do not attempt to contact type URLs."
        }
      },
      "additionalProperties": true,
      "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nIn its binary encoding, an `Any` is an ordinary message; but in other wire\nforms like JSON, it has a special encoding. The format of the type URL is\ndescribed on the `typeUrl` field.\n\nProtobuf APIs provide utilities to interact with `Any` values:\n\n- A 'pack' operation accepts a message and constructs a generic `Any` wrapper\n  around it.\n- An 'unpack' operation reads the content of an `Any` message, either into an\n  existing message or a new one. Unpack operations must check the type of the\n  value they unpack against the declared `typeUrl`.\n- An 'is' operation decides whether an `Any` contains a message of the given\n  type, i.e. whether it can 'unpack' that type.\n\nThe JSON format representation of an `Any` follows one of these cases:\n\n- For types without special-cased JSON encodings, the JSON format\n  representation of the `Any` is the same as that of the message, with an\n  additional `@type` field which contains the type URL.\n- For types with special-cased JSON encodings (typically called 'well-known'\n  types, listed in https://protobuf.dev/programming-guides/json/#any), the\n  JSON format representation has a key `@type` which contains the type URL\n  and a key `value` which contains the JSON-serialized value.\n\nThe text format representation of an `Any` is like a message with one field\nwhose name is the type URL in brackets. For example, an `Any` containing a\n`foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`."
    },
    "protobufNullValue": {
      "type": "string",
      "enum": [
        "NULL_VALUE"
      ],
      "default": "NULL_VALUE",
      "description": "Represents a JSON `null`.\n\n`NullValue` is a sentinel, using an enum with only one value to represent\nthe null value for the `Value` type union.\n\nA field of type `NullValue` with any value other than `0` is considered\ninvalid. Most ProtoJSON serializers will emit a `Value` with a `nullValue`\nset as a JSON `null` regardless of the integer value, and so will round trip\nto a `0` value.\n\n - NULL_VALUE: Null value."
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "v1AddCampaignRecipientsResponse": {
      "type": "object",
      "properties": {
        "accepted": {
          "type": "integer",
          "format": "int32",
          "description": "Recipients newly added by this call."
        },
        "duplicates": {
          "type": "integer",
          "format": "int32",
          "description": "Recipients already on the campaign (ignored)."
        },
        "skippedOptedOut": {
          "type": "integer",
          "format": "int32",
          "description": "Recipients not added because they are blocked / opted out."
        },
        "total": {
          "type": "integer",
          "format": "int32",
          "description": "Recipients now on the campaign in total."
        }
      }
    },
    "v1AddGroupContactsResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1AddHumanRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Required, max 60 chars."
        },
        "phone": {
          "type": "string",
          "description": "E.164; optional if whatsappMobile is set."
        },
        "whatsappMobile": {
          "type": "string",
          "description": "E.164; optional if phone is set."
        },
        "purpose": {
          "type": "string",
          "description": "Optional role tag, max 60 chars."
        }
      }
    },
    "v1AddHumanResponse": {
      "type": "object",
      "properties": {
        "human": {
          "$ref": "#/definitions/v1Human"
        }
      }
    },
    "v1AddKnowledgeSourceResponse": {
      "type": "object",
      "properties": {
        "source": {
          "$ref": "#/definitions/v1KnowledgeSource",
          "description": "The new source, status \"pending\". Poll GetKnowledgeSource."
        }
      }
    },
    "v1AddNumberRequest": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string",
          "description": "E.164 number to register. Required."
        },
        "label": {
          "type": "string",
          "description": "Optional label (max 60 chars)."
        },
        "makeDefault": {
          "type": "boolean",
          "description": "Force this number to become the default even if others exist."
        }
      }
    },
    "v1AddNumberResponse": {
      "type": "object",
      "properties": {
        "number": {
          "$ref": "#/definitions/v1VoiceNumber"
        }
      }
    },
    "v1Agent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Agent id, unique within the platform."
        },
        "name": {
          "type": "string",
          "description": "Display name."
        },
        "systemPrompt": {
          "type": "string",
          "description": "Identity and context of the agent (who it is, what it represents),\nshared by chat and calls. Hard compliance rules and retrieved knowledge\nare added by the platform on top of this and are not part of it."
        },
        "knowledgeBaseIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "int64"
          },
          "description": "Ids of the knowledge bases attached to this agent, in prompt order."
        },
        "chatInstructions": {
          "type": "string",
          "description": "Behaviour playbook for the text-chat channel (appended after\nsystemPrompt)."
        },
        "callInstructions": {
          "type": "string",
          "description": "Behaviour playbook for voice calls (appended after systemPrompt). Ignored\nfor calls when script is set."
        },
        "script": {
          "type": "string",
          "description": "The organization's own call script (plain text, up to 20,000 characters),\nused instead of callInstructions on voice calls. Empty when unset."
        },
        "fillerWordsEnabled": {
          "type": "boolean",
          "description": "Voice calls only: speak with human-like filler words and self-corrections."
        },
        "voiceGender": {
          "type": "string",
          "description": "Voice for calls: \"male\" or \"female\"."
        },
        "supportEscalationEnabled": {
          "type": "boolean",
          "description": "WhatsApp only: gives the agent support-escalation tools. Requires JIRA and\nGoogle Chat to be connected in the app."
        },
        "backgroundAudioEnabled": {
          "type": "boolean",
          "description": "Voice calls only: play a looped room-ambience bed under the agent's speech."
        },
        "backgroundAudioVolume": {
          "type": "integer",
          "format": "int64",
          "description": "Level of that bed as an integer percent, 0-100."
        }
      },
      "description": "Agent is one saved persona."
    },
    "v1AgentsServiceSendChatMessageBody": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "The user's message (required, non-empty after trimming)."
        }
      }
    },
    "v1ArchiveTemplateResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1AssignChatResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        }
      }
    },
    "v1AutoResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64"
        },
        "title": {
          "type": "string"
        },
        "matchType": {
          "type": "string",
          "description": "\"exact\" or \"contains\"."
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "responseType": {
          "type": "string"
        },
        "responseText": {
          "type": "string"
        },
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "title": "RFC 3339"
        }
      }
    },
    "v1AutoResponseResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Id of the created auto-response (set by create)."
        }
      }
    },
    "v1BlockNumberRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "mobileNumber": {
          "type": "string",
          "description": "E.164 digits (\"+\" optional)."
        }
      }
    },
    "v1BlockNumberResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1BlockedNumber": {
      "type": "object",
      "properties": {
        "mobileNumber": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "title": "RFC 3339"
        }
      }
    },
    "v1BranchLeaderboardRow": {
      "type": "object",
      "properties": {
        "branch": {
          "type": "string",
          "description": "Branch (location) name as recorded on the survey responses."
        },
        "nps": {
          "type": "number",
          "format": "double",
          "description": "NPS over the whole lookback window (not per day), from -100 to 100."
        },
        "responses": {
          "type": "integer",
          "format": "int32",
          "description": "Number of NPS responses in the window."
        },
        "detractors": {
          "type": "integer",
          "format": "int32",
          "description": "Number of detractor responses in the window."
        }
      },
      "description": "One branch's NPS standing."
    },
    "v1BulkImportContactsRequest": {
      "type": "object",
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Contact"
          }
        }
      }
    },
    "v1BulkImportContactsResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "importedCount": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "v1Button": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "v1Call": {
      "type": "object",
      "properties": {
        "callId": {
          "type": "string",
          "format": "int64",
          "description": "Call id; used by GetCall, GetCallTranscript and DownloadCallRecording."
        },
        "direction": {
          "type": "string",
          "description": "\"outbound\" (AI agent dialed the customer), \"inbound\" (customer dialed one\nof the organization's numbers) or \"human\" (bridged human call)."
        },
        "leadId": {
          "type": "string",
          "format": "int64",
          "description": "The dialId returned when this call was placed via the API; 0 for\ninbound calls."
        },
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "AI agent that handled the call; 0 for human-bridged calls."
        },
        "humanId": {
          "type": "string",
          "format": "int64",
          "description": "Human who handled the call; 0 for AI calls."
        },
        "humanName": {
          "type": "string",
          "description": "Human's name for human-bridged calls; empty otherwise."
        },
        "customerName": {
          "type": "string",
          "description": "Customer name if known; may be empty."
        },
        "customerPhone": {
          "type": "string",
          "description": "Customer phone number, E.164 where known."
        },
        "startedAt": {
          "type": "string",
          "description": "When the call started (RFC3339, UTC)."
        },
        "endedAt": {
          "type": "string",
          "description": "When it ended (RFC3339, UTC); empty while ongoing."
        },
        "outcome": {
          "type": "string",
          "description": "Free-text outcome (e.g. \"link_sent\", \"declined\")."
        },
        "sentimentScore": {
          "type": "integer",
          "format": "int32",
          "description": "Sentiment 1 (negative) to 5 (positive); 0 = unscored."
        },
        "sentimentWentRight": {
          "type": "string",
          "description": "What went right / wrong, from the post-call sentiment analysis."
        },
        "sentimentWentWrong": {
          "type": "string"
        },
        "transcriptSummary": {
          "type": "string",
          "description": "AI summary of the conversation; empty if none captured."
        },
        "metrics": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ScoredMetric"
          },
          "description": "The organization's custom scored metrics for this call."
        },
        "hasTranscript": {
          "type": "boolean",
          "description": "True if GetCallTranscript will return content."
        },
        "hasRecording": {
          "type": "boolean",
          "description": "True if DownloadCallRecording will return audio."
        }
      },
      "description": "One call (AI agent call, inbound call, or human-bridged call)."
    },
    "v1CampaignFailure": {
      "type": "object",
      "properties": {
        "mobile": {
          "type": "string"
        },
        "error": {
          "type": "string"
        }
      }
    },
    "v1CampaignRecipient": {
      "type": "object",
      "properties": {
        "mobile": {
          "type": "string",
          "description": "Recipient WhatsApp number in E.164 digits (\"+\" optional)."
        },
        "bodyParams": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Values for the template body variables {{1}}, {{2}}... in order."
        },
        "buttonUrlParams": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Dynamic URL button values, keyed by the button's 0-based index in the\ntemplate's button list. For a carousel they apply to every card's button."
        }
      }
    },
    "v1CampaignSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "templateName": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "title": "draft | queued | running | completed | cancelled | failed"
        },
        "total": {
          "type": "integer",
          "format": "int32",
          "description": "Recipient counters; total = pending + sending + sent + failed + skipped."
        },
        "pending": {
          "type": "integer",
          "format": "int32"
        },
        "sending": {
          "type": "integer",
          "format": "int32"
        },
        "sent": {
          "type": "integer",
          "format": "int32",
          "description": "Accepted by Meta (this does not yet mean delivered to the phone)."
        },
        "failed": {
          "type": "integer",
          "format": "int32"
        },
        "skipped": {
          "type": "integer",
          "format": "int32",
          "description": "Not attempted (opted out, cancelled, out of credits)."
        },
        "error": {
          "type": "string",
          "description": "Campaign-level error, when status is failed."
        },
        "createdAt": {
          "type": "string",
          "title": "RFC 3339"
        },
        "startedAt": {
          "type": "string",
          "title": "RFC 3339, \"\" until it starts"
        },
        "finishedAt": {
          "type": "string",
          "title": "RFC 3339, \"\" until it ends"
        },
        "ratePerSec": {
          "type": "integer",
          "format": "int32",
          "description": "The configured send-rate cap, messages per second."
        },
        "avgRatePerSec": {
          "type": "number",
          "format": "double",
          "description": "Observed throughput since start (0 before it starts) and estimated\nseconds to finish (-1 when unknown)."
        },
        "etaSeconds": {
          "type": "string",
          "format": "int64"
        },
        "scheduledAt": {
          "type": "string",
          "title": "RFC 3339, \"\" when not scheduled"
        },
        "delivered": {
          "type": "integer",
          "format": "int32",
          "description": "Delivery results from Meta's webhooks. Filled by GetCampaign only; list\nand start responses leave them 0.\n\ndelivered or read"
        },
        "read": {
          "type": "integer",
          "format": "int32",
          "title": "read (subset of delivered)"
        },
        "deliveryFailed": {
          "type": "integer",
          "format": "int32",
          "title": "accepted by Meta, then failed to deliver"
        }
      }
    },
    "v1CancelCampaignResponse": {
      "type": "object",
      "properties": {
        "cancelled": {
          "type": "boolean",
          "description": "false if the campaign had already finished."
        }
      }
    },
    "v1CarouselCardMedia": {
      "type": "object",
      "properties": {
        "mediaType": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "mediaUrl": {
          "type": "string"
        },
        "buttonVars": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "v1ChatCitation": {
      "type": "object",
      "properties": {
        "knowledgeBaseName": {
          "type": "string",
          "description": "Knowledge base name."
        },
        "title": {
          "type": "string",
          "description": "Source title."
        },
        "url": {
          "type": "string",
          "description": "Source URL, when it has one."
        }
      },
      "description": "ChatCitation is a knowledge-base passage the reply was grounded on."
    },
    "v1ChatMessage": {
      "type": "object",
      "properties": {
        "direction": {
          "type": "string",
          "title": "in | out"
        },
        "body": {
          "type": "string"
        },
        "msgType": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "description": "Delivery status of outbound messages; empty for inbound."
        },
        "createdAt": {
          "type": "string",
          "title": "RFC 3339"
        }
      }
    },
    "v1ChatSummary": {
      "type": "object",
      "properties": {
        "contact": {
          "type": "string",
          "description": "Customer number, E.164 digits. Use it as `contact` in the chat calls."
        },
        "lastMessage": {
          "type": "string"
        },
        "lastDirection": {
          "type": "string",
          "title": "in | out"
        },
        "lastAt": {
          "type": "string",
          "title": "RFC 3339"
        },
        "unreadCount": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string",
          "description": "WhatsApp profile name; empty if never seen."
        },
        "assigneeId": {
          "type": "string",
          "description": "User id of the assignee; empty = unassigned."
        }
      }
    },
    "v1CommerceCatalogRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "v1CommerceResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1ConnectCatalogRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "catalogId": {
          "type": "string",
          "description": "One of GetCommerceSettings.availableCatalogs."
        },
        "catalogName": {
          "type": "string"
        }
      }
    },
    "v1ConnectNumberRequest": {
      "type": "object",
      "properties": {
        "embeddedSignupCode": {
          "type": "string",
          "description": "Embedded Signup mode: set embeddedSignupCode (+ wabaId/phoneNumberId\nfrom the same signup event). Manual mode: set accessToken instead of\nembeddedSignupCode, with the same wabaId/phoneNumberId."
        },
        "wabaId": {
          "type": "string"
        },
        "phoneNumberId": {
          "type": "string"
        },
        "businessId": {
          "type": "string"
        },
        "accessToken": {
          "type": "string"
        }
      }
    },
    "v1ConnectNumberResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1Contact": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "customFields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "createdAt": {
          "type": "string"
        }
      }
    },
    "v1ContactActivityRow": {
      "type": "object",
      "properties": {
        "contactId": {
          "type": "string",
          "description": "The contact's UUID."
        },
        "name": {
          "type": "string",
          "description": "Contact display name."
        },
        "phone": {
          "type": "string",
          "description": "Contact phone number as stored; empty for test contacts."
        },
        "source": {
          "type": "string",
          "description": "How the contact was created: \"manual\", \"import\", \"inbound\" or \"test\"."
        },
        "lastKind": {
          "type": "string",
          "description": "Kind of the latest interaction: \"call\" or \"whatsapp\"; empty when the\ncontact never interacted."
        },
        "lastChannel": {
          "type": "string",
          "description": "Channel of the latest interaction: \"voice\" or \"whatsapp\"; empty if none."
        },
        "lastAgentId": {
          "type": "string",
          "format": "int64",
          "description": "Id of the AI agent (persona) involved in the latest interaction; 0 if\nnone."
        },
        "lastAgentName": {
          "type": "string",
          "description": "Name of that AI agent."
        },
        "lastAt": {
          "type": "string",
          "description": "When the latest interaction happened (RFC 3339); empty if none."
        },
        "factCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of active facts across all personas."
        },
        "openTodoCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of open todos across all personas."
        }
      },
      "description": "One contact in the activity list."
    },
    "v1ContactAttribute": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "contactCount": {
          "type": "string",
          "format": "int64"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      }
    },
    "v1CreateAgentRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name (required, non-empty after trimming)."
        },
        "systemPrompt": {
          "type": "string",
          "description": "Identity and context of the agent; may be empty and set later."
        },
        "knowledgeBaseIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "int64"
          },
          "description": "Knowledge bases to attach, in prompt order; each must exist in the\norganization."
        }
      }
    },
    "v1CreateAgentResponse": {
      "type": "object",
      "properties": {
        "agent": {
          "$ref": "#/definitions/v1Agent",
          "description": "The created agent, with defaults filled in."
        }
      }
    },
    "v1CreateAutoResponseRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "title": {
          "type": "string",
          "description": "Internal label."
        },
        "matchType": {
          "type": "string",
          "description": "\"exact\" or \"contains\"."
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Incoming-message keywords that trigger the reply."
        },
        "responseText": {
          "type": "string",
          "description": "The reply text."
        },
        "active": {
          "type": "boolean"
        }
      }
    },
    "v1CreateCampaignRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string",
          "description": "Number to send from; see the shared conventions above."
        },
        "name": {
          "type": "string",
          "description": "Human-readable campaign name (shown in reports; also usable as the\ncampaignName filter of ListMessageReports)."
        },
        "templateName": {
          "type": "string",
          "description": "Name of an APPROVED template (see ListTemplates). Required."
        },
        "language": {
          "type": "string",
          "description": "Template language code, e.g. \"en_US\". Needed when the template exists in\nseveral languages."
        },
        "category": {
          "type": "string",
          "description": "Template category recorded for reports (MARKETING, UTILITY,\nAUTHENTICATION); also drives billing."
        },
        "mediaType": {
          "type": "string",
          "description": "For a template with a media header: image, video or document. Then give\nexactly one of mediaId (from UploadMedia/ListMedia) or mediaUrl."
        },
        "mediaId": {
          "type": "string"
        },
        "mediaUrl": {
          "type": "string"
        },
        "cardMedia": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CarouselCardMedia"
          },
          "description": "Per-card media for a carousel template, one entry per card in order.\nLeave empty for non-carousel templates."
        },
        "ratePerSec": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum send rate in messages per second. 0 = server default; values\nabove the server maximum are clamped (the response tells the real rate)."
        },
        "scheduledAt": {
          "type": "string",
          "description": "RFC 3339. Empty = send as soon as StartCampaign is called; otherwise the\ncampaign waits in the queue until this time."
        }
      }
    },
    "v1CreateCampaignResponse": {
      "type": "object",
      "properties": {
        "campaignId": {
          "type": "string",
          "description": "Id to use in all later campaign calls."
        },
        "ratePerSec": {
          "type": "integer",
          "format": "int32",
          "description": "The rate (messages per second) the campaign will actually run at."
        }
      }
    },
    "v1CreateCatalogRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "v1CreateCatalogResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "catalogId": {
          "type": "string"
        }
      }
    },
    "v1CreateContactAttributeRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "v1CreateContactAttributeResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1CreateContactRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "customFields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "v1CreateContactResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "contact": {
          "$ref": "#/definitions/v1Contact"
        }
      }
    },
    "v1CreateCustomFieldRequest": {
      "type": "object",
      "properties": {
        "scopeType": {
          "type": "string",
          "description": "\"default\", \"agent\" or \"human_operators\". Required."
        },
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "Required (and must belong to the organization) when scopeType is \"agent\"."
        },
        "key": {
          "type": "string",
          "description": "Machine key, required, unique across the organization's scopes; immutable."
        },
        "label": {
          "type": "string",
          "description": "Display label, required."
        },
        "description": {
          "type": "string",
          "description": "What to measure and how to score it, required."
        },
        "minValue": {
          "type": "integer",
          "format": "int32",
          "description": "Lowest score."
        },
        "maxValue": {
          "type": "integer",
          "format": "int32",
          "description": "Highest score; must be greater than minValue."
        },
        "position": {
          "type": "integer",
          "format": "int32",
          "description": "Display order within the scope."
        }
      }
    },
    "v1CreateCustomFieldResponse": {
      "type": "object",
      "properties": {
        "field": {
          "$ref": "#/definitions/v1CustomField"
        }
      }
    },
    "v1CreateFlowRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Required."
        },
        "channel": {
          "type": "string",
          "description": "Defaults to \"whatsapp\"."
        }
      }
    },
    "v1CreateGroupRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "v1CreateGroupResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "group": {
          "$ref": "#/definitions/v1Group"
        }
      }
    },
    "v1CreateKnowledgeBaseRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name (required, non-empty after trimming)."
        }
      }
    },
    "v1CreateKnowledgeBaseResponse": {
      "type": "object",
      "properties": {
        "knowledgeBase": {
          "$ref": "#/definitions/v1KnowledgeBase"
        }
      }
    },
    "v1CreateProductBatchRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ProductBatchItem"
          }
        }
      }
    },
    "v1CreateProductBatchResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "productBatchId": {
          "type": "string"
        }
      }
    },
    "v1CreateTemplateRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "msgType": {
          "type": "string"
        },
        "header": {
          "type": "string"
        },
        "headerSample": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "footer": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "buttons": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1TemplateButton"
          }
        },
        "headerSampleFileData": {
          "type": "string",
          "format": "byte"
        },
        "headerSampleFileName": {
          "type": "string"
        },
        "phoneNumberId": {
          "type": "string"
        },
        "addSecurityRecommendation": {
          "type": "boolean",
          "description": "AUTHENTICATION category only — the only two pieces of an AUTHENTICATION\ntemplate Meta lets the caller configure; everything else about that\ncategory (header/body/footer text, OTP button) is fixed by Meta."
        },
        "codeExpirationMinutes": {
          "type": "integer",
          "format": "int32",
          "description": "Minutes before the OTP expires, shown in the message footer. 0 = unset\n(Meta omits the expiration line). Meta accepts 1-90."
        },
        "bodyExample": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "One sample value per {{n}} placeholder detected in body, in order."
        },
        "cards": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/pingxWhatsappV1CarouselCard"
          }
        }
      }
    },
    "v1CreateTemplateResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "template": {
          "$ref": "#/definitions/pingxWhatsappV1Template"
        }
      }
    },
    "v1CreateTestContactRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name for the test contact. Required, at most 120 characters."
        }
      }
    },
    "v1CreateTestContactResponse": {
      "type": "object",
      "properties": {
        "contact": {
          "$ref": "#/definitions/v1TestContact",
          "description": "The created test contact."
        }
      }
    },
    "v1CreditChange": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Monotonic id; newer changes have larger ids."
        },
        "kind": {
          "$ref": "#/definitions/v1CreditChangeKind",
          "description": "Whether credits were added or removed."
        },
        "amountMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "Size of the change in millicredits (always positive; see kind for the\ndirection)."
        },
        "balanceAfterMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "Wallet balance right after this change, in millicredits."
        },
        "description": {
          "type": "string",
          "description": "The note PingX recorded with the change."
        },
        "createdAt": {
          "type": "string",
          "description": "When the change was made (RFC 3339)."
        }
      },
      "description": "One credit added to or removed from the wallet by PingX."
    },
    "v1CreditChangeKind": {
      "type": "string",
      "enum": [
        "CREDIT_CHANGE_KIND_UNSPECIFIED",
        "CREDIT_CHANGE_KIND_CREDIT",
        "CREDIT_CHANGE_KIND_DEBIT"
      ],
      "default": "CREDIT_CHANGE_KIND_UNSPECIFIED",
      "description": "Direction of a credit change.\n\n - CREDIT_CHANGE_KIND_CREDIT: Credits were added to the wallet.\n - CREDIT_CHANGE_KIND_DEBIT: Credits were removed from the wallet."
    },
    "v1CustomField": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Custom field id."
        },
        "scopeType": {
          "type": "string",
          "description": "\"default\" (org-wide), \"agent\" (one agent, see agentId) or\n\"human_operators\" (shared by human operators)."
        },
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "The agent, for scopeType \"agent\"; 0 otherwise."
        },
        "key": {
          "type": "string",
          "description": "Stable machine key (immutable), unique across scopes."
        },
        "label": {
          "type": "string",
          "description": "Display label."
        },
        "description": {
          "type": "string",
          "description": "What to measure and how to score it; guides the AI extraction."
        },
        "minValue": {
          "type": "integer",
          "format": "int32",
          "description": "Lowest score."
        },
        "maxValue": {
          "type": "integer",
          "format": "int32",
          "description": "Highest score (greater than minValue)."
        },
        "position": {
          "type": "integer",
          "format": "int32",
          "description": "Display order within its scope."
        }
      },
      "description": "CustomField is a business-defined metric scored\nfrom each conversation (for example \"Sentiment\", 1-5)."
    },
    "v1CustomMetricPoint": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "description": "The day, as an RFC 3339 timestamp (day granularity)."
        },
        "avgValue": {
          "type": "number",
          "format": "double",
          "description": "Average of the metric over that day's calls, between the series'\nminValue and maxValue."
        }
      },
      "description": "One day's average value of a custom metric."
    },
    "v1CustomMetricSeries": {
      "type": "object",
      "properties": {
        "scopeType": {
          "type": "string",
          "description": "Which kind of caller produced the values: \"agent\" or \"human_operators\"."
        },
        "agentName": {
          "type": "string",
          "description": "AI agent (persona) name; empty for human operators."
        },
        "fieldKey": {
          "type": "string",
          "description": "Stable machine key of the custom field, e.g. \"csat\"."
        },
        "fieldLabel": {
          "type": "string",
          "description": "Human-readable label of the custom field, e.g. \"Customer satisfaction\"."
        },
        "minValue": {
          "type": "integer",
          "format": "int32",
          "description": "Lowest value the field can take (scale lower bound)."
        },
        "maxValue": {
          "type": "integer",
          "format": "int32",
          "description": "Highest value the field can take (scale upper bound)."
        },
        "points": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CustomMetricPoint"
          },
          "description": "Daily average values, oldest first."
        },
        "insightGood": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "AI-written bullets on what is working well. Empty when no insight has\nbeen generated yet or the sample is below the threshold."
        },
        "insightBad": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "AI-written bullets on what is not going well. Same emptiness rule."
        },
        "insightGeneratedAt": {
          "type": "string",
          "description": "When the insight was generated, RFC 3339; empty when none exists yet."
        },
        "insightSampleSize": {
          "type": "integer",
          "format": "int32",
          "description": "Number of calls the insight was (or would be) computed from; 0 when no\ninsight exists yet."
        }
      },
      "description": "A custom metric over time for one scope (an AI agent, or human operators)."
    },
    "v1DailyCount": {
      "type": "object",
      "properties": {
        "day": {
          "type": "string",
          "title": "YYYY-MM-DD"
        },
        "count": {
          "type": "string",
          "format": "int64"
        }
      }
    },
    "v1DeleteAgentResponse": {
      "type": "object"
    },
    "v1DeleteContactAttributeResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1DeleteContactResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1DeleteCustomFieldResponse": {
      "type": "object"
    },
    "v1DeleteGroupResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1DeleteKnowledgeBaseResponse": {
      "type": "object"
    },
    "v1DeleteKnowledgeSourceResponse": {
      "type": "object"
    },
    "v1DeleteMediaResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1DeleteTemplateResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1DisableWebChatResponse": {
      "type": "object"
    },
    "v1DisconnectNumberResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1DuplicateFlowResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "flowId": {
          "type": "string",
          "description": "Id of the new flow."
        },
        "name": {
          "type": "string",
          "description": "\"<original> Copy\"."
        }
      }
    },
    "v1EnableWebChatResponse": {
      "type": "object",
      "properties": {
        "link": {
          "$ref": "#/definitions/v1WebChatLink"
        }
      }
    },
    "v1EndCallResponse": {
      "type": "object",
      "properties": {
        "ended": {
          "type": "boolean",
          "description": "True if an in-progress call was hung up; false if nothing was active."
        }
      }
    },
    "v1Episode": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Numeric episode id."
        },
        "sourceKind": {
          "type": "string",
          "description": "What the episode came from: \"call\" or \"legacy\"."
        },
        "sourceId": {
          "type": "string",
          "description": "Identifier of the source record."
        },
        "channel": {
          "type": "string",
          "description": "Channel: e.g. \"voice\"."
        },
        "occurredAt": {
          "type": "string",
          "description": "When the interaction happened (RFC 3339)."
        },
        "summary": {
          "type": "string",
          "description": "Short summary of the interaction."
        },
        "callId": {
          "type": "string",
          "format": "int64",
          "description": "The call id when sourceKind is \"call\"; 0 otherwise. Use the voice API\nto read the call itself."
        }
      },
      "description": "An episode is one interaction (call) memory was learned from."
    },
    "v1Fact": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Numeric fact id (use it in factId parameters)."
        },
        "category": {
          "type": "string",
          "description": "Kind of knowledge: \"preference\" or \"fact\"."
        },
        "factKey": {
          "type": "string",
          "description": "Stable key of what the fact is about, e.g. \"preferred_language\"."
        },
        "factValue": {
          "type": "string",
          "description": "The remembered value."
        },
        "evidenceQuote": {
          "type": "string",
          "description": "Verbatim quote from the conversation that supports the fact; may be\nempty."
        },
        "confidence": {
          "type": "number",
          "format": "double",
          "description": "Model confidence from 0 to 1."
        },
        "verification": {
          "type": "string",
          "description": "How trustworthy the fact is: \"stated\" (the contact said it), \"inferred\",\n\"unverified\" or \"human\" (entered or corrected through this API/the app)."
        },
        "observedAt": {
          "type": "string",
          "description": "When the fact was last observed (RFC 3339)."
        },
        "expiresAt": {
          "type": "string",
          "description": "When the fact expires (RFC 3339); empty when open-ended."
        },
        "status": {
          "type": "string",
          "description": "Lifecycle: \"active\", \"expired\", \"superseded\" or \"forgotten\"."
        },
        "pinned": {
          "type": "boolean",
          "description": "True when the fact is pinned (protected from automatic overwrite)."
        },
        "contradictions": {
          "type": "integer",
          "format": "int32",
          "description": "How many later observations contradicted this fact."
        },
        "originEpisodeId": {
          "type": "string",
          "format": "int64",
          "description": "Id of the episode the fact was learned in (see GetFactProvenance); 0 if\nunknown."
        },
        "dataClassification": {
          "type": "string",
          "description": "Sensitivity: \"general\" or \"sensitive\"."
        }
      },
      "description": "One remembered fact about a contact, held by one persona."
    },
    "v1FileSource": {
      "type": "object",
      "properties": {
        "filename": {
          "type": "string",
          "description": "File name; its extension picks the parser: .txt, .md or .pdf."
        },
        "data": {
          "type": "string",
          "format": "byte",
          "description": "The raw file bytes (base64 in JSON), at most 10 MB."
        }
      },
      "description": "FileSource is an uploaded document, sent inline."
    },
    "v1Flow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "matchType": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "graph": {
          "type": "object",
          "description": "See the format above."
        },
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "description": "Flow is the full persisted flow including its graph.\n\ngraph format (the Flow Builder's React Flow JSON, stored verbatim):\n  {\"nodes\": [{\"id\": \"n1\", \"type\": \"<type>\", \"position\": {\"x\":0,\"y\":0},\n              \"data\": {...}}],\n   \"edges\": [{\"id\": \"e1\", \"source\": \"n1\", \"target\": \"n2\",\n              \"sourceHandle\": null, \"targetHandle\": null}]}\n\"position\" is only used by the visual editor. Exactly one \"start\" node is\nrequired and must have keywords. \"sourceHandle\" selects the branch of\nmulti-output nodes: \"true\"/\"false\" for condition, the button/row \"id\" for\nbuttons and list, \"giveUp\" for question after maxAttempts invalid replies.\nNode types and their \"data\" fields:\n  start         matchType (exact|contains), keywords[]\n  sendMessage   text\n  question      question, captureAttribute, attributeFormat\n                (text|number|email|phone), validationError, maxAttempts\n  input         prompt, captureAttribute\n  buttons       text, buttons[{id,label}]\n  list          text, buttonLabel, sections[{title, rows[{id,title,description}]}]\n  dynamicList   text, buttonLabel, sectionTitle, sourceContextKey, idField,\n                titleField, descriptionField, captureAttribute\n  media         mediaType (image|video|audio|document), mediaId | mediaUrl, caption\n  multiMedia    items[{mediaType, mediaId, mediaUrl, caption}]\n  askMedia      prompt, captureAttribute, allowedTypes[], validationError\n  askLocation   prompt, captureLocationAttribute, captureAddressAttribute\n  askAddress    prompt, captureAttribute, validationError\n  template      templateName, language, bodyVars[]\n  condition     variable, operator (exists|notExists|equals|notEquals|\n                contains|notContains|greaterThan|lessThan|timeIn|dateIn),\n                value, valueEnd\n  setAttribute  attribute, value\n  addTag        groupId (a contact group id; see ListGroups)\n  delay         amount, unit (seconds|minutes|hours|days)\n  apiRequest    method, url, headers{}, body, saveResponseTo\n  connectFlow   targetFlowId\n  catalogMessage text, footer, thumbnailProductRetailerId\n  product       productRetailerId, bodyText, footerText\n  multiProducts headerText, bodyText, footerText, sections[{title, productRetailerIds[]}]\n  orderDetails  prompt, captureAttribute\nText fields may reference captured attributes with {{attribute}} variables.\nThe safest way to author a graph is to GetFlow an existing flow built in\nthe dashboard and copy its shapes."
    },
    "v1FlowResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Id of the created flow (set by create)."
        }
      }
    },
    "v1FlowSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "description": "\"whatsapp\"."
        },
        "matchType": {
          "type": "string",
          "description": "The Start node's trigger: \"exact\" or \"contains\"."
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "active": {
          "type": "boolean",
          "description": "Only active flows respond to customers."
        },
        "createdAt": {
          "type": "string",
          "title": "RFC 3339"
        },
        "updatedAt": {
          "type": "string",
          "title": "RFC 3339"
        }
      }
    },
    "v1GenerateSystemPromptRequest": {
      "type": "object",
      "properties": {
        "brief": {
          "type": "string",
          "description": "Free-form description of the agent to build: domain, audience, purpose,\ntone, anything relevant. Required."
        }
      }
    },
    "v1GenerateSystemPromptResponse": {
      "type": "object",
      "properties": {
        "systemPrompt": {
          "type": "string",
          "description": "The complete generated system prompt text."
        }
      }
    },
    "v1GetAgentResponse": {
      "type": "object",
      "properties": {
        "agent": {
          "$ref": "#/definitions/v1Agent"
        }
      }
    },
    "v1GetBillingResponse": {
      "type": "object",
      "properties": {
        "configured": {
          "type": "boolean",
          "description": "False when billing is not set up for this organization; the remaining\nfields are then zero values."
        },
        "mode": {
          "$ref": "#/definitions/v1Mode",
          "description": "The billing mode."
        },
        "balanceMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "Current wallet balance in millicredits (1 credit = 1000). May be\nnegative for postpaid modes."
        },
        "negativeCreditLimitMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "For MODE_LIMITED_POSTPAID: how far below zero the balance may go, as a\npositive number of millicredits. 0 for other modes."
        }
      }
    },
    "v1GetBranchLeaderboardResponse": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1BranchLeaderboardRow"
          },
          "description": "Branches, best NPS first."
        },
        "days": {
          "type": "integer",
          "format": "int32",
          "description": "The effective lookback window in days after defaulting/clamping."
        }
      }
    },
    "v1GetCallResponse": {
      "type": "object",
      "properties": {
        "call": {
          "$ref": "#/definitions/v1Call"
        }
      }
    },
    "v1GetCallStatusResponse": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "\"dialing\" (queued / ringing), \"in_progress\" (answered), \"completed\" or\n\"failed\" (could not be placed, or refused; see outcome)."
        },
        "outcome": {
          "type": "string",
          "description": "Free-text outcome once known (e.g. \"link_sent\", \"declined\"), or the\nreason a call was refused (e.g. insufficient credits). Empty while ongoing."
        },
        "callId": {
          "type": "string",
          "format": "int64",
          "description": "The call's id once the call exists (0 while still dialing). Use with\nGetCall / GetCallTranscript / DownloadCallRecording."
        },
        "hasTranscript": {
          "type": "boolean",
          "description": "True once a transcript is available."
        },
        "transcriptSummary": {
          "type": "string",
          "description": "Short AI summary of the conversation; empty until the call has finished\npost-processing."
        },
        "sentimentScore": {
          "type": "integer",
          "format": "int32",
          "description": "Sentiment 1 (negative) to 5 (positive); 0 = not scored yet."
        }
      }
    },
    "v1GetCallTranscriptResponse": {
      "type": "object",
      "properties": {
        "turns": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1TranscriptTurn"
          },
          "description": "The conversation in order. Empty if the call has no transcript."
        }
      }
    },
    "v1GetCallVolumeResponse": {
      "type": "object",
      "properties": {
        "callsPlaced": {
          "type": "integer",
          "format": "int32",
          "description": "Calls placed (attempted) in the window, across AI personas, human\noperators and feedback calls."
        },
        "callsDone": {
          "type": "integer",
          "format": "int32",
          "description": "Calls that completed in the window."
        },
        "days": {
          "type": "integer",
          "format": "int32",
          "description": "The effective lookback window in days after defaulting/clamping."
        }
      }
    },
    "v1GetCampaignResponse": {
      "type": "object",
      "properties": {
        "campaign": {
          "$ref": "#/definitions/v1CampaignSummary"
        },
        "failures": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CampaignFailure"
          },
          "description": "The first 100 recipients that failed, with the reason."
        }
      }
    },
    "v1GetCommerceSettingsResponse": {
      "type": "object",
      "properties": {
        "catalogId": {
          "type": "string",
          "description": "Connected catalog; empty if none."
        },
        "catalogName": {
          "type": "string"
        },
        "catalogVisible": {
          "type": "boolean"
        },
        "cartEnabled": {
          "type": "boolean"
        },
        "availableCatalogs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CommerceCatalogRef"
          },
          "description": "Catalogs on the business that can be connected."
        }
      }
    },
    "v1GetContactByPhoneResponse": {
      "type": "object",
      "properties": {
        "found": {
          "type": "boolean"
        },
        "contact": {
          "$ref": "#/definitions/v1Contact"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "this contact's labels, alphabetical"
        },
        "knownTags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "every label your organization uses"
        }
      }
    },
    "v1GetContactMemoryResponse": {
      "type": "object",
      "properties": {
        "contactId": {
          "type": "string",
          "description": "The contact's UUID."
        },
        "name": {
          "type": "string",
          "description": "Contact display name."
        },
        "phone": {
          "type": "string",
          "description": "Contact phone number; empty for test contacts."
        },
        "source": {
          "type": "string",
          "description": "How the contact was created: \"manual\", \"import\", \"inbound\" or \"test\"."
        },
        "personas": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Persona"
          },
          "description": "Every persona that has interacted with the contact or holds memory about\nthem."
        },
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "The persona this response is scoped to (0 when the contact has no\npersona relationship yet; then the lists below are empty)."
        },
        "facts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Fact"
          },
          "description": "Active facts only."
        },
        "todos": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Todo"
          },
          "description": "Open todos first, then recently closed ones."
        },
        "suppressions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Suppression"
          },
          "description": "Do-not-learn rules for this contact and persona."
        },
        "factCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of active facts."
        },
        "openTodoCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of open todos."
        },
        "callInProgress": {
          "type": "boolean",
          "description": "True when a call with this contact and persona is in progress right now\n(memory may change when it ends)."
        }
      }
    },
    "v1GetCustomMetricsResponse": {
      "type": "object",
      "properties": {
        "series": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CustomMetricSeries"
          },
          "description": "One series per (scope, custom field)."
        },
        "days": {
          "type": "integer",
          "format": "int32",
          "description": "The effective lookback window in days after defaulting/clamping."
        }
      }
    },
    "v1GetFactProvenanceResponse": {
      "type": "object",
      "properties": {
        "origin": {
          "$ref": "#/definitions/v1Episode",
          "description": "The episode the fact was learned in; unset when it has none."
        },
        "mostRecentContradiction": {
          "$ref": "#/definitions/v1Fact",
          "description": "The most recent fact that contradicted this one; unset when none did."
        }
      }
    },
    "v1GetFlowResponse": {
      "type": "object",
      "properties": {
        "flow": {
          "$ref": "#/definitions/v1Flow"
        }
      }
    },
    "v1GetKnowledgeBaseResponse": {
      "type": "object",
      "properties": {
        "knowledgeBase": {
          "$ref": "#/definitions/v1KnowledgeBase",
          "description": "The knowledge base with all its sources."
        }
      }
    },
    "v1GetKnowledgeSourceResponse": {
      "type": "object",
      "properties": {
        "source": {
          "$ref": "#/definitions/v1KnowledgeSource"
        }
      }
    },
    "v1GetMessageStatsResponse": {
      "type": "object",
      "properties": {
        "initiated": {
          "type": "string",
          "format": "int64"
        },
        "sent": {
          "type": "string",
          "format": "int64",
          "title": "cumulative: sent, delivered or read"
        },
        "delivered": {
          "type": "string",
          "format": "int64",
          "title": "cumulative: delivered or read"
        },
        "read": {
          "type": "string",
          "format": "int64"
        },
        "failed": {
          "type": "string",
          "format": "int64"
        },
        "replies": {
          "type": "string",
          "format": "int64"
        },
        "dailyCounts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1DailyCount"
          },
          "description": "Messages per day for the last 7 calendar days."
        }
      }
    },
    "v1GetNpsTrendResponse": {
      "type": "object",
      "properties": {
        "points": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1NpsTrendPoint"
          },
          "description": "Daily points, oldest first."
        },
        "days": {
          "type": "integer",
          "format": "int32",
          "description": "The effective lookback window in days after defaulting/clamping."
        }
      }
    },
    "v1GetOptOutConfigResponse": {
      "type": "object",
      "properties": {
        "matchType": {
          "type": "string",
          "description": "\"exact\" (the whole message equals a keyword) or \"contains\"."
        },
        "optoutKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "optoutResponse": {
          "type": "string",
          "description": "Reply sent when a customer opts out."
        },
        "optoutActive": {
          "type": "boolean"
        },
        "optinKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "optinResponse": {
          "type": "string",
          "description": "Reply sent when a customer opts back in."
        },
        "optinActive": {
          "type": "boolean"
        }
      }
    },
    "v1GetProductBatchResponse": {
      "type": "object",
      "properties": {
        "batch": {
          "$ref": "#/definitions/v1ProductBatch"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ProductBatchItem"
          }
        }
      }
    },
    "v1GetTemplateResponse": {
      "type": "object",
      "properties": {
        "template": {
          "$ref": "#/definitions/pingxWhatsappV1Template"
        }
      }
    },
    "v1GetUsageSummaryResponse": {
      "type": "object",
      "properties": {
        "operations": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1OperationUsage"
          },
          "description": "Usage per operation."
        },
        "totalMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "Total credits charged across all operations, in millicredits."
        },
        "days": {
          "type": "integer",
          "format": "int32",
          "description": "The effective lookback window in days after defaulting/clamping."
        }
      }
    },
    "v1GetWebChatLinkResponse": {
      "type": "object",
      "properties": {
        "link": {
          "$ref": "#/definitions/v1WebChatLink"
        }
      }
    },
    "v1Group": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "contactCount": {
          "type": "integer",
          "format": "int32"
        },
        "createdAt": {
          "type": "string"
        }
      }
    },
    "v1Human": {
      "type": "object",
      "properties": {
        "humanId": {
          "type": "string",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string",
          "description": "Dialed for bridged human calls, E.164; may be empty."
        },
        "whatsappMobile": {
          "type": "string",
          "description": "Where AI agents notify this human on WhatsApp, E.164; may be empty."
        },
        "purpose": {
          "type": "string",
          "description": "Optional role tag (e.g. \"technician\", \"billing\") AI agents can look\npeople up by."
        },
        "active": {
          "type": "boolean",
          "description": "Whether this human can currently be dialed or notified."
        },
        "createdAt": {
          "type": "string",
          "description": "RFC3339, UTC."
        }
      },
      "description": "A person in the directory."
    },
    "v1HumanAssignment": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "format": "int64"
        },
        "humanId": {
          "type": "string",
          "format": "int64"
        },
        "channel": {
          "type": "string",
          "description": "Currently always \"whatsapp\"."
        },
        "createdAt": {
          "type": "string",
          "description": "RFC3339, UTC."
        }
      },
      "description": "One agent-to-human escalation permission."
    },
    "v1InboundMessageRow": {
      "type": "object",
      "properties": {
        "messageId": {
          "type": "string"
        },
        "sender": {
          "type": "string",
          "description": "Sender number, E.164 digits."
        },
        "receivedAt": {
          "type": "string",
          "title": "RFC 3339"
        },
        "msgType": {
          "type": "string",
          "description": "text | button | interactive | image | ..."
        },
        "preview": {
          "type": "string",
          "description": "Best-effort text preview of the content."
        }
      }
    },
    "v1KnowledgeBase": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Knowledge base id."
        },
        "name": {
          "type": "string",
          "description": "Display name."
        },
        "sourceCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of sources in the knowledge base."
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1KnowledgeSource"
          },
          "description": "The sources. Populated only by GetKnowledgeBase and by the\ncreate/update RPCs' responses; empty in ListKnowledgeBases."
        }
      },
      "description": "KnowledgeBase groups sources that agents search to ground their answers."
    },
    "v1KnowledgeBaseIds": {
      "type": "object",
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "int64"
          }
        }
      },
      "description": "KnowledgeBaseIds wraps a list so UpdateAgent can tell \"not provided\" (keep\nthe current attachments) from \"provided, possibly empty\" (replace them)."
    },
    "v1KnowledgeSource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Source id."
        },
        "knowledgeBaseId": {
          "type": "string",
          "format": "int64",
          "description": "Id of the knowledge base it belongs to."
        },
        "sourceType": {
          "type": "string",
          "description": "\"text\" (a note), \"url\" (one page), \"file\" (uploaded document) or \"site\"\n(whole-site crawl)."
        },
        "title": {
          "type": "string",
          "description": "Display title (defaults to the URL or file name)."
        },
        "sourceUri": {
          "type": "string",
          "description": "The URL for url/site sources, the original file name for files, empty for\ntext."
        },
        "status": {
          "type": "string",
          "description": "Ingestion status: \"pending\" (queued), \"crawling\" (site crawl running),\n\"ready\" (fully ingested), \"partial\" (site crawl finished with some pages\nfailed) or \"failed\" (see error)."
        },
        "error": {
          "type": "string",
          "description": "Why ingestion failed; empty unless status is \"failed\"."
        },
        "content": {
          "type": "string",
          "description": "The note text, for \"text\" sources only (empty for the other types)."
        },
        "pagesDiscovered": {
          "type": "integer",
          "format": "int32",
          "description": "Site crawls only: pages found so far."
        },
        "pagesIngested": {
          "type": "integer",
          "format": "int32",
          "description": "Site crawls only: pages successfully ingested so far."
        },
        "pagesFailed": {
          "type": "integer",
          "format": "int32",
          "description": "Site crawls only: pages that failed."
        },
        "ingestionFinished": {
          "type": "boolean",
          "description": "True once ingestion has reached a final state (status ready, partial or\nfailed): stop polling."
        }
      },
      "description": "KnowledgeSource is one piece of knowledge inside a knowledge base. Its\ncontent is extracted, chunked and embedded asynchronously after it is added."
    },
    "v1ListAgentsResponse": {
      "type": "object",
      "properties": {
        "agents": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Agent"
          }
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken to get the next page; empty on the last page."
        }
      }
    },
    "v1ListAutoResponsesResponse": {
      "type": "object",
      "properties": {
        "autoResponses": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1AutoResponse"
          }
        }
      }
    },
    "v1ListBlockedNumbersResponse": {
      "type": "object",
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1BlockedNumber"
          }
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "v1ListCallsResponse": {
      "type": "object",
      "properties": {
        "calls": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Call"
          }
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken for the next page; empty on the last page."
        }
      }
    },
    "v1ListCampaignsResponse": {
      "type": "object",
      "properties": {
        "campaigns": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CampaignSummary"
          }
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "v1ListChatMessagesResponse": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ChatMessage"
          }
        },
        "outsideServiceWindow": {
          "type": "boolean",
          "description": "True when the customer's last inbound message is more than 24 hours old:\nfree-text replies are then refused by WhatsApp and only an approved\ntemplate (SendMessage) can restart the conversation."
        },
        "nextPageToken": {
          "type": "string",
          "description": "Token for the next OLDER page."
        }
      }
    },
    "v1ListChatsResponse": {
      "type": "object",
      "properties": {
        "chats": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ChatSummary"
          }
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "v1ListContactActivityResponse": {
      "type": "object",
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ContactActivityRow"
          },
          "description": "The page of contacts, most recently active first."
        },
        "nextPageToken": {
          "type": "string",
          "description": "Token to pass as pageToken to fetch the next page; empty when this is\nthe last page."
        }
      }
    },
    "v1ListContactAttributesResponse": {
      "type": "object",
      "properties": {
        "attributes": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ContactAttribute"
          }
        }
      }
    },
    "v1ListContactsForAttributeResponse": {
      "type": "object",
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Contact"
          },
          "title": "Contact.custom_fields[name] holds the value"
        }
      }
    },
    "v1ListContactsResponse": {
      "type": "object",
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Contact"
          }
        }
      }
    },
    "v1ListCreditChangesResponse": {
      "type": "object",
      "properties": {
        "creditChanges": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CreditChange"
          },
          "description": "Credit changes, newest first."
        },
        "nextPageToken": {
          "type": "string",
          "description": "Token for the next (older) page; empty when there are no more."
        }
      }
    },
    "v1ListCustomFieldsResponse": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1CustomField"
          },
          "description": "Org-wide fields first, then the scope's own, by position."
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken to get the next page; empty on the last page."
        }
      }
    },
    "v1ListFlowsResponse": {
      "type": "object",
      "properties": {
        "flows": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1FlowSummary"
          }
        }
      }
    },
    "v1ListGroupContactsResponse": {
      "type": "object",
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Contact"
          }
        }
      }
    },
    "v1ListGroupsResponse": {
      "type": "object",
      "properties": {
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Group"
          }
        }
      }
    },
    "v1ListHumanAssignmentsResponse": {
      "type": "object",
      "properties": {
        "assignments": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1HumanAssignment"
          }
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken for the next page; empty on the last page."
        }
      }
    },
    "v1ListHumansResponse": {
      "type": "object",
      "properties": {
        "humans": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Human"
          }
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken for the next page; empty on the last page."
        }
      }
    },
    "v1ListInboundMessagesResponse": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1InboundMessageRow"
          }
        },
        "nextPageToken": {
          "type": "string"
        },
        "totalMatching": {
          "type": "string",
          "format": "int64"
        }
      }
    },
    "v1ListKnowledgeBasesResponse": {
      "type": "object",
      "properties": {
        "knowledgeBases": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1KnowledgeBase"
          },
          "description": "Knowledge bases without their sources."
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken to get the next page; empty on the last page."
        }
      }
    },
    "v1ListKnowledgeSourcesResponse": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1KnowledgeSource"
          }
        },
        "nextPageToken": {
          "type": "string",
          "description": "Pass as pageToken to get the next page; empty on the last page."
        }
      }
    },
    "v1ListMediaResponse": {
      "type": "object",
      "properties": {
        "media": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1MediaItem"
          }
        }
      }
    },
    "v1ListMessage": {
      "type": "object",
      "properties": {
        "header": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "footer": {
          "type": "string"
        },
        "buttonLabel": {
          "type": "string"
        },
        "sections": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ListSection"
          }
        }
      }
    },
    "v1ListMessageReportsResponse": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1MessageReportRow"
          }
        },
        "nextPageToken": {
          "type": "string"
        },
        "totalMatching": {
          "type": "string",
          "format": "int64",
          "description": "Only when includeTotal was set."
        }
      }
    },
    "v1ListMessagesResponse": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1MessageRow"
          }
        }
      }
    },
    "v1ListProductBatchesResponse": {
      "type": "object",
      "properties": {
        "batches": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ProductBatch"
          }
        }
      }
    },
    "v1ListRecentMessagesResponse": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1WhatsAppMessage"
          },
          "description": "Messages, newest first."
        }
      }
    },
    "v1ListRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "v1ListSection": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ListRow"
          }
        }
      }
    },
    "v1ListTemplatesResponse": {
      "type": "object",
      "properties": {
        "templates": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/pingxWhatsappV1Template"
          }
        }
      }
    },
    "v1ListTestContactsResponse": {
      "type": "object",
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1TestContact"
          }
        }
      }
    },
    "v1ListUsageResponse": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1UsageEvent"
          },
          "description": "Usage events, newest first."
        },
        "nextPageToken": {
          "type": "string",
          "description": "Token for the next (older) page; empty when there are no more."
        }
      }
    },
    "v1MarkChatReadResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        }
      }
    },
    "v1Media": {
      "type": "object",
      "properties": {
        "mediaUrl": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "caption": {
          "type": "string"
        },
        "documentName": {
          "type": "string"
        }
      }
    },
    "v1MediaItem": {
      "type": "object",
      "properties": {
        "mediaId": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "v1MessageReportRow": {
      "type": "object",
      "properties": {
        "providerMessageId": {
          "type": "string",
          "description": "WhatsApp message id (\"wamid...\")."
        },
        "campaignName": {
          "type": "string",
          "description": "Empty for one-off sends."
        },
        "templateName": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "recipient": {
          "type": "string",
          "description": "Recipient number, E.164 digits."
        },
        "sentAt": {
          "type": "string",
          "title": "RFC 3339"
        },
        "status": {
          "type": "string",
          "description": "sent | delivered | read | failed; empty = no delivery webhook yet."
        },
        "errorReason": {
          "type": "string"
        },
        "bodyPreview": {
          "type": "string",
          "description": "The rendered message text."
        }
      }
    },
    "v1MessageRow": {
      "type": "object",
      "properties": {
        "providerMessageId": {
          "type": "string"
        },
        "templateName": {
          "type": "string"
        },
        "recipient": {
          "type": "string"
        },
        "sentAt": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "errorReason": {
          "type": "string"
        }
      }
    },
    "v1Mode": {
      "type": "string",
      "enum": [
        "MODE_UNSPECIFIED",
        "MODE_PREPAID",
        "MODE_POSTPAID",
        "MODE_LIMITED_POSTPAID"
      ],
      "default": "MODE_UNSPECIFIED",
      "description": "How the organization pays for usage.\n\n - MODE_UNSPECIFIED: Billing is not set up for this organization.\n - MODE_PREPAID: Sends/calls stop when the credits run out.\n - MODE_POSTPAID: Usage continues past zero; it is billed afterwards.\n - MODE_LIMITED_POSTPAID: Like postpaid, but only down to negativeCreditLimitMillicredits below\nzero."
    },
    "v1NpsTrendPoint": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "description": "The day, as an RFC 3339 timestamp (day granularity)."
        },
        "nps": {
          "type": "number",
          "format": "double",
          "description": "Net Promoter Score for that day aggregated across all branches, from -100\nto 100. 0 when responses = 0 (no data) — check \"responses\" first."
        },
        "responses": {
          "type": "integer",
          "format": "int32",
          "description": "Number of NPS survey responses collected that day across all branches."
        }
      },
      "description": "One day of the NPS trend."
    },
    "v1Number": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "wabaId": {
          "type": "string"
        },
        "displayNumber": {
          "type": "string"
        },
        "verifiedName": {
          "type": "string"
        },
        "isDefault": {
          "type": "boolean"
        },
        "qualityRating": {
          "type": "string"
        },
        "messagingLimitTier": {
          "type": "string"
        }
      }
    },
    "v1OperationUsage": {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "description": "Stable operation key, e.g. \"whatsapp.message\". Use it as the filter in\nListUsage."
        },
        "name": {
          "type": "string",
          "description": "Display name, e.g. \"WhatsApp message\"."
        },
        "unit": {
          "type": "string",
          "description": "Unit of quantity, e.g. \"message\" or \"minute\"."
        },
        "operations": {
          "type": "string",
          "format": "int64",
          "description": "Number of charged operations in the window."
        },
        "quantity": {
          "type": "string",
          "format": "int64",
          "description": "Total quantity in the operation's unit."
        },
        "amountMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "Credits charged in the window, in millicredits."
        },
        "denied": {
          "type": "string",
          "format": "int64",
          "description": "Attempts that were refused (for example for lack of credits); nothing\nwas sent or charged for them."
        }
      },
      "description": "Credits consumed by one kind of operation."
    },
    "v1Persona": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Numeric agent id (usable as agentId in other calls)."
        },
        "name": {
          "type": "string",
          "description": "Agent display name."
        }
      },
      "description": "An AI agent persona holding memory about a contact."
    },
    "v1PlaceCallRequest": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "The AI agent (persona) that will run the call. Required. Must belong to\nthe organization (NOT_FOUND otherwise)."
        },
        "phone": {
          "type": "string",
          "description": "Customer phone number to call, E.164 (e.g. \"+919876543210\"). Required."
        },
        "name": {
          "type": "string",
          "description": "Optional customer display name, shown in call history (max 120 chars)."
        }
      }
    },
    "v1PlaceCallResponse": {
      "type": "object",
      "properties": {
        "dialId": {
          "type": "string",
          "format": "int64",
          "description": "Handle for this dial attempt; pass it to GetCallStatus and EndCall, and\nuse it as leadId in ListCalls to find the resulting call."
        },
        "status": {
          "type": "string",
          "description": "Always \"dialing\" on success (the call has been queued, not yet answered)."
        }
      }
    },
    "v1PlaceHumanCallRequest": {
      "type": "object",
      "properties": {
        "humanId": {
          "type": "string",
          "format": "int64",
          "description": "The human to bridge in (from ListHumans). Required; must have a phone."
        },
        "phone": {
          "type": "string",
          "description": "Customer phone number to call, E.164. Required."
        },
        "name": {
          "type": "string",
          "description": "Optional customer display name (max 120 chars)."
        }
      }
    },
    "v1PlaceHumanCallResponse": {
      "type": "object",
      "properties": {
        "dialId": {
          "type": "string",
          "format": "int64",
          "description": "Handle for this dial attempt; see PlaceCallResponse.dialId."
        },
        "status": {
          "type": "string",
          "description": "Always \"dialing\" on success."
        }
      }
    },
    "v1ProductBatch": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "catalogId": {
          "type": "string"
        },
        "wabaId": {
          "type": "string"
        },
        "productCount": {
          "type": "integer",
          "format": "int32"
        },
        "live": {
          "type": "boolean",
          "description": "Whether the products are available in the catalog."
        },
        "createdAt": {
          "type": "string",
          "title": "RFC 3339"
        },
        "updatedAt": {
          "type": "string",
          "title": "RFC 3339"
        }
      }
    },
    "v1ProductBatchItem": {
      "type": "object",
      "properties": {
        "retailerId": {
          "type": "string",
          "description": "Your own unique product id (SKU)."
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "price": {
          "type": "string",
          "description": "Price as a decimal string, e.g. \"19.99\"."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 code, e.g. \"USD\"."
        },
        "imageUrl": {
          "type": "string",
          "description": "Public HTTPS image URL."
        },
        "category": {
          "type": "string"
        },
        "brand": {
          "type": "string"
        }
      }
    },
    "v1RecrawlKnowledgeSourceResponse": {
      "type": "object",
      "properties": {
        "source": {
          "$ref": "#/definitions/v1KnowledgeSource",
          "description": "The source, status back to \"pending\". Poll GetKnowledgeSource."
        }
      }
    },
    "v1RemoveHumanResponse": {
      "type": "object"
    },
    "v1RemoveNumberResponse": {
      "type": "object"
    },
    "v1ReplyButtons": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string"
        },
        "header": {
          "type": "string"
        },
        "footer": {
          "type": "string"
        },
        "buttons": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Button"
          }
        }
      }
    },
    "v1ScoredMetric": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "description": "Metric name as configured by the organization."
        },
        "value": {
          "type": "integer",
          "format": "int32",
          "description": "Score value for this call."
        }
      },
      "description": "A call's scored metric (an organization-defined custom field, label\nalready resolved)."
    },
    "v1SendMessageRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string",
          "description": "Required once the org has more than one connected number."
        },
        "to": {
          "type": "string"
        },
        "text": {
          "$ref": "#/definitions/v1Text"
        },
        "buttons": {
          "$ref": "#/definitions/v1ReplyButtons"
        },
        "list": {
          "$ref": "#/definitions/v1ListMessage"
        },
        "location": {
          "$ref": "#/definitions/channelV1Location"
        },
        "media": {
          "$ref": "#/definitions/v1Media"
        },
        "template": {
          "$ref": "#/definitions/channelV1Template"
        }
      }
    },
    "v1SendMessageResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "providerMessageId": {
          "type": "string"
        }
      }
    },
    "v1SetCommerceSettingsRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "catalogVisible": {
          "type": "boolean",
          "description": "Show the catalog icon in the chat."
        },
        "cartEnabled": {
          "type": "boolean",
          "description": "Enable the shopping cart."
        }
      }
    },
    "v1SetContactTagsRequest": {
      "type": "object",
      "properties": {
        "phone": {
          "type": "string",
          "title": "required; matched on its digits (8-15)"
        },
        "add": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "labels to add (up to 40 characters each)"
        },
        "remove": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "labels to remove"
        },
        "name": {
          "type": "string",
          "title": "optional: only applied when non-empty"
        }
      }
    },
    "v1SetContactTagsResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "contact": {
          "$ref": "#/definitions/v1Contact"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "the contact's labels after the change"
        },
        "created": {
          "type": "boolean",
          "title": "true when the number was new"
        }
      }
    },
    "v1SetDefaultNumberResponse": {
      "type": "object"
    },
    "v1SetGroupMembersResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1SetHumanAssignmentResponse": {
      "type": "object",
      "properties": {
        "assignment": {
          "$ref": "#/definitions/v1HumanAssignment",
          "description": "The resulting assignment; unset when it was revoked."
        }
      }
    },
    "v1SetInboundAgentResponse": {
      "type": "object",
      "properties": {
        "number": {
          "$ref": "#/definitions/v1VoiceNumber"
        }
      }
    },
    "v1SetOptOutConfigRequest": {
      "type": "object",
      "properties": {
        "phoneNumberId": {
          "type": "string"
        },
        "matchType": {
          "type": "string",
          "description": "\"exact\" or \"contains\"; empty = \"exact\"."
        },
        "optoutKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "optoutResponse": {
          "type": "string"
        },
        "optoutActive": {
          "type": "boolean"
        },
        "optinKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "optinResponse": {
          "type": "string"
        },
        "optinActive": {
          "type": "boolean"
        }
      }
    },
    "v1SetOptOutConfigResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1SetWebhookConfigRequest": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        }
      }
    },
    "v1SetWebhookConfigResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "signingSecret": {
          "type": "string",
          "title": "set only on first configuration"
        }
      }
    },
    "v1SiteSource": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "Start URL of the crawl (required)."
        },
        "maxPages": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum pages to crawl; 0 uses the server default."
        }
      },
      "description": "SiteSource requests a whole-site crawl starting at a URL."
    },
    "v1StartCampaignResponse": {
      "type": "object",
      "properties": {
        "campaign": {
          "$ref": "#/definitions/v1CampaignSummary"
        }
      }
    },
    "v1StartChatConversationRequest": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "Id of the agent to talk to."
        }
      }
    },
    "v1StartChatConversationResponse": {
      "type": "object",
      "properties": {
        "conversationId": {
          "type": "string",
          "format": "int64",
          "description": "Id to pass to SendChatMessage."
        }
      }
    },
    "v1Suppression": {
      "type": "object",
      "properties": {
        "factKey": {
          "type": "string",
          "description": "The suppressed fact key."
        },
        "reason": {
          "type": "string",
          "description": "Why it was suppressed (e.g. the reason given to ForgetFact)."
        },
        "createdBy": {
          "type": "string",
          "description": "Who created it: \"human\" or \"agent\"."
        },
        "createdAt": {
          "type": "string",
          "description": "When it was created (RFC 3339)."
        }
      },
      "description": "A do-not-learn rule: the persona will not (re)learn this factKey for the\ncontact."
    },
    "v1TemplateButton": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "title": "QUICK_REPLY | URL | PHONE_NUMBER | OTP (AUTHENTICATION only)"
        },
        "text": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "sample": {
          "type": "string"
        },
        "phoneNumber": {
          "type": "string"
        }
      }
    },
    "v1TestContact": {
      "type": "object",
      "properties": {
        "contactId": {
          "type": "string",
          "description": "The contact's UUID."
        },
        "name": {
          "type": "string",
          "description": "Display name."
        },
        "createdAt": {
          "type": "string",
          "description": "When it was created (RFC 3339)."
        }
      },
      "description": "A synthetic test contact."
    },
    "v1Text": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string"
        },
        "header": {
          "type": "string"
        },
        "footer": {
          "type": "string"
        },
        "previewUrl": {
          "type": "boolean"
        }
      }
    },
    "v1Todo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Numeric todo id (use it in todoId parameters)."
        },
        "title": {
          "type": "string",
          "description": "What needs to be done, e.g. \"Call back on Friday\"."
        },
        "status": {
          "type": "string",
          "description": "\"open\", \"done\" or \"cancelled\"."
        },
        "createdAt": {
          "type": "string",
          "description": "When the todo was created (RFC 3339)."
        },
        "dueAt": {
          "type": "string",
          "description": "Due time (RFC 3339); empty when none."
        },
        "closedAt": {
          "type": "string",
          "description": "When it was closed (RFC 3339); empty while open."
        },
        "closedBy": {
          "type": "string",
          "description": "Who closed it: \"human\" or \"agent\"; empty while open."
        },
        "closingEvidence": {
          "type": "string",
          "description": "Evidence recorded when it was closed."
        },
        "closingEpisodeId": {
          "type": "string",
          "format": "int64",
          "description": "Episode (call) in which it was closed; 0 if not closed by a call."
        },
        "reopenedAt": {
          "type": "string",
          "description": "When it was last reopened (RFC 3339); empty if never."
        },
        "reopenedBy": {
          "type": "string",
          "description": "Who reopened it: \"human\" or \"agent\"; empty if never."
        }
      },
      "description": "A commitment/follow-up the agent holds for a contact."
    },
    "v1TranscriptTurn": {
      "type": "object",
      "properties": {
        "role": {
          "type": "string",
          "description": "\"assistant\" (the AI agent or human operator side) or \"user\" (the customer)."
        },
        "text": {
          "type": "string",
          "description": "What was said."
        }
      },
      "description": "One spoken turn."
    },
    "v1UnblockNumberResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1UpdateAgentResponse": {
      "type": "object",
      "properties": {
        "agent": {
          "$ref": "#/definitions/v1Agent",
          "description": "The agent after the update."
        }
      }
    },
    "v1UpdateContactResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1UpdateCustomFieldResponse": {
      "type": "object",
      "properties": {
        "field": {
          "$ref": "#/definitions/v1CustomField"
        }
      }
    },
    "v1UpdateGroupResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "v1UpdateHumanResponse": {
      "type": "object",
      "properties": {
        "human": {
          "$ref": "#/definitions/v1Human"
        }
      }
    },
    "v1UpdateKnowledgeBaseResponse": {
      "type": "object",
      "properties": {
        "knowledgeBase": {
          "$ref": "#/definitions/v1KnowledgeBase"
        }
      }
    },
    "v1UpdateKnowledgeSourceResponse": {
      "type": "object",
      "properties": {
        "source": {
          "$ref": "#/definitions/v1KnowledgeSource",
          "description": "The source, status back to \"pending\". Poll GetKnowledgeSource."
        }
      }
    },
    "v1UploadMediaRequest": {
      "type": "object",
      "properties": {
        "mediaType": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "fileName": {
          "type": "string"
        },
        "file": {
          "type": "string",
          "format": "byte"
        },
        "phoneNumberId": {
          "type": "string"
        }
      }
    },
    "v1UploadMediaResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "media": {
          "$ref": "#/definitions/v1MediaItem"
        }
      }
    },
    "v1UsageEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "description": "Monotonic id; newer events have larger ids."
        },
        "operation": {
          "type": "string",
          "description": "Operation key, e.g. \"whatsapp.message\"."
        },
        "name": {
          "type": "string",
          "description": "Display name of the operation."
        },
        "unit": {
          "type": "string",
          "description": "Unit of quantity."
        },
        "details": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Operation-specific details, e.g. country and message category."
        },
        "quantity": {
          "type": "string",
          "format": "int64",
          "description": "Quantity in the operation's unit."
        },
        "amountMillicredits": {
          "type": "string",
          "format": "int64",
          "description": "Credits involved in millicredits."
        },
        "outcome": {
          "$ref": "#/definitions/v1UsageOutcome",
          "description": "Whether it was charged, refunded or denied."
        },
        "createdAt": {
          "type": "string",
          "description": "When it happened (RFC 3339)."
        }
      },
      "description": "One metered usage event."
    },
    "v1UsageOutcome": {
      "type": "string",
      "enum": [
        "USAGE_OUTCOME_UNSPECIFIED",
        "USAGE_OUTCOME_CHARGED",
        "USAGE_OUTCOME_REFUNDED",
        "USAGE_OUTCOME_DENIED"
      ],
      "default": "USAGE_OUTCOME_UNSPECIFIED",
      "description": "What happened to a usage event.\n\n - USAGE_OUTCOME_CHARGED: Credits were charged.\n - USAGE_OUTCOME_REFUNDED: A charge that was given back.\n - USAGE_OUTCOME_DENIED: Refused: nothing was sent or charged."
    },
    "v1VoiceNumber": {
      "type": "object",
      "properties": {
        "numberId": {
          "type": "string",
          "format": "int64",
          "description": "Id used by RemoveNumber, SetDefaultNumber and SetInboundAgent."
        },
        "number": {
          "type": "string",
          "description": "The number, E.164."
        },
        "label": {
          "type": "string",
          "description": "Optional human label (max 60 chars)."
        },
        "isDefault": {
          "type": "boolean",
          "description": "True for the number outbound calls use by default."
        },
        "inboundAgentId": {
          "type": "string",
          "format": "int64",
          "description": "AI agent answering inbound calls to this number; 0 = none (calls refused)."
        },
        "inboundAgentName": {
          "type": "string",
          "description": "Name of that agent; empty when unbound."
        },
        "syncError": {
          "type": "string",
          "description": "Empty when the number is registered on the telephony trunk and dialable;\notherwise why not (the number is refused for calls until fixed)."
        },
        "createdAt": {
          "type": "string",
          "description": "When it was registered (RFC3339, UTC)."
        }
      },
      "description": "A voice phone number registered by the organization."
    },
    "v1WebChatLink": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "format": "int64",
          "description": "The agent the link belongs to."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the public chat page is currently enabled."
        },
        "token": {
          "type": "string",
          "description": "Opaque link token addressing the public chat page; empty when disabled."
        }
      },
      "description": "WebChatLink is the web-chat share-link state of one agent."
    },
    "v1WhatsAppMessage": {
      "type": "object",
      "properties": {
        "direction": {
          "type": "string",
          "description": "\"in\" (from the contact) or \"out\" (to the contact)."
        },
        "body": {
          "type": "string",
          "description": "Message text."
        },
        "sentAt": {
          "type": "string",
          "description": "When it was sent (RFC 3339)."
        }
      },
      "description": "A WhatsApp message in a contact's thread."
    },
    "v1WhatsAppServiceSendChatMessageBody": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string",
          "description": "Text of the reply. Required."
        },
        "phoneNumberId": {
          "type": "string"
        }
      }
    },
    "v1WriteResult": {
      "type": "object",
      "properties": {
        "affected": {
          "type": "integer",
          "format": "int32",
          "description": "Number of rows the operation changed. 0 means nothing matched (for\nexample the fact was already forgotten, or does not exist for this\ncontact/persona); for the bulk operations it is the count of facts\nforgotten or rows deleted."
        }
      },
      "description": "Outcome of a memory write."
    }
  },
  "host": "api.pingx.ai",
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "ApiKey": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header",
      "description": "Bearer <API key>, e.g. `Bearer pkLiveXxxx`. Create keys under Settings > API Keys."
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}