@omnidim-ai/mcp-server 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -35
- package/build/flat-args.d.ts +15 -0
- package/build/flat-args.js +57 -0
- package/build/flat-args.js.map +1 -0
- package/build/helpers.js +3 -4
- package/build/helpers.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +395 -285
- package/build/index.js.map +1 -1
- package/build/playbooks.generated.d.ts +23 -0
- package/build/playbooks.generated.js +420 -0
- package/build/playbooks.generated.js.map +1 -0
- package/build/procedures.d.ts +11 -7
- package/build/procedures.js +45 -843
- package/build/procedures.js.map +1 -1
- package/build/tool-annotations.js +1 -0
- package/build/tool-annotations.js.map +1 -1
- package/build/tool-marks.js +14 -14
- package/build/tool-marks.js.map +1 -1
- package/package.json +1 -1
- package/src/flat-args.ts +57 -0
- package/src/helpers.ts +3 -4
- package/src/index.ts +394 -285
- package/src/playbooks.generated.ts +419 -0
- package/src/procedures.ts +52 -862
- package/src/tool-annotations.ts +1 -0
- package/src/tool-marks.ts +14 -14
package/build/index.js
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import { readApiKey } from "./credentials.js";
|
|
6
6
|
import { isInteractive, printInteractiveHelp, requestIdNote, startupBanner, trimLargeResponse, USER_AGENT } from "./helpers.js";
|
|
7
7
|
import { beginSession, emitSessionCrash, emitSessionEnd, endSession, recordToolError, recordToolResult } from "./telemetry.js";
|
|
8
|
-
import { registerProcedures } from "./procedures.js";
|
|
8
|
+
import { READ_GUIDE_INSTRUCTION, addGuideTool, callGuideTool, isGuideTool, registerProcedures } from "./procedures.js";
|
|
9
9
|
import { keepReadOnlyTools, readOnlyMode, toolAnnotations } from "./tool-annotations.js";
|
|
10
10
|
import { addShowWorkflow, toolMeta } from "./workflow-canvas.js";
|
|
11
11
|
import { addDocsTools, callDocsTool, isDocsTool } from "./docs-tools.js";
|
|
12
|
+
import { flatInputSchema, nestBodyArgs } from "./flat-args.js";
|
|
12
13
|
import { notifyUpdates } from "./update_notifier.js";
|
|
13
14
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
14
15
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -20,7 +21,7 @@ import axios from 'axios';
|
|
|
20
21
|
* Server configuration
|
|
21
22
|
*/
|
|
22
23
|
export const SERVER_NAME = "OmniDimension";
|
|
23
|
-
export const SERVER_VERSION = "0.
|
|
24
|
+
export const SERVER_VERSION = "0.21.0"; // x-release-please-version
|
|
24
25
|
// Base URL for the API. Pinned to production; not env-overridable.
|
|
25
26
|
export const API_BASE_URL = "https://omnidim.io/api/v1";
|
|
26
27
|
/**
|
|
@@ -41,7 +42,9 @@ Conventions:
|
|
|
41
42
|
- For details on one item, call get<Resource>(id) after listing.
|
|
42
43
|
- Dispatching calls: run listPhoneNumbers first. If the account has numbers, pass the chosen one as from_number_id. If it has none, omit from_number_id and the platform's default number is used. Never guess a from_number_id.
|
|
43
44
|
- Configure OMNIDIM_API_KEY in your MCP client config to authenticate.
|
|
44
|
-
- API reference: https://docs.omnidim.io
|
|
45
|
+
- API reference: https://docs.omnidim.io
|
|
46
|
+
|
|
47
|
+
${READ_GUIDE_INSTRUCTION}`;
|
|
45
48
|
const server = new Server({ name: SERVER_NAME, version: SERVER_VERSION }, { capabilities: { tools: {}, prompts: {}, resources: {} }, instructions: SERVER_INSTRUCTIONS });
|
|
46
49
|
// Prompts (procedures) and resources (reference) layered on top of the tools.
|
|
47
50
|
registerProcedures(server);
|
|
@@ -51,18 +54,15 @@ registerProcedures(server);
|
|
|
51
54
|
const toolDefinitionMap = new Map([
|
|
52
55
|
["createSession", {
|
|
53
56
|
name: "createSession",
|
|
54
|
-
description: `Create a voice
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
safe to hand out because it is single-use and expires. For how to
|
|
64
|
-
connect and talk, see "Connect the client and talk" below the
|
|
65
|
-
request details.
|
|
57
|
+
description: `Create a short-lived voice session and get a \`ws_url\` for one conversation.
|
|
58
|
+
|
|
59
|
+
This is step 1 of 2. Creating the session starts no audio. The client then
|
|
60
|
+
connects to \`ws_url\` over WebSocket to talk.
|
|
61
|
+
|
|
62
|
+
Call this endpoint from your server with your API key. Return only \`ws_url\`
|
|
63
|
+
to your client, and never the API key. The \`ws_url\` is single-use and
|
|
64
|
+
expires, so it is safe to hand to your client. For how to connect and talk,
|
|
65
|
+
see "Connect the client and talk" below the request details.
|
|
66
66
|
|
|
67
67
|
(Tags: Sessions)`,
|
|
68
68
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["agent_id", "type"], "properties": { "agent_id": { "type": "number", "description": "ID of the agent the session talks to." }, "type": { "type": "string", "default": "voice", "enum": ["voice"], "description": "The session type. Only `voice` is supported." }, "custom_variables": { "type": "object", "additionalProperties": true, "description": "Per-session variables that personalize the conversation.\nSet server-side, so visitors cannot tamper with them.\nTwo reserved keys are read as instructions for this session\nand never reach the agent: `__languages` and\n`__post_call_actions`.\n", "properties": { "__languages": { "oneOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "string" }], "description": "Languages this session runs in, replacing the agent's\nconfigured list. The first entry is the language the\nvisitor is greeted in. Send an array, or a pipe-separated\nstring such as `Hindi|English`.\n" }, "__post_call_actions": { "allOf": [{ "type": "object", "additionalProperties": true, "description": "Post-call actions: email, webhook, Omni CRM, WhatsApp, workflow, Google Sheets, Slack, Salesforce, HubSpot or Zoho Bigin. On an agent, add them one at a time with addPostCallAction instead. Full shape: https://docs.omnidim.io/docs/per-call-post-call-actions" }], "description": "Post-call actions for this session only, in the same shape\nas `post_call_actions` on agent create. Email and webhook\nonly. They replace the agent's own post-call actions for\nthis session. Items that cannot be used are skipped and\nlisted in `post_call_actions_ignored`.\n" } } }, "metadata": { "type": "object", "additionalProperties": true, "description": "Key-value pairs stored on the session for your own\ntracking (e.g. CRM or lead IDs). Not shared with the\nagent; echoed back as `metadata` in the post-call\nwebhook so you can correlate results with your records.\n" } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -89,23 +89,19 @@ request details.
|
|
|
89
89
|
}],
|
|
90
90
|
["createAgent", {
|
|
91
91
|
name: "createAgent",
|
|
92
|
-
description: `Create
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
ambient background track, initial ringing
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
> **Voicemail detection is an access-gated feature** that we turn on per
|
|
106
|
-
account. If it isn't enabled for yours yet,
|
|
107
|
-
[request access](https://omnidim.io/contact-us?reason=product&lock=1)
|
|
108
|
-
before configuring the \`voicemail\` object.
|
|
92
|
+
description: `Create an agent from a name and a context. Every other setting is optional.
|
|
93
|
+
|
|
94
|
+
Optional settings: transcriber, model, voice, web search, transfer,
|
|
95
|
+
end-call conditions, post-call actions (email, webhook, Omni CRM, Cloud
|
|
96
|
+
WhatsApp, or a workflow), ambient background track, initial ringing
|
|
97
|
+
sound and multilingual support.
|
|
98
|
+
|
|
99
|
+
Leave out \`model\`, \`transcriber\` and \`voice\` to get your organization's
|
|
100
|
+
defaults, which always work. To pick one, use the LLM, STT or TTS provider
|
|
101
|
+
list: it shows only the models your organization can use. Any other model is
|
|
102
|
+
refused, and the error names the default to use.
|
|
103
|
+
|
|
104
|
+
> **Voicemail detection is access-gated** and turned on per account. If it is off for yours, [request access](https://omnidim.io/contact-us?reason=product&lock=1) before you configure the \`voicemail\` object.
|
|
109
105
|
|
|
110
106
|
(Tags: Agents)`,
|
|
111
107
|
inputSchema: { "type": "object", "properties": { "Idempotency-Key": { "type": "string", "maxLength": 255, "description": "Your own unique key for this agent, for example a fresh UUID.\nSend the same key when you retry. If the first request already\ncreated the agent, you get that agent back instead of a second\none, so a request that timed out is safe to repeat. The same key\nwith a different request body is refused. Keys are kept for 24\nhours.\n" }, "requestBody": { "allOf": [{ "type": "object", "description": "Agent configuration.", "properties": { "name": { "type": "string", "description": "Name for the agent.", "example": "Customer Support Agent" }, "welcome_message": { "type": "string", "description": "Initial message the agent will say when answering a call.", "example": "Hello! How can I help you today?" }, "is_welcome_message_dynamic": { "type": "boolean", "description": "When true, the welcome message is treated as a directive the agent uses to generate a tailored greeting for each call, rather than being spoken word for word. When false, the welcome message is spoken exactly as written." }, "is_welcome_message_interruption": { "type": "boolean", "description": "Allow the caller to interrupt the welcome message. When false, the agent finishes speaking the welcome before listening." }, "is_interruption_allowed": { "type": "boolean", "description": "Global toggle for whether the caller can interrupt the agent mid-sentence at any point in the call." }, "dynamic_variables": { "type": "object", "description": "Key/value map used to substitute placeholders in the agent's\nprompt and welcome message at call time. Reference a variable\nin your prompt with `{{variable_name}}`. Useful for\npersonalising the same agent across many calls.\n", "additionalProperties": { "type": "string" }, "example": { "customer_name": "Jane Doe", "order_id": "ORD-12345" } }, "context_breakdown": { "type": "array", "description": "List of context breakdowns, each containing `title`, `body`, and optional `is_enabled`.", "items": { "type": "object", "required": ["title", "body"], "properties": { "title": { "type": "string", "description": "Title of the breakdown.", "example": "Purpose" }, "body": { "type": "string", "description": "Body of the breakdown, the detailed prompt content.", "example": "This agent helps customers with product inquiries and support issues." }, "is_enabled": { "type": "boolean", "default": true, "description": "Whether this section is included in the prompt." } } } }, "call_type": { "type": "string", "enum": ["Incoming", "Outgoing"], "description": "Call type of the assistant." }, "timezone": { "type": "string", "description": "IANA timezone for this agent, for example `Asia/Kolkata`. Sets the local date and time the agent works with during calls. If not set, the account timezone is used as fallback. Pass an empty string to clear it.", "example": "America/New_York" }, "transcriber": { "type": "object", "description": "Configuration for the speech-to-text transcriber.", "properties": { "provider": { "type": "string", "description": "The speech-to-text provider to use: a `name` from the STT providers list, which returns the ones your organization can use. Leave it out to use your organization's default transcriber.", "example": "deepgram_stream" }, "model": { "type": "string", "description": "Transcription model for the selected provider. For\n`deepgram_stream` this is `nova-3` or `nova-2`; other\nproviders take their own model identifiers.\n", "example": "nova-3" }, "language": { "type": "string", "description": "Language code for the transcriber. Format and supported\nvalues depend on the provider (e.g. `en-US` for Deepgram,\n`hi-IN` for Sarvam). Applies regardless of which\n`provider` is selected.\n", "example": "en-US" }, "silence_timeout_ms": { "type": "integer", "description": "Silence timeout in milliseconds.", "example": 400 }, "should_apply_noise_reduction": { "type": "boolean", "description": "Reduce background noise on the inbound audio stream before transcription." }, "interruption_min_words": { "type": "integer", "minimum": 1, "description": "Minimum number of words the caller must say before their speech is treated as an interruption.", "example": 2 }, "max_call_duration_in_sec": { "type": "integer", "minimum": 1, "description": "Hard upper bound on call length in seconds. The agent will end the call once this is reached.", "example": 600 }, "first_ideal_message": { "type": "string", "description": "First nudge spoken when the caller goes silent past the\nidle threshold. Set `is_first_ideal_message_dynamic` to\n`true` to have the LLM regenerate this each time.\n" }, "is_first_ideal_message_dynamic": { "type": "boolean", "description": "When true, `first_ideal_message` is treated as a prompt and the LLM generates a fresh nudge each call." }, "second_ideal_message": { "type": "string", "description": "Second nudge spoken if silence continues after the first." }, "is_second_ideal_message_dynamic": { "type": "boolean", "description": "When true, `second_ideal_message` is treated as a prompt and the LLM generates a fresh nudge each call." }, "numerals": { "type": "boolean", "description": "Convert numbers from words to digits." }, "punctuate": { "type": "boolean", "description": "Add punctuation to the transcript." }, "smart_format": { "type": "boolean", "description": "Apply smart formatting to the transcript." }, "diarize": { "type": "boolean", "description": "Identify different speakers in the transcript." } } }, "model": { "type": "object", "description": "Configuration for the language model.", "properties": { "model": { "type": "string", "description": "The language model to use: a `name` from the LLM providers list, which returns exactly the models your organization can use. Leave it out to use your organization's default model.", "example": "gpt-4.1-mini" }, "temperature": { "type": "number", "minimum": 0, "maximum": 1, "description": "Controls randomness in the model's output (0.0 to 1.0).", "example": 0.7 } } }, "voice": { "type": "object", "description": "Configuration for the text-to-speech voice. `provider` and `voice_id` identify the voice together, so send both to change it. `provider` on its own is not accepted, and a `voice_id` on its own leaves the voice as it was. The other fields here apply independently. Leave out `provider` and `voice_id` to use your organization's default voice.", "dependentRequired": { "provider": ["voice_id"] }, "properties": { "provider": { "type": "string", "description": "The voice provider to use: the `service` of a voice from the voices list, which returns only voices your organization can use. Send `voice_id` alongside it. We recommend OmniDimension voices (list them with `provider=featured`) and Cartesia voices. An agent created without `voice` gets the platform default, a Cartesia voice, which every account can use.", "example": "cartesia" }, "voice_id": { "type": "string", "description": "The provider's voice identifier, returned in the `name` field of the voices list (not the numeric `id`). Takes effect when `provider` is sent alongside it.", "example": "faf0731e-dfb9-4cfc-8119-259a79b27e12" }, "speech_speed": { "type": "number", "minimum": 0.5, "maximum": 2, "default": 1, "description": "Playback speed multiplier for the agent's voice. 1.0 is normal speed." } } }, "web_search": { "type": "object", "description": "Configuration for web search capabilities.", "properties": { "enabled": { "type": "boolean", "description": "Enable or disable web search functionality." }, "provider": { "type": "string", "enum": ["DuckDuckGo", "openAI"], "description": "The search provider to use.", "example": "DuckDuckGo" } } }, "post_call_actions": { "type": "object", "additionalProperties": true, "description": "Post-call actions: email, webhook, Omni CRM, WhatsApp, workflow, Google Sheets, Slack, Salesforce, HubSpot or Zoho Bigin. On an agent, add them one at a time with addPostCallAction instead. Full shape: https://docs.omnidim.io/docs/per-call-post-call-actions" }, "transfer": { "type": "object", "description": "Conditional call transfer to a human agent or another number.", "properties": { "enabled": { "type": "boolean" }, "transfer_options": { "type": "array", "description": "Where to transfer the call and under what condition. The first matching condition wins. In an agent update, sending this list replaces all saved options. Omit it to keep them unchanged, or send an empty array to clear them.", "items": { "type": "object", "required": ["number", "transfer_condition", "transfer_message"], "properties": { "number": { "type": "string", "description": "Primary phone number to transfer to. Include country code with leading `+`.", "example": "+15551234567" }, "type": { "type": "string", "enum": ["static", "dynamic"], "default": "static", "description": "`static` transfers to `number`. `dynamic` lets the agent\npick a number at runtime based on the conversation.\n" }, "backup_numbers": { "type": "array", "description": "Fallback numbers tried if the primary is unreachable.", "items": { "type": "string" } }, "transfer_condition": { "type": "string", "description": "Natural-language condition that triggers this transfer option.", "example": "Transfer if the customer asks to speak with a human." }, "transfer_message": { "type": "string", "description": "Message the agent says to the caller before executing the transfer.", "example": "Please hold while I connect you to one of our agents." } } } } } }, "end_call": { "type": "object", "description": "Hang up automatically when a condition is met.", "properties": { "enabled": { "type": "boolean" }, "condition": { "type": "string", "description": "Natural-language condition that triggers ending the call. Only evaluated when `enabled` is true.", "example": "End the call once the customer's issue is resolved." }, "message": { "type": "string", "description": "What the agent says before hanging up.", "example": "Thank you for contacting us. Have a great day!" }, "message_type": { "type": "string", "enum": ["static", "prompt"], "description": "`static` speaks `message` verbatim. `prompt` treats\n`message_prompt` as an LLM instruction and generates a\nfresh closing line each call (useful for matching the\ncaller's language and tone).\n" }, "message_prompt": { "type": "string", "description": "LLM prompt used to generate the closing line when `message_type` is `prompt`.", "example": "End the call politely in the same language the user is speaking." } } }, "background_track": { "type": "object", "description": "Ambient background noise that plays under the agent's voice.", "properties": { "enabled": { "type": "boolean", "description": "Whether to mix the ambient track under the agent's audio." }, "name": { "type": "string", "enum": ["call_center", "filler", "office", "office_1", "restaurant"], "description": "Ambient track to mix under the agent." }, "volume": { "type": "number", "minimum": 0, "maximum": 1, "default": 0.2, "description": "Volume level on a 0–1 scale. Default 0.2." }, "tts_volume_reduction": { "type": "number", "minimum": 0, "maximum": 1, "description": "Amount to drop the agent's TTS volume while the ambient track plays, on a 0–1 scale. Helps the voice cut through without raising the overall mix." } } }, "initial_ringing_sound_enabled": { "type": "boolean", "description": "Plays a ringing tone after the call is picked up, until the agent starts speaking." }, "voicemail": { "type": "object", "description": "Voicemail / answering-machine handling for outbound calls. Set this with the nested object shown here; the agent object returns these values as the flat fields `voicemail_enabled` and `voicemail_message`. Voicemail detection is an access-gated feature. If it isn't enabled for your account, [request access](https://omnidim.io/contact-us?reason=product&lock=1).", "properties": { "enabled": { "type": "boolean", "description": "Detect voicemail and leave your message instead of speaking to a machine." }, "message": { "type": "string", "description": "Message to leave when voicemail is detected." } } }, "languages": { "type": "array", "description": "Languages the agent should support. Pass each language as a display-name string exactly as it appears in the dashboard's language picker. Unrecognized names are skipped.", "items": { "type": "string" }, "example": ["English (India)", "Hindi"] } } }, { "type": "object", "required": ["name", "context_breakdown"] }], "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -119,7 +115,12 @@ before configuring the \`voicemail\` object.
|
|
|
119
115
|
}],
|
|
120
116
|
["getAgent", {
|
|
121
117
|
name: "getAgent",
|
|
122
|
-
description: `Get
|
|
118
|
+
description: `Get one agent by ID.
|
|
119
|
+
|
|
120
|
+
The response includes \`can_publish\`: whether [version
|
|
121
|
+
history](/docs/api-reference/agents/listAgentVersions) is on for the agent's
|
|
122
|
+
organization.
|
|
123
|
+
|
|
123
124
|
(Tags: Agents)`,
|
|
124
125
|
inputSchema: { "type": "object", "properties": { "agent_id": { "type": "number", "description": "The ID of the agent." } }, "required": ["agent_id"] },
|
|
125
126
|
method: "get",
|
|
@@ -132,11 +133,12 @@ before configuring the \`voicemail\` object.
|
|
|
132
133
|
}],
|
|
133
134
|
["updateAgent", {
|
|
134
135
|
name: "updateAgent",
|
|
135
|
-
description: `Update an
|
|
136
|
+
description: `Update an agent. Send only the fields you want to change.
|
|
136
137
|
|
|
137
|
-
\`post_call_actions\` replaces the agent's email, webhook, Omni CRM, Cloud WhatsApp and workflow actions as one set, but only
|
|
138
|
+
\`post_call_actions\` replaces the agent's email, webhook, Omni CRM, Cloud WhatsApp and workflow actions as one set, but only if you send at least one of those types. Google Sheets, Slack, Salesforce, HubSpot and Zoho Bigin actions are replaced only when you send their key. Other actions are kept. If a sent action gives a variable key a new prompt, kept actions with the same key take that prompt too. To change one action alone, use \`/agents/{agent_id}/post-call-actions\`.
|
|
139
|
+
|
|
140
|
+
> **Voicemail detection is access-gated** and turned on per account. If it is off for yours, [request access](https://omnidim.io/contact-us?reason=product&lock=1) before you configure the \`voicemail\` object.
|
|
138
141
|
|
|
139
|
-
> **Voicemail detection is an access-gated feature** that we turn on per account. If it isn't enabled for yours yet, [request access](https://omnidim.io/contact-us?reason=product&lock=1) before configuring the \`voicemail\` object below.
|
|
140
142
|
(Tags: Agents)`,
|
|
141
143
|
inputSchema: { "type": "object", "properties": { "agent_id": { "type": "number", "description": "The ID of the agent." }, "requestBody": { "type": "object", "description": "Agent configuration.", "properties": { "name": { "type": "string", "description": "Name for the agent." }, "welcome_message": { "type": "string", "description": "Initial message the agent will say when answering a call." }, "is_welcome_message_dynamic": { "type": "boolean", "description": "When true, the welcome message is treated as a directive the agent uses to generate a tailored greeting for each call, rather than being spoken word for word. When false, the welcome message is spoken exactly as written." }, "is_welcome_message_interruption": { "type": "boolean", "description": "Allow the caller to interrupt the welcome message. When false, the agent finishes speaking the welcome before listening." }, "is_interruption_allowed": { "type": "boolean", "description": "Global toggle for whether the caller can interrupt the agent mid-sentence at any point in the call." }, "dynamic_variables": { "type": "object", "description": "Key/value map used to substitute placeholders in the agent's\nprompt and welcome message at call time. Reference a variable\nin your prompt with `{{variable_name}}`. Useful for\npersonalising the same agent across many calls.\n", "additionalProperties": { "type": "string" } }, "context_breakdown": { "type": "array", "description": "List of context breakdowns, each containing `title`, `body`, and optional `is_enabled`.", "items": { "type": "object", "required": ["title", "body"], "properties": { "title": { "type": "string", "description": "Title of the breakdown." }, "body": { "type": "string", "description": "Body of the breakdown, the detailed prompt content." }, "is_enabled": { "type": "boolean", "default": true, "description": "Whether this section is included in the prompt." } } } }, "call_type": { "type": "string", "enum": ["Incoming", "Outgoing"], "description": "Call type of the assistant." }, "timezone": { "type": "string", "description": "IANA timezone for this agent, for example `Asia/Kolkata`. Sets the local date and time the agent works with during calls. If not set, the account timezone is used as fallback. Pass an empty string to clear it." }, "transcriber": { "type": "object", "description": "Configuration for the speech-to-text transcriber.", "properties": { "provider": { "type": "string", "description": "The speech-to-text provider to use: a `name` from the STT providers list, which returns the ones your organization can use. Leave it out to use your organization's default transcriber." }, "model": { "type": "string", "description": "Transcription model for the selected provider. For\n`deepgram_stream` this is `nova-3` or `nova-2`; other\nproviders take their own model identifiers.\n" }, "language": { "type": "string", "description": "Language code for the transcriber. Format and supported\nvalues depend on the provider (e.g. `en-US` for Deepgram,\n`hi-IN` for Sarvam). Applies regardless of which\n`provider` is selected.\n" }, "silence_timeout_ms": { "type": "number", "description": "Silence timeout in milliseconds." }, "should_apply_noise_reduction": { "type": "boolean", "description": "Reduce background noise on the inbound audio stream before transcription." }, "interruption_min_words": { "type": "number", "minimum": 1, "description": "Minimum number of words the caller must say before their speech is treated as an interruption." }, "max_call_duration_in_sec": { "type": "number", "minimum": 1, "description": "Hard upper bound on call length in seconds. The agent will end the call once this is reached." }, "first_ideal_message": { "type": "string", "description": "First nudge spoken when the caller goes silent past the\nidle threshold. Set `is_first_ideal_message_dynamic` to\n`true` to have the LLM regenerate this each time.\n" }, "is_first_ideal_message_dynamic": { "type": "boolean", "description": "When true, `first_ideal_message` is treated as a prompt and the LLM generates a fresh nudge each call." }, "second_ideal_message": { "type": "string", "description": "Second nudge spoken if silence continues after the first." }, "is_second_ideal_message_dynamic": { "type": "boolean", "description": "When true, `second_ideal_message` is treated as a prompt and the LLM generates a fresh nudge each call." }, "numerals": { "type": "boolean", "description": "Convert numbers from words to digits." }, "punctuate": { "type": "boolean", "description": "Add punctuation to the transcript." }, "smart_format": { "type": "boolean", "description": "Apply smart formatting to the transcript." }, "diarize": { "type": "boolean", "description": "Identify different speakers in the transcript." } } }, "model": { "type": "object", "description": "Configuration for the language model.", "properties": { "model": { "type": "string", "description": "The language model to use: a `name` from the LLM providers list, which returns exactly the models your organization can use. Leave it out to use your organization's default model." }, "temperature": { "type": "number", "minimum": 0, "maximum": 1, "description": "Controls randomness in the model's output (0.0 to 1.0)." } } }, "voice": { "type": "object", "description": "Configuration for the text-to-speech voice. `provider` and `voice_id` identify the voice together, so send both to change it. `provider` on its own is not accepted, and a `voice_id` on its own leaves the voice as it was. The other fields here apply independently. Leave out `provider` and `voice_id` to use your organization's default voice.", "dependentRequired": { "provider": ["voice_id"] }, "properties": { "provider": { "type": "string", "description": "The voice provider to use: the `service` of a voice from the voices list, which returns only voices your organization can use. Send `voice_id` alongside it. We recommend OmniDimension voices (list them with `provider=featured`) and Cartesia voices. An agent created without `voice` gets the platform default, a Cartesia voice, which every account can use." }, "voice_id": { "type": "string", "description": "The provider's voice identifier, returned in the `name` field of the voices list (not the numeric `id`). Takes effect when `provider` is sent alongside it." }, "speech_speed": { "type": "number", "minimum": 0.5, "maximum": 2, "default": 1, "description": "Playback speed multiplier for the agent's voice. 1.0 is normal speed." } } }, "web_search": { "type": "object", "description": "Configuration for web search capabilities.", "properties": { "enabled": { "type": "boolean", "description": "Enable or disable web search functionality." }, "provider": { "type": "string", "enum": ["DuckDuckGo", "openAI"], "description": "The search provider to use." } } }, "post_call_actions": { "type": "object", "additionalProperties": true, "description": "Post-call actions: email, webhook, Omni CRM, WhatsApp, workflow, Google Sheets, Slack, Salesforce, HubSpot or Zoho Bigin. On an agent, add them one at a time with addPostCallAction instead. Full shape: https://docs.omnidim.io/docs/per-call-post-call-actions" }, "transfer": { "type": "object", "description": "Conditional call transfer to a human agent or another number.", "properties": { "enabled": { "type": "boolean" }, "transfer_options": { "type": "array", "description": "Where to transfer the call and under what condition. The first matching condition wins. In an agent update, sending this list replaces all saved options. Omit it to keep them unchanged, or send an empty array to clear them.", "items": { "type": "object", "required": ["number", "transfer_condition", "transfer_message"], "properties": { "number": { "type": "string", "description": "Primary phone number to transfer to. Include country code with leading `+`." }, "type": { "type": "string", "enum": ["static", "dynamic"], "default": "static", "description": "`static` transfers to `number`. `dynamic` lets the agent\npick a number at runtime based on the conversation.\n" }, "backup_numbers": { "type": "array", "description": "Fallback numbers tried if the primary is unreachable.", "items": { "type": "string" } }, "transfer_condition": { "type": "string", "description": "Natural-language condition that triggers this transfer option." }, "transfer_message": { "type": "string", "description": "Message the agent says to the caller before executing the transfer." } } } } } }, "end_call": { "type": "object", "description": "Hang up automatically when a condition is met.", "properties": { "enabled": { "type": "boolean" }, "condition": { "type": "string", "description": "Natural-language condition that triggers ending the call. Only evaluated when `enabled` is true." }, "message": { "type": "string", "description": "What the agent says before hanging up." }, "message_type": { "type": "string", "enum": ["static", "prompt"], "description": "`static` speaks `message` verbatim. `prompt` treats\n`message_prompt` as an LLM instruction and generates a\nfresh closing line each call (useful for matching the\ncaller's language and tone).\n" }, "message_prompt": { "type": "string", "description": "LLM prompt used to generate the closing line when `message_type` is `prompt`." } } }, "background_track": { "type": "object", "description": "Ambient background noise that plays under the agent's voice.", "properties": { "enabled": { "type": "boolean", "description": "Whether to mix the ambient track under the agent's audio." }, "name": { "type": "string", "enum": ["call_center", "filler", "office", "office_1", "restaurant"], "description": "Ambient track to mix under the agent." }, "volume": { "type": "number", "minimum": 0, "maximum": 1, "default": 0.2, "description": "Volume level on a 0–1 scale. Default 0.2." }, "tts_volume_reduction": { "type": "number", "minimum": 0, "maximum": 1, "description": "Amount to drop the agent's TTS volume while the ambient track plays, on a 0–1 scale. Helps the voice cut through without raising the overall mix." } } }, "initial_ringing_sound_enabled": { "type": "boolean", "description": "Plays a ringing tone after the call is picked up, until the agent starts speaking." }, "voicemail": { "type": "object", "description": "Voicemail / answering-machine handling for outbound calls. Set this with the nested object shown here; the agent object returns these values as the flat fields `voicemail_enabled` and `voicemail_message`. Voicemail detection is an access-gated feature. If it isn't enabled for your account, [request access](https://omnidim.io/contact-us?reason=product&lock=1).", "properties": { "enabled": { "type": "boolean", "description": "Detect voicemail and leave your message instead of speaking to a machine." }, "message": { "type": "string", "description": "Message to leave when voicemail is detected." } } }, "languages": { "type": "array", "description": "Languages the agent should support. Pass each language as a display-name string exactly as it appears in the dashboard's language picker. Unrecognized names are skipped.", "items": { "type": "string" } } } } }, "required": ["agent_id", "requestBody"] },
|
|
142
144
|
method: "put",
|
|
@@ -175,7 +177,12 @@ before configuring the \`voicemail\` object.
|
|
|
175
177
|
}],
|
|
176
178
|
["addPostCallAction", {
|
|
177
179
|
name: "addPostCallAction",
|
|
178
|
-
description: `Add one post-call action to
|
|
180
|
+
description: `Add one post-call action to an agent.
|
|
181
|
+
|
|
182
|
+
The agent's other actions stay as they are. Send an \`Idempotency-Key\` header
|
|
183
|
+
to retry safely: the same key and body return the action the first request
|
|
184
|
+
added.
|
|
185
|
+
|
|
179
186
|
(Tags: Agents)`,
|
|
180
187
|
inputSchema: { "type": "object", "properties": { "agent_id": { "type": "number", "description": "The ID of the agent." }, "Idempotency-Key": { "type": "string", "description": "Any unique string. A retry with the same key and body adds nothing new." }, "requestBody": { "allOf": [{ "type": "object", "description": "One post-call action. `type` picks the channel; send the fields of\nthat channel plus any of the shared ones. `type` is required when\nadding an action; an update sends only the fields it changes.\n", "properties": { "type": { "type": "string", "enum": ["email", "webhook", "omni_crm", "cloud_whatsapp", "workflow", "google_sheets", "slack", "salesforce", "hubspot", "zoho_bigin"], "description": "The channel. It cannot change after the action is created:\ndelete it and add a new one. `google_sheets`, `slack`,\n`salesforce`, `hubspot` and `zoho_bigin` deliver through an\naccount connected in the dashboard: pass its id as\n`integration_id` (see List integrations).\n" }, "integration_id": { "type": "integer", "description": "`google_sheets`, `slack`, `salesforce`, `hubspot`, `zoho_bigin`\nonly, required: the id of your integration of that type.\n" }, "spreadsheet_id": { "type": "string", "description": "`google_sheets` only, required: the id in the sheet's URL, the\npart after `/d/`.\n", "example": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms" }, "spreadsheet_name": { "type": "string", "description": "`google_sheets` only: the sheet's name, for display." }, "worksheet_name": { "type": "string", "description": "`google_sheets` only: the tab to append to. Defaults to `Sheet1`.", "example": "Calls" }, "channel_id": { "type": "string", "description": "`slack` only: the channel id. Send this or `channel_name`.", "example": "C08RTQ1NY81" }, "channel_name": { "type": "string", "description": "`slack` only: the channel name. Send this or `channel_id`.", "example": "sales" }, "object_name": { "type": "string", "description": "`salesforce`: `Lead` (default), `Contact`, `Account`,\n`Opportunity`, `Case`, `Task` or `Product`. `hubspot`, required:\n`contact`, `company`, `deal` or `ticket`. Both send a fixed set of\nfields for the chosen object, so they take no `extracted_variables`.\n" }, "create_call_log": { "type": "boolean", "description": "`zoho_bigin` only: log the call in Zoho Bigin. Defaults to true." }, "update_contact": { "type": "boolean", "description": "`zoho_bigin` only: update a matching contact with what the call captured. Defaults to true." }, "create_contact": { "type": "boolean", "description": "`zoho_bigin` only: create a contact when no contact matches. Defaults to true." }, "action": { "type": "string", "enum": ["create", "upsert"], "description": "`salesforce` only: `upsert` finds the record by the caller's number\nand updates it or creates it. `create` creates a new record every\ncall. Defaults to `create`.\n" }, "match_field": { "type": "string", "description": "`salesforce` only, with `upsert`: the phone field the caller's number is looked up in. Defaults to `Phone`.", "example": "Phone" }, "log_call": { "type": "boolean", "description": "`salesforce` only: log the call on the record, with the summary and recording link. Defaults to false." }, "add_note": { "type": "boolean", "description": "`salesforce` only: add the call summary as a note on the record. Defaults to false." }, "recipients": { "type": "array", "description": "`email` only, required: the addresses to notify.", "items": { "type": "string", "format": "email" }, "example": ["support@acme-corp.io"] }, "url": { "type": "string", "format": "uri", "description": "`webhook` only, required: the endpoint that receives a POST with the call payload.", "example": "https://crm.acme-corp.io/omnidim-callback" }, "phone_number_id": { "type": "integer", "description": "`cloud_whatsapp` only, required: your Cloud WhatsApp number the message is sent from. Also send `template_id` or `templates`, or nothing is sent." }, "template_id": { "type": "integer", "description": "`cloud_whatsapp` only: an approved template on that number." }, "template_variables": { "type": "array", "description": "`cloud_whatsapp` only: which extracted variable fills each template placeholder.", "items": { "type": "object", "properties": { "index": { "type": "string", "description": "The placeholder number, as a string.", "example": "1" }, "extracted_var": { "type": "string", "description": "The key of the extracted variable whose value fills this placeholder.", "example": "customer_name" } } } }, "templates": { "type": "array", "description": "`cloud_whatsapp` only: one or more templates to send.", "items": { "type": "object", "description": "One Cloud WhatsApp template to send after the call.", "properties": { "template_id": { "type": "integer", "description": "An approved template on the chosen number." }, "usage_description": { "type": "string", "description": "When this template should be sent. After the call, the model reads\nthese descriptions to choose which templates fit the conversation.\n", "example": "Send when the caller books an appointment." }, "always_send": { "type": "boolean", "description": "Send this template after every call, whichever templates the model chooses." }, "variable_mappings": { "type": "array", "description": "How to fill each template placeholder.", "items": { "type": "object", "properties": { "index": { "type": "string", "description": "The placeholder number, as a string.", "example": "1" }, "extracted_var": { "type": "string", "description": "The extracted variable whose value fills this placeholder." }, "static_value": { "type": "string", "description": "A fixed value for this placeholder. When set, it is used\ninstead of the extracted variable.\n" }, "mode": { "type": "string", "enum": ["variable", "static"], "description": "Which input the dashboard shows for this placeholder. It\ndoes not change the value sent: a `static_value` is used\nfirst, then the extracted variable, then `fallback_value`.\n" }, "fallback_value": { "type": "string", "description": "The value to use when the variable is not extracted." } } } } } } }, "workflow_id": { "type": "integer", "description": "`workflow` only, required: the workflow to run. It must have a published version, or the action is skipped." }, "include": { "type": "array", "description": "Which sections to include.", "items": { "type": "string", "enum": ["summary", "extracted_variables", "fullConversation", "sentiment"] } }, "extracted_variables": { "type": "array", "description": "Variables the model should pull out of the conversation. A key\nalready used by another action on this agent must have the same\nprompt, or the request is refused with `400`. Other actions are\nnever changed to match.\n", "items": { "type": "object", "required": ["key", "prompt"], "properties": { "key": { "type": "string", "description": "Unique identifier for the variable in the post-call payload.", "example": "customer_issue" }, "prompt": { "type": "string", "description": "Instruction for the model on what to pull out of the conversation.", "example": "Identify the main issue the customer is experiencing." } } } }, "trigger_call_statuses": { "type": "array", "description": "Call outcomes that fire this action. Omit to use the default\n(`completed`, `voicemail_detected`).\n", "items": { "type": "string", "enum": ["completed", "voicemail_detected", "failed", "no-answer", "busy", "canceled"] } } } }, { "required": ["type"] }], "description": "The JSON request body." } }, "required": ["agent_id", "requestBody"] },
|
|
181
188
|
method: "post",
|
|
@@ -214,7 +221,15 @@ before configuring the \`voicemail\` object.
|
|
|
214
221
|
}],
|
|
215
222
|
["listIntegrations", {
|
|
216
223
|
name: "listIntegrations",
|
|
217
|
-
description: `List
|
|
224
|
+
description: `List your workspace integrations, with each one's \`id\` and
|
|
225
|
+
\`integration_type\`.
|
|
226
|
+
|
|
227
|
+
Stored credentials (tokens, secrets, passwords, API keys, and the values of
|
|
228
|
+
a custom API's headers and parameters) are never returned. They read
|
|
229
|
+
\`********\`. When you create an integration, send the real values: \`********\`
|
|
230
|
+
is refused. Accounts that sign in with OAuth (Google Sheets, Slack, HubSpot,
|
|
231
|
+
Salesforce, Zoho Bigin) are connected in the dashboard.
|
|
232
|
+
|
|
218
233
|
(Tags: Integrations)`,
|
|
219
234
|
inputSchema: { "type": "object", "properties": {} },
|
|
220
235
|
method: "get",
|
|
@@ -227,7 +242,13 @@ before configuring the \`voicemail\` object.
|
|
|
227
242
|
}],
|
|
228
243
|
["createCustomApiIntegration", {
|
|
229
244
|
name: "createCustomApiIntegration",
|
|
230
|
-
description: `Save a call to your own HTTP endpoint as an integration.
|
|
245
|
+
description: `Save a call to your own HTTP endpoint as an integration.
|
|
246
|
+
|
|
247
|
+
Attach it to an agent with \`attachAgentIntegration\`. The agent calls the
|
|
248
|
+
endpoint during a call when the conversation needs it, then uses the
|
|
249
|
+
response in its reply. The agent fills parameters marked \`isLLMGenerated\`
|
|
250
|
+
from the conversation.
|
|
251
|
+
|
|
231
252
|
(Tags: Integrations)`,
|
|
232
253
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["name", "url", "method"], "properties": { "name": { "type": "string", "description": "A name for the integration." }, "description": { "type": "string", "description": "What the endpoint does. The agent reads this to decide\nwhen to call it, so say what it returns and when it is useful.\n" }, "url": { "type": "string", "format": "uri" }, "method": { "type": "string", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] }, "headers": { "type": "array", "description": "Fixed headers sent on every request.", "items": { "type": "object", "required": ["key", "value"], "properties": { "key": { "type": "string" }, "value": { "type": "string" } } } }, "query_params": { "type": "array", "description": "Query string parameters.", "items": { "type": "object", "description": "One query or body parameter of a custom API. With `isLLMGenerated`\ntrue the agent fills the value from the conversation, guided by\n`description`. With it false, the text in `description` is sent as a\nfixed value.\n", "required": ["key"], "properties": { "key": { "type": "string", "description": "The parameter name your endpoint expects." }, "description": { "type": "string", "description": "What the agent should put here, or the fixed value when `isLLMGenerated` is false." }, "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "default": "string" }, "required": { "type": "boolean", "description": "Whether the agent must supply this parameter." }, "isLLMGenerated": { "type": "boolean", "default": true, "description": "Let the agent fill this value from the conversation." }, "children": { "type": "array", "description": "Nested fields of an `object` or `array` body parameter. Query parameters have no children.", "items": { "type": "object" } } } } }, "body_params": { "type": "array", "description": "Request body fields, sent as JSON. A GET request sends no\nbody. Every request with a body also carries the call's\n`from_number`, `to_number` and `call_sid`.\n", "items": { "type": "object", "description": "One query or body parameter of a custom API. With `isLLMGenerated`\ntrue the agent fills the value from the conversation, guided by\n`description`. With it false, the text in `description` is sent as a\nfixed value.\n", "required": ["key"], "properties": { "key": { "type": "string", "description": "The parameter name your endpoint expects." }, "description": { "type": "string", "description": "What the agent should put here, or the fixed value when `isLLMGenerated` is false." }, "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "default": "string" }, "required": { "type": "boolean", "description": "Whether the agent must supply this parameter." }, "isLLMGenerated": { "type": "boolean", "default": true, "description": "Let the agent fill this value from the conversation." }, "children": { "type": "array", "description": "Nested fields of an `object` or `array` body parameter. Query parameters have no children.", "items": { "type": "object" } } } } }, "request_timeout": { "type": "number", "default": 10, "description": "Seconds to wait for your endpoint before the agent moves on." } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
233
254
|
method: "post",
|
|
@@ -253,7 +274,11 @@ before configuring the \`voicemail\` object.
|
|
|
253
274
|
}],
|
|
254
275
|
["attachAgentIntegration", {
|
|
255
276
|
name: "attachAgentIntegration",
|
|
256
|
-
description: `Attach
|
|
277
|
+
description: `Attach an integration to an agent.
|
|
278
|
+
|
|
279
|
+
The agent can use it on its next call. Integrations already attached stay as
|
|
280
|
+
they are.
|
|
281
|
+
|
|
257
282
|
(Tags: Integrations)`,
|
|
258
283
|
inputSchema: { "type": "object", "properties": { "agent_id": { "type": "number", "description": "The ID of the agent." }, "requestBody": { "type": "object", "required": ["integration_id"], "properties": { "integration_id": { "type": "number", "description": "The integration's id, from `listIntegrations` or a create response." } }, "description": "The JSON request body." } }, "required": ["agent_id", "requestBody"] },
|
|
259
284
|
method: "post",
|
|
@@ -331,7 +356,13 @@ before configuring the \`voicemail\` object.
|
|
|
331
356
|
}],
|
|
332
357
|
["diffAgentVersion", {
|
|
333
358
|
name: "diffAgentVersion",
|
|
334
|
-
description: `Get a record-level diff for
|
|
359
|
+
description: `Get a record-level diff for one agent version.
|
|
360
|
+
|
|
361
|
+
By default it compares this version with the one before it. Use
|
|
362
|
+
\`against=current\` to compare with the live config, which shows what
|
|
363
|
+
restoring this version would change. Use \`against=<number>\` to compare with
|
|
364
|
+
another version.
|
|
365
|
+
|
|
335
366
|
(Tags: Agents)`,
|
|
336
367
|
inputSchema: { "type": "object", "properties": { "agent_id": { "type": "number", "description": "The ID of the agent." }, "version_number": { "type": "number", "description": "The version number, as returned in `version_number` from the list or save endpoints." }, "against": { "type": "string", "description": "What to compare against. Omit or `previous` for the version before this one (the default). `current` for the agent's live config. A version number to compare with that version." } }, "required": ["agent_id", "version_number"] },
|
|
337
368
|
method: "get",
|
|
@@ -344,7 +375,13 @@ before configuring the \`voicemail\` object.
|
|
|
344
375
|
}],
|
|
345
376
|
["restoreAgentVersion", {
|
|
346
377
|
name: "restoreAgentVersion",
|
|
347
|
-
description: `Restore a version onto the live agent.
|
|
378
|
+
description: `Restore a version onto the live agent.
|
|
379
|
+
|
|
380
|
+
Your current setup is saved first as a backup version, so restoring is
|
|
381
|
+
undoable. Configuration comes back. Knowledge files or integrations deleted
|
|
382
|
+
since this version was saved can't be re-linked. They are reported in
|
|
383
|
+
\`skipped\`.
|
|
384
|
+
|
|
348
385
|
(Tags: Agents)`,
|
|
349
386
|
inputSchema: { "type": "object", "properties": { "agent_id": { "type": "number", "description": "The ID of the agent." }, "version_number": { "type": "number", "description": "The version number, as returned in `version_number` from the list or save endpoints." }, "requestBody": { "type": "object", "properties": {}, "description": "The JSON request body." } }, "required": ["agent_id", "version_number"] },
|
|
350
387
|
method: "post",
|
|
@@ -357,8 +394,9 @@ before configuring the \`voicemail\` object.
|
|
|
357
394
|
}],
|
|
358
395
|
["dispatchCall", {
|
|
359
396
|
name: "dispatchCall",
|
|
360
|
-
description: `
|
|
361
|
-
|
|
397
|
+
description: `Start a call to a phone number with an agent.
|
|
398
|
+
|
|
399
|
+
The phone number must include a country code with a leading plus.
|
|
362
400
|
|
|
363
401
|
(Tags: Calls)`,
|
|
364
402
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["agent_id", "to_number"], "properties": { "agent_id": { "type": "number", "description": "The ID of the agent that will handle the call." }, "to_number": { "type": "string", "description": "The phone number to call. Must include country code (e.g., +15551234567)." }, "from_number_id": { "type": "number", "description": "Id of a phone number on your account to place the call from (see the phone number list endpoint). Omit to use the platform's default number." }, "call_context": { "type": "object", "description": "Optional context information as key-value pairs to be passed to the agent during the call. Can contain any custom fields relevant to your use case.", "additionalProperties": true }, "metadata": { "type": "object", "additionalProperties": true, "description": "Key-value pairs stored on the call for your own tracking\n(e.g. CRM or lead IDs). Not shared with the agent; echoed\nback as `metadata` in the post-call webhook so you can\ncorrelate results with your records.\n" }, "__languages": { "oneOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "string" }], "description": "Languages this call runs in, replacing the agent's configured\nlist for this call only. The first entry is the language the\ncall opens in. Send an array, or a pipe-separated string such\nas `Hindi|English`. Names the platform does not recognize are\nskipped and listed in `languages_ignored`.\n" }, "__post_call_actions": { "allOf": [{ "type": "object", "additionalProperties": true, "description": "Post-call actions: email, webhook, Omni CRM, WhatsApp, workflow, Google Sheets, Slack, Salesforce, HubSpot or Zoho Bigin. On an agent, add them one at a time with addPostCallAction instead. Full shape: https://docs.omnidim.io/docs/per-call-post-call-actions" }], "description": "Post-call actions for this call only, in the same shape as\n`post_call_actions` on agent create. Email and webhook only.\nThey replace the agent's own post-call actions for this call;\nthe agent is not changed. Items that cannot be used are\nskipped and listed in `post_call_actions_ignored`, and the\ncall still goes out. Can also be sent inside `call_context`.\n" } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -411,15 +449,15 @@ phone number must include a country code with a leading plus.
|
|
|
411
449
|
}],
|
|
412
450
|
["createBulkCall", {
|
|
413
451
|
name: "createBulkCall",
|
|
414
|
-
description: `Create a
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
452
|
+
description: `Create a bulk-call campaign.
|
|
453
|
+
|
|
454
|
+
Only \`name\`, \`phone_number_id\` and a \`contact_list\` are needed to dial a
|
|
455
|
+
list now. Every other field adds one behavior: drafts, rotation, filtering,
|
|
456
|
+
scheduling, retries or dynamic feeding.
|
|
418
457
|
|
|
419
|
-
The guide below the field reference
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
operate a campaign once it runs.
|
|
458
|
+
The guide below the field reference shows each behavior with a working
|
|
459
|
+
request, every refusal message with its fix, and the endpoints that operate
|
|
460
|
+
a running campaign.
|
|
423
461
|
|
|
424
462
|
(Tags: Bulk calls)`,
|
|
425
463
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["name", "phone_number_id"], "properties": { "name": { "type": "string", "description": "Name of the bulk call campaign." }, "phone_number_id": { "type": "string", "description": "The number this campaign calls from. With a `rotation`, the\nrotation numbers dial instead and this one is the standby.\n" }, "bot_id": { "type": "number", "description": "Agent to run the campaign. Defaults to the agent attached\nto `phone_number_id`; required when the number has none.\n" }, "save_as_draft": { "type": "boolean", "default": false, "description": "Store the campaign without dialing; start it later with the\nstart endpoint. See Drafts in the guide below.\n" }, "call_conditions": { "type": "array", "description": "Dial only the contacts that match every condition; the rest\nare kept as `Skipped`. See Filtering in the guide below.\n", "items": { "type": "object", "required": ["column", "operator", "value"], "properties": { "column": { "type": "string", "description": "Key on the contact row to test." }, "operator": { "type": "string", "default": "equals", "enum": ["equals", "not_equals", "contains", "greater_than", "less_than"], "description": "`contains` is case-insensitive. `greater_than` and\n`less_than` compare numerically, and a row whose value\nis not a number fails the condition rather than\nerroring.\n" }, "value": { "type": "string" } } } }, "rotation": { "type": "object", "description": "Rotate the campaign across several of your numbers, so no\nsingle number burns out. See Rotation in the guide below.\n", "required": ["numbers"], "properties": { "numbers": { "type": "array", "minItems": 1, "description": "The numbers to rotate across; each must be yours and\nlisted once.\n", "items": { "type": "object", "required": ["phone_number_id"], "properties": { "phone_number_id": { "type": "number", "description": "One of your numbers, from List phone numbers." }, "sequence": { "type": "number", "default": 10, "description": "Rotation order. Lowest dials first." } } } }, "strategy": { "type": "string", "default": "fixed_count", "enum": ["fixed_count", "cpr_threshold", "both", "none"], "description": "When to move to the next number: every\n`calls_per_number` calls, on low health score, both, or\nnever.\n" }, "calls_per_number": { "type": "number", "default": 50, "description": "Calls before moving on. Used by `fixed_count` and `both`." }, "health_threshold": { "type": "number", "default": 30, "description": "Health score below which a number is rotated away from.\nUsed by `cpr_threshold` and `both`.\n" }, "fallback": { "type": "string", "default": "pause", "enum": ["pause", "continue_best"], "description": "When every number is unhealthy: `pause` the campaign,\nor `continue_best` with the healthiest one.\n" }, "call_back_from_different_number": { "type": "boolean", "default": false, "description": "When on, a repeat call to the same person goes out from\na different number than the one that called them last.\nNeeds two or more numbers in the pool.\n" } } }, "skip_known_invalid_numbers": { "type": "boolean", "default": false, "description": "When on, a contact is not dialed if the carrier said its\nnumber does not exist, in any campaign of your organization\nin the last 14 days. That contact shows as a failed call\nwith the reason `Invalid number` and is never retried.\n" }, "is_dynamic": { "type": "boolean", "default": false, "description": "A dynamic campaign stays alive accepting contacts via the\nadd-contact webhooks, and `contact_list` becomes optional.\n" }, "contact_list": { "type": "array", "description": "Who to call. Each row needs `phone_number`; any other key\nreaches the agent as context for that one call.\n", "items": { "type": "object", "required": ["phone_number"], "properties": { "phone_number": { "type": "string", "description": "Phone number in international format (e.g., +15551234567)." } }, "additionalProperties": true } }, "is_scheduled": { "type": "boolean", "default": false, "description": "Whether the campaign should be scheduled for future execution." }, "scheduled_datetime": { "type": "string", "description": "Scheduled execution time in format `YYYY-MM-DD HH:MM:SS` (required if `is_scheduled` is true)." }, "timezone": { "type": "string", "default": "UTC", "description": "Timezone for scheduled execution." }, "concurrent_call_limit": { "type": "number", "default": 1, "minimum": 1, "description": "Maximum number of concurrent calls allowed." }, "enabled_reschedule_call": { "type": "boolean", "default": false, "description": "Enable automatic call rescheduling. When enabled the system can reschedule unreachable calls." }, "retry_config": { "type": "object", "description": "Auto-retry configuration object containing retry settings.", "properties": { "auto_retry": { "type": "boolean", "default": false }, "auto_retry_schedule": { "type": "string", "enum": ["immediately", "next_day", "scheduled_time"], "description": "When to retry failed calls." }, "retry_schedule_days": { "type": "number", "default": 0, "minimum": 0, "description": "Days to wait before a scheduled retry." }, "retry_schedule_hours": { "type": "number", "default": 0, "minimum": 0, "description": "Hours to wait before a scheduled retry." }, "retry_limit": { "type": "number", "default": 1, "minimum": 1, "maximum": 10, "description": "Retry attempts, 1 to 10. To disable retries omit it and\nleave `auto_retry` false; never send `0`. Ignored when\n`retry_steps` is set.\n" }, "retry_steps": { "type": "array", "minItems": 1, "maxItems": 10, "description": "A different delay for each retry, in order: retry 1\nwaits for the first step, retry 2 for the second, and\nso on. When set, it replaces `auto_retry_schedule`,\n`retry_schedule_days`, `retry_schedule_hours` and\n`retry_limit`: a contact gets one retry per step. Each\ndelay is at most 30 days. A retry that falls outside\nthe campaign's daily calling hours waits until they\nopen again.\n\nA `days` step can also name a time of day with `at`:\n`{\"delay\": 1, \"unit\": \"days\", \"at\": \"10:00\"}` is 10:00\nthe next day, and `{\"delay\": 0, \"unit\": \"days\", \"at\":\n\"16:00\"}` the same day at 16:00. The date and time are\nread in the calling window's timezone,\n`daily_stop_timezone`; a campaign without a window\n(`enable_daily_hard_stop` off) uses its `timezone`.\nEach retry counts from the try before it; a time that\nhas already passed moves to the next day.\n", "items": { "type": "object", "required": ["delay", "unit"], "properties": { "delay": { "type": "number", "minimum": 0, "description": "How long to wait, in `unit`. `0` retries right away." }, "unit": { "type": "string", "enum": ["minutes", "hours", "days"] }, "at": { "type": "string", "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$", "description": "Time of day, `HH:MM` (24-hour) in\n`daily_stop_timezone`, or in `timezone` when\n`enable_daily_hard_stop` is off. Only on a\n`days` step; `delay: 0` means the same day.\n" } } } }, "retry_unanswered": { "type": "string", "enum": ["off", "no_reply", "no_reply_or_short", "model"], "default": "off", "description": "Also retry calls that connected but got no conversation.\n`no_reply`: the contact never spoke. `no_reply_or_short`:\nthe contact never spoke, or the call lasted at most\n`retry_unanswered_max_seconds`. `model`: the contact\nnever spoke, or post-call analysis read the transcript\nand found no real conversation. Retries follow the same\nschedule or steps as failed calls.\n" }, "retry_unanswered_max_seconds": { "type": "number", "default": 10, "minimum": 1, "maximum": 120, "description": "Under `no_reply_or_short`, a call this long or shorter\n(in seconds) counts as unanswered.\n" } } } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -433,13 +471,12 @@ operate a campaign once it runs.
|
|
|
433
471
|
}],
|
|
434
472
|
["addBulkCallContact", {
|
|
435
473
|
name: "addBulkCallContact",
|
|
436
|
-
description: `Push
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
operating hours.
|
|
474
|
+
description: `Push one contact into a dynamic bulk-call campaign.
|
|
475
|
+
|
|
476
|
+
Dynamic campaigns are created from the dashboard (Bulk Call > Create New
|
|
477
|
+
Campaign > Dynamic Campaign) and wait for contacts. Use this webhook to feed
|
|
478
|
+
them from a CRM, form or automation platform. The contact is queued at once.
|
|
479
|
+
The campaign calls it as soon as it is within operating hours.
|
|
443
480
|
|
|
444
481
|
(Tags: Bulk calls)`,
|
|
445
482
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "ID of the dynamic campaign to add the contact to." }, "requestBody": { "type": "object", "required": ["to_number"], "properties": { "to_number": { "type": "string", "description": "Contact phone number in international format (e.g., +15551234567)." }, "custom_variables": { "type": "object", "description": "Key-value pairs passed to the agent as context for this\ncall, so the agent can reference them during the\nconversation (e.g. the contact's name or reason for the\ncall). Match these keys to the variables used in your\nagent's welcome message or prompt.\n", "additionalProperties": true }, "metadata": { "type": "object", "description": "Key-value pairs stored on the contact for your own\ntracking (e.g. CRM or lead IDs). Not shared with the\nagent.\n", "additionalProperties": true }, "previous_from_number": { "type": "string", "description": "The number that called this person last. With\n`call_back_from_different_number` on, the call goes out\nfrom another number in the pool.\n" } }, "description": "The JSON request body." } }, "required": ["campaign_id", "requestBody"] },
|
|
@@ -492,13 +529,17 @@ operating hours.
|
|
|
492
529
|
}],
|
|
493
530
|
["listBulkCallLines", {
|
|
494
531
|
name: "listBulkCallLines",
|
|
495
|
-
description: `
|
|
496
|
-
|
|
532
|
+
description: `List per-contact results for a campaign.
|
|
533
|
+
|
|
534
|
+
Each row has what happened on the call, the variables you sent, and
|
|
535
|
+
\`call.recording_id\`.
|
|
497
536
|
|
|
498
537
|
## Paging
|
|
499
538
|
|
|
500
|
-
|
|
501
|
-
\`
|
|
539
|
+
Call with no \`cursor\`. Then pass back the \`next_cursor\` you were given until
|
|
540
|
+
it is \`null\`. Rows come oldest first. \`pagesize\` defaults to 30 and goes up
|
|
541
|
+
to 150. Cursors are opaque, so never build one. No contact is skipped or
|
|
542
|
+
returned twice, even while the campaign dials.
|
|
502
543
|
|
|
503
544
|
\`\`\`
|
|
504
545
|
cursor = None
|
|
@@ -509,17 +550,10 @@ while True:
|
|
|
509
550
|
if not cursor: break
|
|
510
551
|
\`\`\`
|
|
511
552
|
|
|
512
|
-
Each call returns a page of rows, oldest first: \`pagesize\` goes up to
|
|
513
|
-
150 and defaults to 30. Cursors are opaque, so pass back the string you
|
|
514
|
-
were given and never build one. No contact is skipped or returned
|
|
515
|
-
twice, even while the campaign is still dialing.
|
|
516
|
-
|
|
517
553
|
## Transcripts are not in the row
|
|
518
554
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
megabytes. Fetch the one you want from
|
|
522
|
-
\`GET /calls/logs/{recording_id}\`.
|
|
555
|
+
Transcripts reach 212 KB, so rows carry only \`call.recording_id\`. Fetch the
|
|
556
|
+
transcript from \`GET /calls/logs/{recording_id}\`.
|
|
523
557
|
|
|
524
558
|
(Tags: Bulk calls)`,
|
|
525
559
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "cursor": { "type": "string", "description": "The `next_cursor` from your previous response. Omit it on the first\nrequest. Opaque: pass it back unchanged.\n" }, "pagesize": { "type": "integer", "minimum": 1, "default": 30, "maximum": 150, "description": "Rows per page. Above 150 the request is refused." }, "call_status": { "type": "string", "enum": ["Pending", "In Progress", "completed", "voicemail_detected", "no-answer", "busy", "Failed", "Skipped", "retry_scheduled", "cancelled"], "description": "Return only contacts in this state." }, "interaction_status": { "type": "string", "description": "Return only contacts with this interaction outcome." }, "search": { "type": "string", "description": "An exact phone number, matched against the contact's number and the\nnumber that called it. Not a substring search.\n" }, "include_total": { "type": "boolean", "default": false, "description": "Add `total_records` to the response. It costs a count over the whole\nfiltered campaign, so it is off unless you ask. Ask for it once to\nfill a header, not on every page of a walk.\n" } }, "required": ["bulk_call_id"] },
|
|
@@ -551,13 +585,14 @@ the number's lifetime total across every cycle.
|
|
|
551
585
|
}],
|
|
552
586
|
["addBulkCallNumber", {
|
|
553
587
|
name: "addBulkCallNumber",
|
|
554
|
-
description: `Add one of your numbers to the campaign's rotation pool.
|
|
555
|
-
|
|
556
|
-
|
|
588
|
+
description: `Add one of your numbers to the campaign's rotation pool.
|
|
589
|
+
|
|
590
|
+
It works while the campaign runs, so use it to bring in a fresh number when
|
|
591
|
+
healthy ones run low.
|
|
557
592
|
|
|
558
|
-
The number must
|
|
559
|
-
|
|
560
|
-
|
|
593
|
+
The number must be yours and not already in the pool. A number with no agent
|
|
594
|
+
gets this campaign's agent attached. A number attached to a **different**
|
|
595
|
+
agent is refused.
|
|
561
596
|
|
|
562
597
|
(Tags: Bulk calls)`,
|
|
563
598
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "requestBody": { "type": "object", "required": ["phone_number_id"], "properties": { "phone_number_id": { "type": "number", "description": "One of your numbers, from List phone numbers." } }, "description": "The JSON request body." } }, "required": ["bulk_call_id", "requestBody"] },
|
|
@@ -573,16 +608,13 @@ automatically; a number attached to a **different** agent is refused.
|
|
|
573
608
|
name: "setBulkCallNumberActive",
|
|
574
609
|
description: `Stop or resume dialing from one number in the pool.
|
|
575
610
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
cannot be paused, since the campaign would have nothing to dial from.
|
|
611
|
+
Pause a number that goes bad mid-campaign. Dialing moves to the next number,
|
|
612
|
+
and the paused number keeps its history and counters. You cannot pause the
|
|
613
|
+
last active number of a running campaign.
|
|
580
614
|
|
|
581
|
-
Send the state you want
|
|
582
|
-
request is harmless.
|
|
615
|
+
Send the state you want, not a toggle, so a retry is harmless.
|
|
583
616
|
|
|
584
|
-
\`assignment_id\` is the number's id **within this campaign's pool**, from
|
|
585
|
-
List rotation pool. It is not the \`phone_number_id\`.
|
|
617
|
+
\`assignment_id\` is the number's id **within this campaign's pool**, from List rotation pool. It is not the \`phone_number_id\`.
|
|
586
618
|
|
|
587
619
|
(Tags: Bulk calls)`,
|
|
588
620
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "assignment_id": { "type": "number", "description": "The `assignment_id` from List rotation pool." }, "requestBody": { "type": "object", "required": ["is_active"], "properties": { "is_active": { "type": "boolean", "description": "`false` pauses the number, `true` resumes it." } }, "description": "The JSON request body." } }, "required": ["bulk_call_id", "assignment_id", "requestBody"] },
|
|
@@ -599,18 +631,14 @@ List rotation pool. It is not the \`phone_number_id\`.
|
|
|
599
631
|
description: `Add up to 1000 contacts to a campaign in one request.
|
|
600
632
|
|
|
601
633
|
This is the batch form of Add contact to dynamic campaign. Prefer it
|
|
602
|
-
whenever you have more than a handful
|
|
603
|
-
far cheaper than 500 requests, on your side and ours.
|
|
634
|
+
whenever you have more than a handful of contacts.
|
|
604
635
|
|
|
605
|
-
Repeated numbers are kept, not merged.
|
|
606
|
-
|
|
607
|
-
number usually means two real reasons to call.
|
|
636
|
+
Repeated numbers are kept, not merged. The same number with different
|
|
637
|
+
variables is called twice.
|
|
608
638
|
|
|
609
|
-
Rows that fail validation are reported in \`rejected
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
\`rejected\`; the condition values themselves are not evaluated on this
|
|
613
|
-
route.
|
|
639
|
+
Rows that fail validation are reported in \`rejected\`, and the rest are still
|
|
640
|
+
added. A row missing a column that the campaign's \`call_conditions\` need is
|
|
641
|
+
also rejected. The condition values are not evaluated on this route.
|
|
614
642
|
|
|
615
643
|
(Tags: Bulk calls)`,
|
|
616
644
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of the bulk call campaign." }, "requestBody": { "type": "object", "required": ["contacts"], "properties": { "contacts": { "type": "array", "maxItems": 1000, "description": "Each row needs `to_number`. Note this differs from the\n`contact_list` on Create bulk call, which uses\n`phone_number` and takes loose keys: here the variables go\nin an explicit `custom_variables` object.\n", "items": { "type": "object", "required": ["to_number"], "properties": { "to_number": { "type": "string", "description": "Number to call, in international format." }, "custom_variables": { "type": "object", "description": "Passed to the agent as context for this call, so it\ncan use them in the conversation.\n", "additionalProperties": true }, "metadata": { "type": "object", "description": "Stored with the contact and returned on its row in\nBulk call results. Not shown to the agent.\n", "additionalProperties": true }, "previous_from_number": { "type": "string", "description": "The number that called this person last. With\n`call_back_from_different_number` on, the call goes\nout from another number in the pool.\n" } } } } }, "description": "The JSON request body." } }, "required": ["campaign_id", "requestBody"] },
|
|
@@ -643,11 +671,11 @@ scheduled, or finished cannot be started.
|
|
|
643
671
|
}],
|
|
644
672
|
["setBulkCallConcurrency", {
|
|
645
673
|
name: "setBulkCallConcurrency",
|
|
646
|
-
description: `Change how many calls the campaign places at once,
|
|
647
|
-
running. Raise it to finish sooner, lower it if your team cannot keep up
|
|
648
|
-
with transfers or your numbers are being answered less.
|
|
674
|
+
description: `Change how many calls the campaign places at once, even while it runs.
|
|
649
675
|
|
|
650
|
-
|
|
676
|
+
Raise it to finish sooner. Lower it if your team cannot keep up with
|
|
677
|
+
transfers or fewer calls are answered. The ceiling is your account's
|
|
678
|
+
concurrency limit.
|
|
651
679
|
|
|
652
680
|
(Tags: Bulk calls)`,
|
|
653
681
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "requestBody": { "type": "object", "required": ["concurrent_call_limit"], "properties": { "concurrent_call_limit": { "type": "number", "minimum": 1, "description": "Calls to place at once." } }, "description": "The JSON request body." } }, "required": ["bulk_call_id", "requestBody"] },
|
|
@@ -661,14 +689,14 @@ The ceiling is your account's concurrency limit.
|
|
|
661
689
|
}],
|
|
662
690
|
["setBulkCallRotation", {
|
|
663
691
|
name: "setBulkCallRotation",
|
|
664
|
-
description: `Change how a campaign uses its number pool.
|
|
665
|
-
|
|
692
|
+
description: `Change how a campaign uses its number pool.
|
|
693
|
+
|
|
694
|
+
Send only the fields you want to change. At least one field is required.
|
|
666
695
|
|
|
667
|
-
|
|
668
|
-
\`
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
endpoints.
|
|
696
|
+
It works while the status is \`draft\`, \`scheduled\`, \`in_progress\`, \`waiting\`,
|
|
697
|
+
\`paused\`, \`auto_paused\` or \`retry_scheduled\`. Any other status is refused
|
|
698
|
+
with \`Cannot edit rotation for status: <status>\`. To change which numbers
|
|
699
|
+
are in the pool, use the numbers endpoints.
|
|
672
700
|
|
|
673
701
|
(Tags: Bulk calls)`,
|
|
674
702
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "requestBody": { "type": "object", "properties": { "strategy": { "type": "string", "enum": ["fixed_count", "cpr_threshold", "both", "none"], "description": "When to move to the next number: every `calls_per_number`\ncalls, on low health score, both, or never.\n" }, "calls_per_number": { "type": "number", "description": "Calls before moving on. Used by `fixed_count` and `both`." }, "health_threshold": { "type": "number", "description": "Health score below which a number is rotated away from.\nUsed by `cpr_threshold` and `both`.\n" }, "fallback": { "type": "string", "enum": ["pause", "continue_best"], "description": "When every number is unhealthy: `pause` the campaign, or\n`continue_best` with the healthiest one.\n" }, "call_back_from_different_number": { "type": "boolean", "description": "When on, a repeat call to the same person goes out from a\ndifferent number than the one that called them last. Needs\ntwo or more numbers in the pool. Must be `true` or `false`.\n" }, "skip_known_invalid_numbers": { "type": "boolean", "description": "When on, a contact is not dialed if the carrier said its\nnumber does not exist, in any campaign of your organization\nin the last 14 days. Must be `true` or `false`.\n" } }, "description": "The JSON request body." } }, "required": ["bulk_call_id", "requestBody"] },
|
|
@@ -682,29 +710,22 @@ endpoints.
|
|
|
682
710
|
}],
|
|
683
711
|
["retryBulkCall", {
|
|
684
712
|
name: "retryBulkCall",
|
|
685
|
-
description: `Re-queue contacts that did not connect, without
|
|
713
|
+
description: `Re-queue contacts that did not connect, without a new campaign.
|
|
686
714
|
|
|
687
|
-
Use it after a campaign finishes with more no-answers than
|
|
688
|
-
|
|
689
|
-
having a bad day). Retried contacts keep their original variables.
|
|
715
|
+
Use it after a campaign finishes with more no-answers than expected, or when
|
|
716
|
+
the cause was on your side. Retried contacts keep their original variables.
|
|
690
717
|
|
|
691
718
|
The retry is refused in these cases:
|
|
692
719
|
|
|
693
|
-
- The
|
|
694
|
-
|
|
695
|
-
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
error is \`Invalid failure reason(s)\` and lists the allowed values.
|
|
700
|
-
- No contact matches. The error is \`No failed calls found to retry
|
|
701
|
-
matching criteria\`.
|
|
702
|
-
|
|
703
|
-
Each contact is retried from its latest call only. When the campaign has
|
|
720
|
+
- The status is not \`completed\`. The error is \`Cannot retry calls. Current status: <status>\`.
|
|
721
|
+
- Auto retry is on and some contacts are still \`Pending\` or \`In Progress\`. The error is \`Cannot retry while calls are still in progress and auto retry is enabled\`.
|
|
722
|
+
- A value in \`failure_reasons\` is not an allowed status. The error is \`Invalid failure reason(s)\` and lists the allowed values.
|
|
723
|
+
- No contact matches. The error is \`No failed calls found to retry matching criteria\`.
|
|
724
|
+
|
|
725
|
+
Each contact is retried from its latest call only. With
|
|
704
726
|
\`skip_known_invalid_numbers\` on, contacts whose last call ended with the
|
|
705
|
-
carrier saying the number does not exist are
|
|
706
|
-
|
|
707
|
-
with no conversation.
|
|
727
|
+
carrier saying the number does not exist are skipped. Connected calls with
|
|
728
|
+
no conversation are not retried.
|
|
708
729
|
|
|
709
730
|
(Tags: Bulk calls)`,
|
|
710
731
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "requestBody": { "type": "object", "properties": { "retry_strategy": { "type": "string", "default": "all", "description": "Which contacts to re-queue. `all` takes everything that did\nnot connect. `specific` re-queues only the statuses listed\nin `failure_reasons`.\n" }, "failure_reasons": { "type": "array", "description": "Statuses to re-queue. Read only when `retry_strategy` is\n`specific`; for example `no-answer` and `busy`. Ignored when\n`retry_strategy` is `all`.\n", "items": { "type": "string", "enum": ["failed", "Failed", "no-answer", "No Answer", "busy", "Busy", "cancelled", "canceled", "voicemail_detected"] } } }, "description": "The JSON request body." } }, "required": ["bulk_call_id"] },
|
|
@@ -718,9 +739,9 @@ with no conversation.
|
|
|
718
739
|
}],
|
|
719
740
|
["setBulkCallDailyTimeControl", {
|
|
720
741
|
name: "setBulkCallDailyTimeControl",
|
|
721
|
-
description: `
|
|
722
|
-
|
|
723
|
-
|
|
742
|
+
description: `Limit a campaign to a daily calling window in its timezone.
|
|
743
|
+
|
|
744
|
+
Outside the window the campaign holds, then resumes the next day.
|
|
724
745
|
|
|
725
746
|
(Tags: Bulk calls)`,
|
|
726
747
|
inputSchema: { "type": "object", "properties": { "bulk_call_id": { "type": "number", "description": "Id of the bulk call campaign." }, "requestBody": { "type": "object", "required": ["enable_daily_hard_stop", "enable_daily_auto_start"], "properties": { "enable_daily_hard_stop": { "type": "boolean", "description": "Stop dialing at `daily_stop_time` each day." }, "daily_stop_time": { "type": "number", "description": "Hour of day to stop, 0 to 23. Fractions are allowed, so\n`17.5` is 17:30. Required when the hard stop is on.\n" }, "daily_stop_timezone": { "type": "string", "description": "Timezone for the stop time." }, "enable_daily_auto_start": { "type": "boolean", "description": "Resume dialing at `daily_start_time` each day." }, "daily_start_time": { "type": "number", "description": "Hour of day to resume, 0 to 23. Required when auto start\nis on.\n" }, "daily_start_timezone": { "type": "string", "description": "Timezone for the start time." } }, "description": "The JSON request body." } }, "required": ["bulk_call_id", "requestBody"] },
|
|
@@ -840,15 +861,15 @@ from the OmniDimension number shop or imported your own.
|
|
|
840
861
|
}],
|
|
841
862
|
["searchPhoneNumbers", {
|
|
842
863
|
name: "searchPhoneNumbers",
|
|
843
|
-
description: `Search the OmniDimension number shop for
|
|
844
|
-
in a region. Price and validity are flat per region, so every result
|
|
845
|
-
shows the same \`monthly_rental_usd\` and \`validity_days\`, and that is the
|
|
846
|
-
exact amount a purchase will charge.
|
|
864
|
+
description: `Search the OmniDimension number shop for numbers you can buy in a region.
|
|
847
865
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
866
|
+
Price and validity are flat per region. Every result shows the same
|
|
867
|
+
\`monthly_rental_usd\` and \`validity_days\`, and a purchase charges exactly
|
|
868
|
+
that.
|
|
869
|
+
|
|
870
|
+
A region can have several carriers, each with different number series. Pass
|
|
871
|
+
the \`carrier\` you want. The response names the carrier its results came
|
|
872
|
+
from, and a purchase must pass that carrier.
|
|
852
873
|
|
|
853
874
|
(Tags: Phone numbers)`,
|
|
854
875
|
inputSchema: { "type": "object", "properties": { "region": { "type": "string", "enum": ["IN", "US"], "description": "Region to search in. `IN` and `US` both serve numbers. Which\nregions answer is configuration, so a region with no carrier\nenabled returns `404 not_available` rather than an empty list.\n" }, "carrier": { "type": "string", "description": "Which carrier's stock to search: carriers in a region do not sell\nthe same numbers. Required where a region has more than one\ncarrier; omitting it there returns `409 carrier_required` naming\nthe region's carriers and what each one stocks.\n" }, "pattern": { "type": "string", "description": "Digits or prefix to match within the number." }, "page": { "type": "number", "minimum": 1, "default": 1, "description": "Page of results to return." }, "limit": { "type": "number", "minimum": 1, "maximum": 150, "default": 20, "description": "Results per page." } }, "required": ["region"] },
|
|
@@ -862,8 +883,9 @@ to pass.
|
|
|
862
883
|
}],
|
|
863
884
|
["purchasePhoneNumber", {
|
|
864
885
|
name: "purchasePhoneNumber",
|
|
865
|
-
description: `Buy a phone number from the OmniDimension number shop.
|
|
866
|
-
|
|
886
|
+
description: `Buy a phone number from the OmniDimension number shop.
|
|
887
|
+
|
|
888
|
+
The monthly rental comes out of your wallet. The number is added to your
|
|
867
889
|
account, ready to attach to an agent.
|
|
868
890
|
|
|
869
891
|
(Tags: Phone numbers)`,
|
|
@@ -878,9 +900,10 @@ account, ready to attach to an agent.
|
|
|
878
900
|
}],
|
|
879
901
|
["releasePhoneNumber", {
|
|
880
902
|
name: "releasePhoneNumber",
|
|
881
|
-
description: `
|
|
882
|
-
|
|
883
|
-
|
|
903
|
+
description: `Release a phone number and stop its rental.
|
|
904
|
+
|
|
905
|
+
It is not charged at the next renewal. Only a number currently allocated to
|
|
906
|
+
the account can be released.
|
|
884
907
|
|
|
885
908
|
(Tags: Phone numbers)`,
|
|
886
909
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["phone_number"], "properties": { "phone_number": { "type": "string", "description": "The number to release." } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -894,11 +917,12 @@ released.
|
|
|
894
917
|
}],
|
|
895
918
|
["setPhoneNumberAutoRenew", {
|
|
896
919
|
name: "setPhoneNumberAutoRenew",
|
|
897
|
-
description: `Turn auto-renew
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
the number
|
|
920
|
+
description: `Turn auto-renew on or off for a number bought from the number shop.
|
|
921
|
+
|
|
922
|
+
With auto-renew off, the number is not charged again. It works until the end
|
|
923
|
+
of the period already paid for, then it is released. Turn auto-renew on
|
|
924
|
+
before that date and the number renews as normal. Sending the value the
|
|
925
|
+
number already has changes nothing and still succeeds.
|
|
902
926
|
|
|
903
927
|
(Tags: Phone numbers)`,
|
|
904
928
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["phone_number", "auto_renew"], "properties": { "phone_number": { "type": "string", "description": "The number to switch." }, "auto_renew": { "type": "boolean", "description": "`false` stops renewal, `true` turns it back on. Must be a JSON boolean: a string such as `\"false\"`, a number, or a missing value is refused." } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -990,15 +1014,15 @@ the number already has changes nothing and still succeeds.
|
|
|
990
1014
|
}],
|
|
991
1015
|
["listVoices", {
|
|
992
1016
|
name: "listVoices",
|
|
993
|
-
description: `
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1017
|
+
description: `List the voices your organization can use, with filters and pagination.
|
|
1018
|
+
|
|
1019
|
+
Use \`provider=featured\` for OmniDimension voices in the order the dashboard
|
|
1020
|
+
shows them. They are the recommended start. Cartesia voices are next.
|
|
997
1021
|
|
|
998
|
-
Each voice keeps its own \`service\`: save
|
|
999
|
-
provider
|
|
1000
|
-
|
|
1001
|
-
|
|
1022
|
+
Each voice keeps its own \`service\`: save it as the agent's voice provider. A
|
|
1023
|
+
provider your organization cannot use returns a 400. Cartesia and ElevenLabs
|
|
1024
|
+
support filtering by name, language, accent and gender. Other providers
|
|
1025
|
+
support pagination only.
|
|
1002
1026
|
|
|
1003
1027
|
(Tags: Providers)`,
|
|
1004
1028
|
inputSchema: { "type": "object", "properties": { "provider": { "type": "string", "description": "Provider to list voices from. Omit to list every voice your organization can use.\n`featured` lists OmniDimension voices and is the recommended choice, followed by\n`cartesia`. A provider your organization cannot use returns a 400.\n" }, "search": { "type": "string", "description": "Substring match against voice name or description. Cartesia and ElevenLabs." }, "language": { "type": "string", "description": "ISO language code (e.g. `en`, `hi`, `es`). Cartesia and ElevenLabs." }, "accent": { "type": "string", "description": "Accent label (e.g. `american`, `british`). Cartesia and ElevenLabs." }, "gender": { "type": "string", "enum": ["male", "female"], "description": "Filter voices by gender. Cartesia and ElevenLabs." }, "page": { "type": "integer", "minimum": 1, "default": 1, "description": "1-indexed page number." }, "page_size": { "type": "integer", "minimum": 1, "default": 30, "maximum": 100, "description": "Voices per page. Capped at 100." } } },
|
|
@@ -1064,26 +1088,26 @@ and gender. Other providers support pagination only.
|
|
|
1064
1088
|
}],
|
|
1065
1089
|
["getAccountBalance", {
|
|
1066
1090
|
name: "getAccountBalance",
|
|
1067
|
-
description: `Read your organization's wallet
|
|
1068
|
-
it buys at your rates, your plan, your concurrency headroom, and
|
|
1069
|
-
whether auto-recharge will refill it.
|
|
1091
|
+
description: `Read your organization's wallet balance, plan and auto-recharge state.
|
|
1070
1092
|
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
with \`402 payment_required\`.
|
|
1093
|
+
The response also has the minutes the balance buys at your rates and your
|
|
1094
|
+
concurrency headroom.
|
|
1074
1095
|
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
read a client's figures through the Reseller endpoints.
|
|
1096
|
+
Call it before a campaign, or on a schedule, so you learn about low credit
|
|
1097
|
+
here and not from a call failing with \`402 payment_required\`.
|
|
1078
1098
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
that flag before treating a zero balance as a stop condition.
|
|
1099
|
+
The response always describes the organization the API key belongs to. There
|
|
1100
|
+
is no parameter for another account. Resellers read a client's figures
|
|
1101
|
+
through the Reseller endpoints.
|
|
1083
1102
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1103
|
+
A balance at or below zero does not always stop calls. An organization on
|
|
1104
|
+
usage-based billing (\`plan.is_usage_based\`) keeps placing calls and is
|
|
1105
|
+
metered to its payment method. Check that flag before treating zero as a
|
|
1106
|
+
stop condition.
|
|
1107
|
+
|
|
1108
|
+
The API key's user needs Billing access in your organization. If you get a
|
|
1109
|
+
\`403\`, an administrator can grant it when Billing is enabled for your
|
|
1110
|
+
organization. When it is not, contact support.
|
|
1087
1111
|
|
|
1088
1112
|
(Tags: Account)`,
|
|
1089
1113
|
inputSchema: { "type": "object", "properties": {} },
|
|
@@ -1097,12 +1121,13 @@ enabled for your organization; when it is not, contact support.
|
|
|
1097
1121
|
}],
|
|
1098
1122
|
["listClonedVoices", {
|
|
1099
1123
|
name: "listClonedVoices",
|
|
1100
|
-
description: `
|
|
1101
|
-
|
|
1124
|
+
description: `List your cloned voices, oldest first, one cursor page at a time.
|
|
1125
|
+
|
|
1126
|
+
Call it with no \`cursor\`. Then pass back each \`next_cursor\` until it is
|
|
1102
1127
|
\`null\`.
|
|
1103
1128
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1129
|
+
When a voice is \`ready\`, put its \`voice_id\` in an agent's \`voice.voice_id\`
|
|
1130
|
+
with \`voice.provider: cartesia\`.
|
|
1106
1131
|
|
|
1107
1132
|
(Tags: Voice cloning)`,
|
|
1108
1133
|
inputSchema: { "type": "object", "properties": { "limit": { "type": "number", "default": 20, "maximum": 100, "description": "Rows per page. Above 100 the request is refused." }, "cursor": { "type": "string", "description": "The `next_cursor` from your previous response. Omit it on the first\nrequest. Opaque: pass it back unchanged.\n" } } },
|
|
@@ -1157,9 +1182,11 @@ still \`processing\` cannot be deleted.
|
|
|
1157
1182
|
}],
|
|
1158
1183
|
["getClonedVoiceSample", {
|
|
1159
1184
|
name: "getClonedVoiceSample",
|
|
1160
|
-
description: `Stream the generated mp3 sample of a cloned voice.
|
|
1161
|
-
|
|
1162
|
-
|
|
1185
|
+
description: `Stream the generated mp3 sample of a cloned voice.
|
|
1186
|
+
|
|
1187
|
+
Only the owner can fetch it. Send your API key in the \`Authorization\`
|
|
1188
|
+
header. If no sample exists yet, the call returns \`404\`
|
|
1189
|
+
(\`sample_not_ready\`).
|
|
1163
1190
|
|
|
1164
1191
|
(Tags: Voice cloning)`,
|
|
1165
1192
|
inputSchema: { "type": "object", "properties": { "voice_id": { "type": "number", "description": "Id of the cloned voice." } }, "required": ["voice_id"] },
|
|
@@ -1186,7 +1213,11 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1186
1213
|
}],
|
|
1187
1214
|
["listWorkflowNodeTypes", {
|
|
1188
1215
|
name: "listWorkflowNodeTypes",
|
|
1189
|
-
description: `Search the node types a workflow can use
|
|
1216
|
+
description: `Search the node types a workflow can use.
|
|
1217
|
+
|
|
1218
|
+
Examples are \`whatsapp\`, \`voice_ai\` and \`conditional\`. Call it first when
|
|
1219
|
+
you do not know which node to add. Then call \`getWorkflowNodeType\` for one
|
|
1220
|
+
type's settings.
|
|
1190
1221
|
|
|
1191
1222
|
(Tags: Workflows)`,
|
|
1192
1223
|
inputSchema: { "type": "object", "properties": { "q": { "type": "string", "description": "Words to match against the type, label and description, such as `whatsapp`." }, "category": { "type": "string", "enum": ["triggers", "messaging", "calls", "flow", "ai", "crm", "integrations"], "description": "Only types in this category." } } },
|
|
@@ -1200,7 +1231,11 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1200
1231
|
}],
|
|
1201
1232
|
["getWorkflowNodeType", {
|
|
1202
1233
|
name: "getWorkflowNodeType",
|
|
1203
|
-
description: `
|
|
1234
|
+
description: `Get the settings one node type reads.
|
|
1235
|
+
|
|
1236
|
+
Call it before you add or edit a node. Its \`fields\` are the keys of the
|
|
1237
|
+
node's \`config\`. Use \`detail=full\` only when you need help text and
|
|
1238
|
+
examples.
|
|
1204
1239
|
|
|
1205
1240
|
(Tags: Workflows)`,
|
|
1206
1241
|
inputSchema: { "type": "object", "properties": { "node_type": { "type": "string", "description": "A node type from `listWorkflowNodeTypes`, such as `whatsapp`." }, "detail": { "type": "string", "enum": ["minimal", "full"], "default": "minimal", "description": "`full` adds descriptions, examples and `output_example`." } }, "required": ["node_type"] },
|
|
@@ -1214,7 +1249,11 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1214
1249
|
}],
|
|
1215
1250
|
["listWorkflowFieldOptions", {
|
|
1216
1251
|
name: "listWorkflowFieldOptions",
|
|
1217
|
-
description: `
|
|
1252
|
+
description: `List the choices for one \`ref\` field of a node type.
|
|
1253
|
+
|
|
1254
|
+
Examples are the phone numbers, agents or integrations in your account. Call
|
|
1255
|
+
it for every \`ref\` field and never guess an id. If it returns \`400
|
|
1256
|
+
no_options\`, the field is not a list choice, so ask the user for the value.
|
|
1218
1257
|
|
|
1219
1258
|
(Tags: Workflows)`,
|
|
1220
1259
|
inputSchema: { "type": "object", "properties": { "node_type": { "type": "string", "description": "A node type from `listWorkflowNodeTypes`, such as `whatsapp`." }, "field": { "type": "string", "description": "A field name from `getWorkflowNodeType`." }, "depends": { "type": "number", "description": "The value of the field this one depends on (`depends_on` in the node type), such as the chosen phone number id." } }, "required": ["node_type", "field"] },
|
|
@@ -1228,7 +1267,9 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1228
1267
|
}],
|
|
1229
1268
|
["listWorkflows", {
|
|
1230
1269
|
name: "listWorkflows",
|
|
1231
|
-
description: `
|
|
1270
|
+
description: `List your workflows, oldest first, one cursor page at a time.
|
|
1271
|
+
|
|
1272
|
+
Use it to find a workflow id. Pass back \`next_cursor\` until it is \`null\`.
|
|
1232
1273
|
|
|
1233
1274
|
(Tags: Workflows)`,
|
|
1234
1275
|
inputSchema: { "type": "object", "properties": { "limit": { "type": "number", "default": 20, "minimum": 1, "maximum": 100, "description": "Rows per page." }, "cursor": { "type": "string", "description": "The `next_cursor` from the previous page. Omit it on the first request. Pass it back unchanged." } } },
|
|
@@ -1242,7 +1283,11 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1242
1283
|
}],
|
|
1243
1284
|
["createWorkflow", {
|
|
1244
1285
|
name: "createWorkflow",
|
|
1245
|
-
description: `Create a workflow with a draft.
|
|
1286
|
+
description: `Create a workflow with a draft.
|
|
1287
|
+
|
|
1288
|
+
Without \`graph\`, the draft holds one \`trigger\` node, ready for
|
|
1289
|
+
\`editWorkflow\` ops. Pass \`graph\` only to start from a complete graph. The
|
|
1290
|
+
response carries the \`revision\` you need to edit.
|
|
1246
1291
|
|
|
1247
1292
|
(Tags: Workflows)`,
|
|
1248
1293
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "description": "A non-empty name." }, "graph": { "type": "object", "description": "A complete graph to start a workflow from, in the same shape `getWorkflow`\nreturns under `draft`. A workflow you read can be sent back as a new one.\nIt is built with the same checks as `editWorkflow` ops. Most callers skip it\nand build with `editWorkflow` instead.\n", "required": ["nodes", "edges"], "properties": { "nodes": { "type": "array", "items": { "type": "object", "required": ["id", "type"], "properties": { "id": { "type": "string", "description": "Lowercase letters, digits and underscores, starting with a letter. Later nodes read this node's output as `{{ context.<id>.<field> }}`." }, "type": { "type": "string", "description": "A node type from `listWorkflowNodeTypes`." }, "label": { "type": "string" }, "position": { "type": "object", "properties": { "x": { "type": "number" }, "y": { "type": "number" } } }, "config": { "type": "object", "additionalProperties": true, "description": "The node's settings. The fields come from `getWorkflowNodeType`." } } } }, "edges": { "type": "array", "items": { "type": "object", "required": ["from", "to"], "properties": { "from": { "type": "string", "description": "Id of the node the edge starts at." }, "to": { "type": "string", "description": "Id of the node the edge ends at." }, "handle": { "type": "string", "description": "The output of the `from` node. Omit it, or send `default`, for a plain node's only output." } } } } } } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -1256,7 +1301,11 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1256
1301
|
}],
|
|
1257
1302
|
["getWorkflow", {
|
|
1258
1303
|
name: "getWorkflow",
|
|
1259
|
-
description: `
|
|
1304
|
+
description: `Get one workflow with its draft, status and \`revision\`.
|
|
1305
|
+
|
|
1306
|
+
Call it before every edit to get the current \`revision\`. Use
|
|
1307
|
+
\`view=structure\` to see nodes and edges without config on a large workflow.
|
|
1308
|
+
Secrets read back as \`********\`.
|
|
1260
1309
|
|
|
1261
1310
|
(Tags: Workflows)`,
|
|
1262
1311
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." }, "view": { "type": "string", "enum": ["structure", "full"], "default": "full", "description": "`structure` leaves node `config` out." } }, "required": ["workflow_id"] },
|
|
@@ -1270,7 +1319,10 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1270
1319
|
}],
|
|
1271
1320
|
["deleteWorkflow", {
|
|
1272
1321
|
name: "deleteWorkflow",
|
|
1273
|
-
description: `Delete a workflow
|
|
1322
|
+
description: `Delete a workflow and stop its published version.
|
|
1323
|
+
|
|
1324
|
+
This cannot be undone, so confirm with the user first. To stop it without
|
|
1325
|
+
deleting, use \`deactivateWorkflow\`.
|
|
1274
1326
|
|
|
1275
1327
|
(Tags: Workflows)`,
|
|
1276
1328
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." } }, "required": ["workflow_id"] },
|
|
@@ -1284,7 +1336,14 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1284
1336
|
}],
|
|
1285
1337
|
["editWorkflow", {
|
|
1286
1338
|
name: "editWorkflow",
|
|
1287
|
-
description: `Change the draft with a list of \`ops
|
|
1339
|
+
description: `Change the draft with a list of \`ops\`.
|
|
1340
|
+
|
|
1341
|
+
Ops add, update, move or delete nodes, and connect or disconnect them. They
|
|
1342
|
+
apply all together or not at all. Send the \`revision\` from your last read.
|
|
1343
|
+
On \`409 revision_conflict\`, read the workflow again and retry.
|
|
1344
|
+
|
|
1345
|
+
Secrets read back as \`********\`. Send them back unchanged to keep the stored
|
|
1346
|
+
value. This edits the draft only. Use \`publishWorkflow\` to make it live.
|
|
1288
1347
|
|
|
1289
1348
|
(Tags: Workflows)`,
|
|
1290
1349
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." }, "requestBody": { "type": "object", "required": ["revision", "ops"], "properties": { "revision": { "type": "string", "description": "The `draft.revision` from your last `getWorkflow` or edit." }, "ops": { "type": "array", "items": { "type": "object", "description": "One edit to the draft. Set `op` and the fields that op uses.\n\n| `op` | Fields | Effect |\n|---|---|---|\n| `add_node` | `id`, `type`, `label?`, `config?`, `after?`, `handle?`, `position?` | Adds a node. With `after`, it also connects it to that node (on output `handle`). |\n| `update_node` | `id`, `config?`, `label?` | Merges `config` keys into the node. A `null` value removes a key. |\n| `move_node` | `id`, `position` | Moves a node on the canvas. |\n| `delete_node` | `id` | Deletes a node and its edges. |\n| `connect` | `from`, `to`, `handle?` | Adds an edge. |\n| `disconnect` | `from`, `to`, `handle?` | Removes an edge. |\n", "required": ["op"], "properties": { "op": { "type": "string", "enum": ["add_node", "update_node", "move_node", "delete_node", "connect", "disconnect"] }, "id": { "type": "string", "description": "Node id. For `add_node`, lowercase letters, digits and underscores, starting with a letter. It must be new." }, "type": { "type": "string", "description": "`add_node`: a node type from `listWorkflowNodeTypes`." }, "label": { "type": "string", "description": "`add_node`, `update_node`: the name shown on the canvas." }, "config": { "type": "object", "additionalProperties": true, "description": "`add_node`, `update_node`: the node's settings. The fields come from\n`getWorkflowNodeType`. Send a secret back as `********` to keep the\nstored value.\n" }, "after": { "type": "string", "description": "`add_node`: id of the node to connect the new node to." }, "handle": { "type": "string", "description": "`add_node`, `connect`, `disconnect`: the output of the source node. Omit for the default output." }, "position": { "type": "object", "description": "`add_node`, `move_node`: canvas position. `add_node` places the node for you if you omit it.", "properties": { "x": { "type": "number" }, "y": { "type": "number" } } }, "from": { "type": "string", "description": "`connect`, `disconnect`: id of the node the edge starts at." }, "to": { "type": "string", "description": "`connect`, `disconnect`: id of the node the edge ends at." } } } }, "name": { "type": "string", "description": "Rename the workflow." } }, "description": "The JSON request body." } }, "required": ["workflow_id", "requestBody"] },
|
|
@@ -1298,7 +1357,10 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1298
1357
|
}],
|
|
1299
1358
|
["validateWorkflow", {
|
|
1300
1359
|
name: "validateWorkflow",
|
|
1301
|
-
description: `Check the draft and list what blocks publish.
|
|
1360
|
+
description: `Check the draft and list what blocks publish.
|
|
1361
|
+
|
|
1362
|
+
It changes nothing. Call it after your edits and fix every error before
|
|
1363
|
+
\`publishWorkflow\`.
|
|
1302
1364
|
|
|
1303
1365
|
(Tags: Workflows)`,
|
|
1304
1366
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." } }, "required": ["workflow_id"] },
|
|
@@ -1312,7 +1374,11 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1312
1374
|
}],
|
|
1313
1375
|
["publishWorkflow", {
|
|
1314
1376
|
name: "publishWorkflow",
|
|
1315
|
-
description: `Make the draft the live version.
|
|
1377
|
+
description: `Make the draft the live version.
|
|
1378
|
+
|
|
1379
|
+
Real events then run it, unless the workflow is paused. Publish is refused
|
|
1380
|
+
while the draft has errors, so run \`validateWorkflow\` first. Ask the user
|
|
1381
|
+
before you publish.
|
|
1316
1382
|
|
|
1317
1383
|
(Tags: Workflows)`,
|
|
1318
1384
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." } }, "required": ["workflow_id"] },
|
|
@@ -1340,7 +1406,10 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1340
1406
|
}],
|
|
1341
1407
|
["deactivateWorkflow", {
|
|
1342
1408
|
name: "deactivateWorkflow",
|
|
1343
|
-
description: `Turn the published workflow off
|
|
1409
|
+
description: `Turn the published workflow off.
|
|
1410
|
+
|
|
1411
|
+
Real events stop running it. The workflow and its draft stay. Use
|
|
1412
|
+
\`activateWorkflow\` to turn it back on.
|
|
1344
1413
|
|
|
1345
1414
|
(Tags: Workflows)`,
|
|
1346
1415
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." } }, "required": ["workflow_id"] },
|
|
@@ -1354,9 +1423,14 @@ request needs your API key in the \`Authorization\` header.
|
|
|
1354
1423
|
}],
|
|
1355
1424
|
["testWorkflow", {
|
|
1356
1425
|
name: "testWorkflow",
|
|
1357
|
-
description: `
|
|
1426
|
+
description: `Run the draft once with \`payload\` as the trigger data.
|
|
1427
|
+
|
|
1428
|
+
Every node runs for real: WhatsApp messages, SMS, emails and calls go out,
|
|
1429
|
+
and CRM records change. Ask the user first, and use their own phone number
|
|
1430
|
+
or email in the payload.
|
|
1358
1431
|
|
|
1359
|
-
It returns an \`execution_id\` at once. Poll \`getWorkflowExecution\` for the
|
|
1432
|
+
It returns an \`execution_id\` at once. Poll \`getWorkflowExecution\` for the
|
|
1433
|
+
result.
|
|
1360
1434
|
|
|
1361
1435
|
(Tags: Workflows)`,
|
|
1362
1436
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." }, "requestBody": { "type": "object", "properties": { "payload": { "type": "object", "additionalProperties": true, "description": "The trigger data. Nodes read it as `{{ context.<trigger id>.<field> }}`. See `output_example` of the trigger node type for its shape." } }, "description": "The JSON request body." } }, "required": ["workflow_id"] },
|
|
@@ -1370,7 +1444,10 @@ It returns an \`execution_id\` at once. Poll \`getWorkflowExecution\` for the re
|
|
|
1370
1444
|
}],
|
|
1371
1445
|
["getWorkflowExecution", {
|
|
1372
1446
|
name: "getWorkflowExecution",
|
|
1373
|
-
description: `
|
|
1447
|
+
description: `Get one workflow run with the result of each step.
|
|
1448
|
+
|
|
1449
|
+
Use it to read the outcome of \`testWorkflow\`. The run is finished when
|
|
1450
|
+
\`state\` is \`completed\`, \`failed\` or \`cancelled\`.
|
|
1374
1451
|
|
|
1375
1452
|
(Tags: Workflows)`,
|
|
1376
1453
|
inputSchema: { "type": "object", "properties": { "workflow_id": { "type": "number", "description": "Id of the workflow." }, "execution_id": { "type": "number", "description": "The `execution_id` from `testWorkflow`." } }, "required": ["workflow_id", "execution_id"] },
|
|
@@ -1384,10 +1461,11 @@ It returns an \`execution_id\` at once. Poll \`getWorkflowExecution\` for the re
|
|
|
1384
1461
|
}],
|
|
1385
1462
|
["listWhatsappNumbers", {
|
|
1386
1463
|
name: "listWhatsappNumbers",
|
|
1387
|
-
description: `
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1464
|
+
description: `List the WhatsApp numbers your API key can see.
|
|
1465
|
+
|
|
1466
|
+
Numbers come oldest first, and archived ones are left out. Use it to find a
|
|
1467
|
+
number id for the other routes. Each number carries \`capabilities\`, which
|
|
1468
|
+
says what it can send.
|
|
1391
1469
|
|
|
1392
1470
|
(Tags: WhatsApp)`,
|
|
1393
1471
|
inputSchema: { "type": "object", "properties": { "limit": { "type": "number", "default": 20, "minimum": 1, "maximum": 100, "description": "Rows per page." }, "cursor": { "type": "string", "description": "The `next_cursor` from the previous page. Omit it on the first request and pass it back unchanged." } } },
|
|
@@ -1401,19 +1479,21 @@ out.
|
|
|
1401
1479
|
}],
|
|
1402
1480
|
["importWhatsappNumbers", {
|
|
1403
1481
|
name: "importWhatsappNumbers",
|
|
1404
|
-
description: `
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1482
|
+
description: `Connect numbers from your WhatsApp Business Account with your Meta access
|
|
1483
|
+
token.
|
|
1484
|
+
|
|
1485
|
+
List the numbers first with [Preview
|
|
1486
|
+
numbers](/docs/api-reference/whatsapp/previewWhatsappNumbers), then pass the
|
|
1487
|
+
ids you want.
|
|
1408
1488
|
|
|
1409
|
-
The token must never expire and must carry both
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1489
|
+
The token must never expire and must carry both
|
|
1490
|
+
\`whatsapp_business_management\` and \`whatsapp_business_messaging\`. A system
|
|
1491
|
+
user token does. Add \`app_secret\` to receive replies. Without it the number
|
|
1492
|
+
can send but not receive.
|
|
1413
1493
|
|
|
1414
|
-
Connecting a number again updates it
|
|
1415
|
-
\`app_secret\`
|
|
1416
|
-
|
|
1494
|
+
Connecting a number again updates it. Send a new \`access_token\` or
|
|
1495
|
+
\`app_secret\` to change either. One number failing does not stop the others.
|
|
1496
|
+
It is listed in \`failed\` with the reason.
|
|
1417
1497
|
|
|
1418
1498
|
(Tags: WhatsApp)`,
|
|
1419
1499
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["waba_id", "access_token", "phone_number_ids"], "properties": { "waba_id": { "type": "string", "description": "Your WhatsApp Business Account id, from WhatsApp Manager." }, "access_token": { "type": "string", "description": "A Meta access token that never expires, with both WhatsApp permissions. Stored, never returned." }, "phone_number_ids": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Meta's ids for the numbers to connect, as Preview numbers lists them." }, "app_secret": { "type": "string", "description": "Your Meta app's secret. Turns on replies. Stored, never returned." } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -1427,12 +1507,14 @@ not stop the others. It is listed in \`failed\` with the reason.
|
|
|
1427
1507
|
}],
|
|
1428
1508
|
["previewWhatsappNumbers", {
|
|
1429
1509
|
name: "previewWhatsappNumbers",
|
|
1430
|
-
description: `
|
|
1431
|
-
|
|
1432
|
-
same rules as connecting, so a preview that passes can connect.
|
|
1510
|
+
description: `List the numbers on your WhatsApp Business Account with their health.
|
|
1511
|
+
Connects nothing.
|
|
1433
1512
|
|
|
1434
|
-
|
|
1435
|
-
|
|
1513
|
+
The access token is checked first, against the same rules as connecting, so
|
|
1514
|
+
a preview that passes can connect.
|
|
1515
|
+
|
|
1516
|
+
Fix a number with \`needs_migration\` or \`needs_registration\` in WhatsApp
|
|
1517
|
+
Manager before you connect it, or its sends fail.
|
|
1436
1518
|
|
|
1437
1519
|
(Tags: WhatsApp)`,
|
|
1438
1520
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["waba_id", "access_token"], "properties": { "waba_id": { "type": "string", "description": "Your WhatsApp Business Account id, from WhatsApp Manager." }, "access_token": { "type": "string", "description": "A Meta access token that never expires, with both WhatsApp permissions." } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -1446,8 +1528,10 @@ after fixing it in WhatsApp Manager, or its sends fail.
|
|
|
1446
1528
|
}],
|
|
1447
1529
|
["getWhatsappNumber", {
|
|
1448
1530
|
name: "getWhatsappNumber",
|
|
1449
|
-
description: `
|
|
1450
|
-
|
|
1531
|
+
description: `Get one number with its status, quality, messaging limit and what it can
|
|
1532
|
+
send.
|
|
1533
|
+
|
|
1534
|
+
A number in another workspace answers \`404\`.
|
|
1451
1535
|
|
|
1452
1536
|
(Tags: WhatsApp)`,
|
|
1453
1537
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" } }, "required": ["number_id"] },
|
|
@@ -1461,10 +1545,10 @@ can send. A number in another workspace answers \`404\`.
|
|
|
1461
1545
|
}],
|
|
1462
1546
|
["listWhatsappTemplates", {
|
|
1463
1547
|
name: "listWhatsappTemplates",
|
|
1464
|
-
description: `
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
missing.
|
|
1548
|
+
description: `List the number's message templates, as last synced, oldest first.
|
|
1549
|
+
|
|
1550
|
+
Pass \`status=approved\` to see exactly the templates a send accepts. If a
|
|
1551
|
+
template you expect is missing, run \`syncWhatsappTemplates\` first.
|
|
1468
1552
|
|
|
1469
1553
|
(Tags: WhatsApp)`,
|
|
1470
1554
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" }, "status": { "type": "string", "description": "Show only templates with this review status, such as `approved`,\n`pending` or `rejected`. Lower-case; omit it for all.\n" }, "limit": { "type": "number", "default": 20, "minimum": 1, "maximum": 100, "description": "Rows per page." }, "cursor": { "type": "string", "description": "The `next_cursor` from the previous page." } }, "required": ["number_id"] },
|
|
@@ -1478,10 +1562,11 @@ missing.
|
|
|
1478
1562
|
}],
|
|
1479
1563
|
["syncWhatsappTemplates", {
|
|
1480
1564
|
name: "syncWhatsappTemplates",
|
|
1481
|
-
description: `Pull the number's templates and
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1565
|
+
description: `Pull the number's templates and review statuses from WhatsApp into your
|
|
1566
|
+
list.
|
|
1567
|
+
|
|
1568
|
+
Run it after you create or edit a template in Meta. It runs at most once a
|
|
1569
|
+
minute per number. A second call inside that minute answers \`429\`.
|
|
1485
1570
|
|
|
1486
1571
|
(Tags: WhatsApp)`,
|
|
1487
1572
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" } }, "required": ["number_id"] },
|
|
@@ -1495,10 +1580,11 @@ answers \`429\`.
|
|
|
1495
1580
|
}],
|
|
1496
1581
|
["getWhatsappCalling", {
|
|
1497
1582
|
name: "getWhatsappCalling",
|
|
1498
|
-
description: `
|
|
1499
|
-
|
|
1500
|
-
response
|
|
1501
|
-
|
|
1583
|
+
description: `Get whether calling is on for this number and whether it can be turned on.
|
|
1584
|
+
|
|
1585
|
+
The response lists the checks. A failing check does not fail the request: it
|
|
1586
|
+
stays \`200\` and names the check that blocks. Meta Cloud numbers only. Your
|
|
1587
|
+
plan must include calling.
|
|
1502
1588
|
|
|
1503
1589
|
(Tags: WhatsApp)`,
|
|
1504
1590
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" } }, "required": ["number_id"] },
|
|
@@ -1512,10 +1598,11 @@ only. Calling must be included in your plan.
|
|
|
1512
1598
|
}],
|
|
1513
1599
|
["setWhatsappCalling", {
|
|
1514
1600
|
name: "setWhatsappCalling",
|
|
1515
|
-
description: `Turn calling on or off for a Meta Cloud number.
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1601
|
+
description: `Turn calling on or off for a Meta Cloud number.
|
|
1602
|
+
|
|
1603
|
+
A customer calls this number. It does not place calls. Turning calling on
|
|
1604
|
+
needs every blocking check to pass, or the request answers \`409\`. Turning it
|
|
1605
|
+
off is always allowed.
|
|
1519
1606
|
|
|
1520
1607
|
(Tags: WhatsApp)`,
|
|
1521
1608
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" }, "requestBody": { "type": "object", "required": ["enabled"], "properties": { "enabled": { "type": "boolean", "description": "`true` to turn calling on, `false` to turn it off." } }, "description": "The JSON request body." } }, "required": ["number_id", "requestBody"] },
|
|
@@ -1529,10 +1616,10 @@ allowed.
|
|
|
1529
1616
|
}],
|
|
1530
1617
|
["listWhatsappConversations", {
|
|
1531
1618
|
name: "listWhatsappConversations",
|
|
1532
|
-
description: `
|
|
1533
|
-
|
|
1534
|
-
event webhooks, so
|
|
1535
|
-
messages.
|
|
1619
|
+
description: `List a number's inbox, newest activity first.
|
|
1620
|
+
|
|
1621
|
+
There are no event webhooks, so poll with \`updated_since\` to learn about new
|
|
1622
|
+
messages. Page with \`cursor\`.
|
|
1536
1623
|
|
|
1537
1624
|
(Tags: WhatsApp)`,
|
|
1538
1625
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" }, "filter": { "type": "string", "enum": ["all", "unread", "needs_person", "agent", "failed", "window_closed", "campaign_replies"], "default": "all", "description": "`needs_person` is a person-owned or paused conversation. `window_closed` is one you can only reach with a template." }, "q": { "type": "string", "maxLength": 200, "description": "Search the customer's name, phone number and message text." }, "updated_since": { "type": "string", "description": "An ISO 8601 date and time, such as `2026-10-01T09:00:00+00:00`. Returns\nconversations with a change at or after it. No offset means UTC.\n" }, "limit": { "type": "number", "default": 20, "minimum": 1, "maximum": 100, "description": "Rows per page." }, "cursor": { "type": "string", "description": "The `next_cursor` from the previous page." } }, "required": ["number_id"] },
|
|
@@ -1546,8 +1633,9 @@ messages.
|
|
|
1546
1633
|
}],
|
|
1547
1634
|
["getWhatsappConversation", {
|
|
1548
1635
|
name: "getWhatsappConversation",
|
|
1549
|
-
description: `
|
|
1550
|
-
|
|
1636
|
+
description: `Get one conversation: owner, 24-hour window, opt-out state and unread count.
|
|
1637
|
+
|
|
1638
|
+
Poll it while a person is answering.
|
|
1551
1639
|
|
|
1552
1640
|
(Tags: WhatsApp)`,
|
|
1553
1641
|
inputSchema: { "type": "object", "properties": { "conversation_id": { "type": "string", "description": "A conversation id: the number id, a dash, then the customer's phone\ndigits, such as `412-919876543210`. From\n[listWhatsappConversations](/docs/api-reference/whatsapp/listWhatsappConversations).\n" } }, "required": ["conversation_id"] },
|
|
@@ -1562,7 +1650,9 @@ opted out, and the unread count. Poll it while a person is answering.
|
|
|
1562
1650
|
["takeOverWhatsappConversation", {
|
|
1563
1651
|
name: "takeOverWhatsappConversation",
|
|
1564
1652
|
description: `Take the conversation from the agent, so it stops replying and your team
|
|
1565
|
-
answers.
|
|
1653
|
+
answers.
|
|
1654
|
+
|
|
1655
|
+
Repeating it changes nothing. Hand it back with
|
|
1566
1656
|
\`handBackWhatsappConversation\` when the person is done.
|
|
1567
1657
|
|
|
1568
1658
|
(Tags: WhatsApp)`,
|
|
@@ -1577,8 +1667,9 @@ answers. Repeating it changes nothing. Hand it back with
|
|
|
1577
1667
|
}],
|
|
1578
1668
|
["handBackWhatsappConversation", {
|
|
1579
1669
|
name: "handBackWhatsappConversation",
|
|
1580
|
-
description: `Give the conversation back to the agent
|
|
1581
|
-
|
|
1670
|
+
description: `Give the conversation back to the agent and clear any pause.
|
|
1671
|
+
|
|
1672
|
+
The agent answers the customer's next message. Repeating it changes nothing.
|
|
1582
1673
|
|
|
1583
1674
|
(Tags: WhatsApp)`,
|
|
1584
1675
|
inputSchema: { "type": "object", "properties": { "conversation_id": { "type": "string", "description": "A conversation id: the number id, a dash, then the customer's phone\ndigits, such as `412-919876543210`. From\n[listWhatsappConversations](/docs/api-reference/whatsapp/listWhatsappConversations).\n" } }, "required": ["conversation_id"] },
|
|
@@ -1592,9 +1683,10 @@ answers the customer's next message. Repeating it changes nothing.
|
|
|
1592
1683
|
}],
|
|
1593
1684
|
["listWhatsappMessages", {
|
|
1594
1685
|
name: "listWhatsappMessages",
|
|
1595
|
-
description: `
|
|
1596
|
-
|
|
1597
|
-
|
|
1686
|
+
description: `List one conversation's messages, newest first.
|
|
1687
|
+
|
|
1688
|
+
Poll forward with \`after\`, the id of the newest message you have, to get
|
|
1689
|
+
only new ones. Page back through history with \`cursor\`. Do not pass both.
|
|
1598
1690
|
|
|
1599
1691
|
(Tags: WhatsApp)`,
|
|
1600
1692
|
inputSchema: { "type": "object", "properties": { "conversation_id": { "type": "string", "description": "The conversation to read." }, "after": { "type": "number", "description": "Return messages newer than this message id. `next_cursor` is null in this mode." }, "limit": { "type": "number", "default": 20, "minimum": 1, "maximum": 100, "description": "Rows per page." }, "cursor": { "type": "string", "description": "The `next_cursor` from the previous page. Do not combine it with `after`." } }, "required": ["conversation_id"] },
|
|
@@ -1608,18 +1700,19 @@ Page backward through history with \`cursor\`. Do not pass both.
|
|
|
1608
1700
|
}],
|
|
1609
1701
|
["sendWhatsappMessage", {
|
|
1610
1702
|
name: "sendWhatsappMessage",
|
|
1611
|
-
description: `Send
|
|
1612
|
-
|
|
1703
|
+
description: `Send a text, template, image or document message to a customer.
|
|
1704
|
+
|
|
1705
|
+
It goes out from \`phone_number_id\`. Set \`type\` and the field that matches
|
|
1706
|
+
it.
|
|
1613
1707
|
|
|
1614
|
-
Outside the 24-hour window, only a template goes through.
|
|
1615
|
-
|
|
1616
|
-
|
|
1708
|
+
Outside the 24-hour window, only a template goes through. Text, image and
|
|
1709
|
+
document sends are refused with \`409 window_closed\`. A template send works
|
|
1710
|
+
any time and can start a new conversation.
|
|
1617
1711
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1712
|
+
A send does not take the conversation over, so the agent keeps answering.
|
|
1713
|
+
Set \`take_over: true\` to stop the agent and answer yourself.
|
|
1620
1714
|
|
|
1621
|
-
\`Idempotency-Key\` is required. The same key with the same body replays
|
|
1622
|
-
the first answer instead of sending again.
|
|
1715
|
+
\`Idempotency-Key\` is required. The same key with the same body replays the first answer instead of sending again.
|
|
1623
1716
|
|
|
1624
1717
|
(Tags: WhatsApp)`,
|
|
1625
1718
|
inputSchema: { "type": "object", "properties": { "Idempotency-Key": { "type": "string", "maxLength": 255, "description": "A unique string you choose, up to 255 characters. Required on this\nroute. The same key with the same body replays the first answer for\n24 hours instead of acting twice. A different body with the same key\nanswers `409`.\n" }, "requestBody": { "type": "object", "required": ["phone_number_id", "to", "type"], "properties": { "phone_number_id": { "type": "number", "description": "The number to send from." }, "to": { "type": "string", "description": "The customer's number in international format, such as `+15551234567`." }, "type": { "type": "string", "enum": ["text", "template", "image", "document"] }, "text": { "type": "string", "maxLength": 4096, "description": "Required when `type` is `text`." }, "template": { "type": "object", "description": "Required when `type` is `template`.", "required": ["id"], "properties": { "id": { "type": "number", "description": "An approved template on this number, from `listWhatsappTemplates`." }, "params": { "type": "object", "description": "One value per field in the template's `fields`. Keys are\nthose field keys. String, number or null values.\n", "additionalProperties": true } } }, "media": { "type": "object", "description": "Required when `type` is `image` or `document`.", "required": ["media_id"], "properties": { "media_id": { "type": "string", "description": "The `media_id` from `uploadWhatsappMedia`, uploaded within the last 24 hours." }, "caption": { "type": "string", "maxLength": 1024 } } }, "reply_to": { "type": "number", "description": "A message id in the same conversation to quote. Not allowed with a template." }, "take_over": { "type": "boolean", "default": false, "description": "Stop the agent answering this conversation and let a person run it." } }, "description": "The JSON request body." } }, "required": ["Idempotency-Key", "requestBody"] },
|
|
@@ -1633,9 +1726,11 @@ the first answer instead of sending again.
|
|
|
1633
1726
|
}],
|
|
1634
1727
|
["getWhatsappMessage", {
|
|
1635
1728
|
name: "getWhatsappMessage",
|
|
1636
|
-
description: `
|
|
1637
|
-
first.
|
|
1638
|
-
|
|
1729
|
+
description: `Get one message with its \`timeline\` of delivery and read steps, oldest
|
|
1730
|
+
first.
|
|
1731
|
+
|
|
1732
|
+
Poll it after a send to learn whether the message was delivered and read. It
|
|
1733
|
+
also shows what the send cost once charged.
|
|
1639
1734
|
|
|
1640
1735
|
(Tags: WhatsApp)`,
|
|
1641
1736
|
inputSchema: { "type": "object", "properties": { "message_id": { "type": "number", "description": "Id of a message, from `listWhatsappMessages` or a send response." } }, "required": ["message_id"] },
|
|
@@ -1664,10 +1759,10 @@ lists active opt-outs only.
|
|
|
1664
1759
|
}],
|
|
1665
1760
|
["addWhatsappOptOut", {
|
|
1666
1761
|
name: "addWhatsappOptOut",
|
|
1667
|
-
description: `
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1762
|
+
description: `Block a customer from receiving messages you start from this number.
|
|
1763
|
+
|
|
1764
|
+
The block lasts until you lift it. The response is \`201\` for a new block. It
|
|
1765
|
+
is \`200\` with the entry unchanged if the customer was already blocked.
|
|
1671
1766
|
|
|
1672
1767
|
(Tags: WhatsApp)`,
|
|
1673
1768
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" }, "requestBody": { "type": "object", "required": ["customer"], "properties": { "customer": { "type": "string", "description": "The customer's number in international format, such as `+15551234567`." }, "note": { "type": "string", "maxLength": 500, "description": "A note for your team." } }, "description": "The JSON request body." } }, "required": ["number_id", "requestBody"] },
|
|
@@ -1681,10 +1776,11 @@ returned unchanged.
|
|
|
1681
1776
|
}],
|
|
1682
1777
|
["liftWhatsappOptOut", {
|
|
1683
1778
|
name: "liftWhatsappOptOut",
|
|
1684
|
-
description: `Lift a block you added, or a marketing block made in WhatsApp.
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1779
|
+
description: `Lift a block you added, or a marketing block made in WhatsApp.
|
|
1780
|
+
|
|
1781
|
+
The entry stays in the list with \`active: false\`. You cannot lift a
|
|
1782
|
+
customer's own STOP over the API. The customer must lift it in WhatsApp or
|
|
1783
|
+
message you again.
|
|
1688
1784
|
|
|
1689
1785
|
(Tags: WhatsApp)`,
|
|
1690
1786
|
inputSchema: { "type": "object", "properties": { "number_id": { "type": "number", "description": "Id of a WhatsApp number in your workspace, from\n[listWhatsappNumbers](/docs/api-reference/whatsapp/listWhatsappNumbers).\nA number in another workspace answers `404`.\n" }, "opt_out_id": { "type": "number", "description": "Id of an active opt-out entry, from `listWhatsappOptOuts`." } }, "required": ["number_id", "opt_out_id"] },
|
|
@@ -1712,9 +1808,10 @@ messaging you again, brings them back.
|
|
|
1712
1808
|
}],
|
|
1713
1809
|
["createWhatsappCampaign", {
|
|
1714
1810
|
name: "createWhatsappCampaign",
|
|
1715
|
-
description: `Create a campaign
|
|
1716
|
-
|
|
1717
|
-
|
|
1811
|
+
description: `Create a draft campaign from an approved template. It sends nothing until
|
|
1812
|
+
you launch it.
|
|
1813
|
+
|
|
1814
|
+
Add contacts and launch it with the next calls. Scheduling is not offered.
|
|
1718
1815
|
|
|
1719
1816
|
(Tags: WhatsApp)`,
|
|
1720
1817
|
inputSchema: { "type": "object", "properties": { "requestBody": { "type": "object", "required": ["name", "phone_number_id", "template_id"], "properties": { "name": { "type": "string", "maxLength": 255 }, "phone_number_id": { "type": "number" }, "template_id": { "type": "number", "description": "An approved template on that number." }, "campaign_mode": { "type": "string", "enum": ["broadcast", "broadcast_reply"], "default": "broadcast", "description": "`broadcast_reply` lets the agent answer replies. It needs an agent." }, "agent_id": { "type": "number", "description": "The agent that answers replies." }, "data_source": { "type": "string", "enum": ["csv", "webhook"], "default": "csv" }, "is_dynamic": { "type": "boolean", "default": false }, "variable_mapping": { "type": "object", "description": "Template field to contact field or static text.", "additionalProperties": true } }, "description": "The JSON request body." } }, "required": ["requestBody"] },
|
|
@@ -1728,9 +1825,11 @@ be used, so every campaign starts with one. Scheduling is not offered.
|
|
|
1728
1825
|
}],
|
|
1729
1826
|
["getWhatsappCampaign", {
|
|
1730
1827
|
name: "getWhatsappCampaign",
|
|
1731
|
-
description: `
|
|
1732
|
-
|
|
1733
|
-
|
|
1828
|
+
description: `Get one campaign with its counts and analytics.
|
|
1829
|
+
|
|
1830
|
+
Analytics include per-source figures and failed contacts grouped by reason.
|
|
1831
|
+
\`delivery_rate\` and \`read_rate\` are null on a number that does not report
|
|
1832
|
+
receipts.
|
|
1734
1833
|
|
|
1735
1834
|
(Tags: WhatsApp)`,
|
|
1736
1835
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of a WhatsApp campaign, from `listWhatsappCampaigns`." } }, "required": ["campaign_id"] },
|
|
@@ -1744,8 +1843,10 @@ null on a number that does not report receipts.
|
|
|
1744
1843
|
}],
|
|
1745
1844
|
["listWhatsappCampaignContacts", {
|
|
1746
1845
|
name: "listWhatsappCampaignContacts",
|
|
1747
|
-
description: `
|
|
1748
|
-
|
|
1846
|
+
description: `List per-contact status for a campaign, oldest first.
|
|
1847
|
+
|
|
1848
|
+
A contact that read the message and then replied STOP counts as read and
|
|
1849
|
+
opted out.
|
|
1749
1850
|
|
|
1750
1851
|
(Tags: WhatsApp)`,
|
|
1751
1852
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of a WhatsApp campaign, from `listWhatsappCampaigns`." }, "status": { "type": "string", "enum": ["pending", "sent", "delivered", "read", "replied", "failed", "skipped", "opted_out"], "description": "Show only contacts in this state." }, "limit": { "type": "number", "default": 20, "minimum": 1, "maximum": 100, "description": "Rows per page." }, "cursor": { "type": "string", "description": "The `next_cursor` from the previous page." } }, "required": ["campaign_id"] },
|
|
@@ -1759,11 +1860,13 @@ message and then replied STOP counts as read and opted out.
|
|
|
1759
1860
|
}],
|
|
1760
1861
|
["addWhatsappCampaignContacts", {
|
|
1761
1862
|
name: "addWhatsappCampaignContacts",
|
|
1762
|
-
description: `Add one contact, or up to 500 at once
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1863
|
+
description: `Add one contact, or up to 500 at once, to a campaign.
|
|
1864
|
+
|
|
1865
|
+
On a draft they are stored for launch. On a running campaign they are sent
|
|
1866
|
+
now. A contact already in the campaign is skipped, so a retry is safe.
|
|
1867
|
+
|
|
1868
|
+
Each contact needs a \`phone_number\`. Every other key is kept and can fill a
|
|
1869
|
+
template parameter through \`variable_mapping\`.
|
|
1767
1870
|
|
|
1768
1871
|
(Tags: WhatsApp)`,
|
|
1769
1872
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of a WhatsApp campaign, from `listWhatsappCampaigns`." }, "requestBody": { "description": "One contact object, or an array of 1 to 500.", "oneOf": [{ "type": "object", "description": "One contact. `phone_number` is required. Any other key is kept on the\ncontact and can fill a template parameter through `variable_mapping`.\n", "required": ["phone_number"], "properties": { "phone_number": { "type": "string", "description": "The customer's number in international format, such as `+15551234567`." }, "contact_name": { "type": "string", "description": "A name for your team. `name` works too." } }, "additionalProperties": true }, { "type": "array", "maxItems": 500, "items": { "type": "object", "description": "One contact. `phone_number` is required. Any other key is kept on the\ncontact and can fill a template parameter through `variable_mapping`.\n", "required": ["phone_number"], "properties": { "phone_number": { "type": "string", "description": "The customer's number in international format, such as `+15551234567`." }, "contact_name": { "type": "string", "description": "A name for your team. `name` works too." } }, "additionalProperties": true } }] } }, "required": ["campaign_id", "requestBody"] },
|
|
@@ -1777,10 +1880,11 @@ parameter through \`variable_mapping\`.
|
|
|
1777
1880
|
}],
|
|
1778
1881
|
["launchWhatsappCampaign", {
|
|
1779
1882
|
name: "launchWhatsappCampaign",
|
|
1780
|
-
description: `Start a draft campaign
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1883
|
+
description: `Start a draft campaign and queue every pending contact once.
|
|
1884
|
+
|
|
1885
|
+
It needs at least one contact, unless \`data_source\` is \`webhook\`. Launch
|
|
1886
|
+
checks the plan's monthly broadcast allowance and the wallet balance.
|
|
1887
|
+
\`Idempotency-Key\` is required, so a retry does not start it twice.
|
|
1784
1888
|
|
|
1785
1889
|
(Tags: WhatsApp)`,
|
|
1786
1890
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of a WhatsApp campaign, from `listWhatsappCampaigns`." }, "Idempotency-Key": { "type": "string", "maxLength": 255, "description": "A unique string you choose, up to 255 characters. Required on this\nroute. The same key with the same body replays the first answer for\n24 hours instead of acting twice. A different body with the same key\nanswers `409`.\n" } }, "required": ["campaign_id", "Idempotency-Key"] },
|
|
@@ -1794,8 +1898,10 @@ here. \`Idempotency-Key\` is required, so a retry does not start it twice.
|
|
|
1794
1898
|
}],
|
|
1795
1899
|
["pauseWhatsappCampaign", {
|
|
1796
1900
|
name: "pauseWhatsappCampaign",
|
|
1797
|
-
description: `Stop sending until you resume.
|
|
1798
|
-
|
|
1901
|
+
description: `Stop sending until you resume.
|
|
1902
|
+
|
|
1903
|
+
Only a running campaign can be paused. A pause you make by hand is never
|
|
1904
|
+
resumed automatically.
|
|
1799
1905
|
|
|
1800
1906
|
(Tags: WhatsApp)`,
|
|
1801
1907
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of a WhatsApp campaign, from `listWhatsappCampaigns`." } }, "required": ["campaign_id"] },
|
|
@@ -1809,9 +1915,10 @@ pause you make by hand is never resumed automatically.
|
|
|
1809
1915
|
}],
|
|
1810
1916
|
["resumeWhatsappCampaign", {
|
|
1811
1917
|
name: "resumeWhatsappCampaign",
|
|
1812
|
-
description: `Resume a paused campaign.
|
|
1813
|
-
|
|
1814
|
-
|
|
1918
|
+
description: `Resume a paused campaign.
|
|
1919
|
+
|
|
1920
|
+
Pending contacts are sent. A contact already sent is never sent again.
|
|
1921
|
+
Resume checks the wallet and allowance again, so it can answer \`402\`.
|
|
1815
1922
|
|
|
1816
1923
|
(Tags: WhatsApp)`,
|
|
1817
1924
|
inputSchema: { "type": "object", "properties": { "campaign_id": { "type": "number", "description": "Id of a WhatsApp campaign, from `listWhatsappCampaigns`." } }, "required": ["campaign_id"] },
|
|
@@ -1841,6 +1948,7 @@ or already-canceled campaign cannot be canceled.
|
|
|
1841
1948
|
]);
|
|
1842
1949
|
addShowWorkflow(toolDefinitionMap);
|
|
1843
1950
|
addDocsTools(toolDefinitionMap);
|
|
1951
|
+
addGuideTool(toolDefinitionMap);
|
|
1844
1952
|
if (readOnlyMode())
|
|
1845
1953
|
keepReadOnlyTools(toolDefinitionMap);
|
|
1846
1954
|
/**
|
|
@@ -1857,7 +1965,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1857
1965
|
const toolsForClient = Array.from(toolDefinitionMap.values()).map(def => ({
|
|
1858
1966
|
name: def.name,
|
|
1859
1967
|
description: def.description,
|
|
1860
|
-
inputSchema: def
|
|
1968
|
+
inputSchema: flatInputSchema(def),
|
|
1861
1969
|
annotations: toolAnnotations(def),
|
|
1862
1970
|
_meta: toolMeta(def.name)
|
|
1863
1971
|
}));
|
|
@@ -1872,7 +1980,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1872
1980
|
}
|
|
1873
1981
|
if (isDocsTool(toolName))
|
|
1874
1982
|
return await callDocsTool(toolName, toolArgs ?? {});
|
|
1875
|
-
|
|
1983
|
+
if (isGuideTool(toolName))
|
|
1984
|
+
return callGuideTool(toolArgs ?? {});
|
|
1985
|
+
return await executeApiTool(toolName, toolDefinition, nestBodyArgs(toolDefinition, toolArgs ?? {}), securitySchemes);
|
|
1876
1986
|
});
|
|
1877
1987
|
/**
|
|
1878
1988
|
* Acquires an OAuth2 token using client credentials flow
|