---
title: "Save agent draft"
method: PUT
path: "/v3/ai-agents/{agent_id}/draft"
tags: ["v3", "ai-agents"]
---

# Save agent draft

`PUT /v3/ai-agents/{agent_id}/draft`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v3/ai-agents/{agent_id}/draft`
- Auth: HTTP bearer

Persist draft changes without publishing. Intended for debounced auto-save.

## Path parameters

- `agent_id` string, uuid, required

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- AIAgentDraftSaveRequest: Request schema for saving draft changes (auto-save). Same shape as update.
  - `name` string, nullable: Agent name
  - `description` string, nullable: Agent description
  - `type_config` object, nullable: Type-specific configuration.
  - `workspace_phone_number_id` string, nullable: Assigned workspace phone number ID.
  - `model` string, nullable: LLM model identifier
  - `system_prompt_template` string, nullable: System prompt template
  - `user_prompt_template` string, nullable: User prompt template
  - `temperature` number, nullable: LLM temperature (0-2)
  - `max_tokens` integer, nullable: Maximum output tokens
  - `reasoning_effort` string, nullable: Reasoning effort level for reasoning models (dynamic, depends on model)
  - `tools` string[], nullable: List of tool identifiers the agent can use
  - `tool_inputs` object, nullable: Agent-side default inputs per tool identifier (tool_identifier -> {param_key -> value}). Soft defaults that travel with the agent; runtime precedence is agent < node < LLM args.
  - `mcp_bindings` AgentMcpBindingInput[], nullable: MCP servers the agent may use; applied when the draft is published
    - `integration_connection_id` string, required
    - `allowed_tool_names` string[]
  - `is_active` boolean, nullable: Whether the agent is active

## Response `200`

Successful Response

- AIAgentResponse: Response schema for a single AI agent.
  - `id` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `agent_type` string, required
  - `type_config` object, nullable, required
  - `workspace_phone_number_id` string, nullable
  - `model` string, required
  - `system_prompt_template` string, required
  - `user_prompt_template` string, nullable, required
  - `temperature` number, nullable, required
  - `max_tokens` integer, nullable, required
  - `reasoning_effort` string, nullable, required
  - `tools` string[], required
  - `tool_inputs` object, nullable: Agent-side default inputs per tool identifier (tool_identifier -> {param_key -> value}). Soft defaults that travel with the agent; runtime precedence is agent < node < LLM args.
  - `automation_tools_count` integer: Number of shared HTTP automation tools bound to this agent.
  - `is_active` boolean, required
  - `is_draft` boolean
  - `draft_of_id` string, nullable
  - `yaml_content` string, nullable
  - `chat_history` object[], nullable
  - `yaml_history` object[], nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `prompt_variables` string[]: {{variable}} placeholder names found in the agent's prompts (system_prompt_template, user_prompt_template, type_config.first_message). Excludes ElevenLabs system variables (system__*) injected automatically at runtime.
  - `has_draft` boolean: True when the agent has unpublished draft changes.
  - `live_revision_id` string, nullable: The revision the agent runs
  - `draft` object, nullable: Staged draft changes that have not been published yet.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mentium/apis/mentium-api.md) - [All operations](https://skmtc.dev/mentium/apis/mentium-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mentium/apis/mentium-api/revisions/b4ed8e59432e?raw)
