Change the draft of an AI agent
PUT /ai_agents/{uuid}
/ai_agents/{uuid}Changes the DRAFT of an agent (and its name, description, icon, access or own cap). Only the fields sent change. Inside draft, each key sent (instructions, tools, limits) replaces that key of the draft and the keys not sent are kept: sending only instructions keeps the tools and the limits. Nothing is published: the automations and the people who use the agent keep the published version until publish_ai_agent.
When to use: To improve an agent («make the researcher also look at LinkedIn»): read it with get_ai_agent, send the key of draft that changes (for example the whole tools list with the new tool), try it with run_ai_agent (version: draft) and publish it. Also to rename it or change who can use it.
When not to use: To make the change take effect use publish_ai_agent afterwards. To go back to an earlier version, read it with list_ai_agent_versions and send its definition here. To create a new agent use create_ai_agent. An archived agent cannot change.
Side effects: Saves the draft; nothing else. No version is created, no automation changes and nothing is charged. There is no version check: if two people save at the same time, the last write wins. Changes to access and period_cap apply at once, not on publishing. When Maia makes the request, it cannot set a tool that writes in auto (automatic) mode (see the errors).
Permissions: Requires the automations.manage capability. It also needs AI in the plan (maia.access). The account must also have CRM Pro.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the agent.
uuidThe updated AiAgent resource
TypeScript Definitions
Use the request body type in TypeScript.
AI agents of the public API (ADR-0195). Generated from the approved proposal (2026-11-16) by trabajo/2026-11-15-agentes-ia/fase-4-api-publica/tools/gen_ai_agents_api.py; the texts are the proposal's, with the deviations the code imposes (notas.md § 10).
Every operation checks its capability in the provider or processor before the use case ({@see \App\Application\Automation\ApiAiAgentAccess}),
because API Platform evaluates security after the provider; the rules live in the CoreBundle use cases (Service\App\AiAgent), the
same the internal API runs. The definition travels in snake_case ({@see \App\Api\State\Mapper\Automation\AiAgentDefinitionTranslator}).
/ai_agents/actions/propose is propose_ai_agent, not an agent.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X PUT "https://api.easymailing.com/ai_agents/6e2f0a97-4b1c-4d35-9a8e-2c7d5f1b3e40" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "description": "string", "icon": "string", "draft": {}, "access": "team", "period_cap": {} }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "description": "string", "icon": "string", "status": "draft", "published_version": 1, "unpublished_changes": true, "access": "team", "period_cap": {}, "tool_types": [ "string" ], "draft": {}, "published": {}, "used_in": 0, "spent_last_30_days": {}, "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4", "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "archived_at": "2019-08-24T14:15:22Z"}