Save agent draft
save_agent_draftSave a draft (concept) for a voice agent - a full, validated snapshot of its configuration that is stored but not deployed anywhere. Never changes the running agent; only publish_agent_draft does. For an immediate live change use update_agent. draft must be the COMPLETE snapshot every time (name, language, systemPrompt and provider are required; firstMessage, voiceId, numberE164, transferTo, transferCondition, dataFields, toolIds, recordCalls, recordingNotice, goal, knowledge, notifyEmail, voicemail, silencePromptSecs, laughter, firstMessageProtectSecs, silencePromptText, inboundVariables, sttLanguageHintsStrict, turnDigitTailFloorMs, turnLongSpeechFloorMs, turnLongSpeechSecs, missedCallSms, workflow are optional; workflow has the same shape as update_agent's workflow field). Twelve fields break "complete every time" by carrying meaning in their own absence: recordingNotice, where absent means unchanged, not off; silencePromptSecs, where absent means unchanged, not disabled and not 10 - it is stored the same way for either provider, heard only once the agent runs on the volai engine; laughter, where absent means unchanged, not auto; firstMessageProtectSecs, where absent means unchanged, not disabled (null turns it off); silencePromptText, where absent means unchanged, not the default text (null restores it); inboundVariables, where absent means unchanged, not none (null or {} removes the inbound defaults, an object replaces them entirely); sttLanguageHintsStrict, where absent means unchanged, not off (true turns the strict language lock for speech recognition on, false or null turns it off; engine only, best effort, cs agents with outbound calls, never sk); turnDigitTailFloorMs, turnLongSpeechFloorMs and turnLongSpeechSecs, where absent means unchanged, not the engine default (null restores the engine default of 0, 0 and 5; a number sets the silence floor for dictated digits, the floor after long speech and its speech-length threshold, engine only); missedCallSms, where absent means unchanged, not off (send { enabled: false } to turn it off); and numberE164, where absent leaves the agent's current number untouched, null disconnects it, and a string attaches that number - the same three-state rule PATCH /v1/agents already uses for this field. Sending the number the agent already has live counts the same as leaving numberE164 absent, not as a choice - but that check is re-evaluated on every get_agent_draft read against whatever number is live at that moment, so it is not a stored decision: if the number later moves to another agent outside this draft, the same value you sent becomes an explicit choice again, and the next publish_agent_draft reattaches it here - surfaced as a number_changed_by_publish warning (see publish_agent_draft), not done silently. Re-read the draft with get_agent_draft right before publishing and compare numberE164 to the agent's current live number if that matters to you. The phase graph in workflow is only checked for its JSON shape here; its rules (reachable phases, known tools, per-phase limits) are checked at publish_agent_draft and at PATCH /v1/agents/{id}, so a draft saves even with a graph that publishing later rejects with invalid_workflow - read the current one from get_agent_draft, change only what you want, and send the whole object back; an unknown field is rejected. provider must equal the agent's actual provider (engine or elevenlabs) - a draft cannot change it. voicemail is only meaningful when provider is engine; publishing it on an elevenlabs agent fails with voicemail_requires_engine. toolIds and dataFields allow at most 10 entries each. expectedRevision must equal the revision from get_agent_draft; if someone else (typically a human in the volai portal) saved a newer draft in the meantime, this fails and you must reload with get_agent_draft. Same data as PUT /v1/agents/{id}/draft (response schema in /openapi.json).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"expectedRevision": "<expectedRevision>",
"draft": "<draft>"
},
"name": "save_agent_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Id of the agent whose draft to save, from list_agents. Looks like ag_9f3a2b7c4d1e. | |
| draft | Yes | Complete draft snapshot; send the whole object back every time, unknown fields are rejected. Read the current one with get_agent_draft. | |
| expectedRevision | Yes | Revision of the draft as returned by get_agent_draft. The save is rejected with revision_conflict when it changed since - reload with get_agent_draft. |