Easymailing
A I agents

Publish an AI agent

POST /ai_agents/{uuid}/actions/publish

POST/ai_agents/{uuid}/actions/publish

Freezes the draft as the next version of the agent (version n+1) and makes it the current one (published_version). From then on run_ai_agent and new automations use it.

Automations that already use the agent keep the version they validated: publishing does not change them. They are brought to the new version in Easymailing, by a person who can see and edit everything the new version touches.

When to use: When the draft is ready and has been tried with run_ai_agent (version: draft). A draft that was never published cannot be asked or used in an automation.

When not to use: To save changes without making them live use update_ai_agent. Publishing needs a name and instructions: without them the answer is 422. Publishing again a draft with no changes still creates a new version; check unpublished_changes first.

Side effects: Creates a version and changes what run_ai_agent uses. It does not touch running or published automations, sends nothing and charges nothing. It cannot be undone, but the previous version stays in list_ai_agent_versions and can be copied back into the draft and published again. When Maia makes the request, it is refused if the draft sets a tool that writes in auto (automatic) mode, even when a person set it (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. When Maia asks, the person confirms it first in the chat.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

uuid*string

UUID of the agent.

Formatuuid

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.easymailing.com/ai_agents/6e2f0a97-4b1c-4d35-9a8e-2c7d5f1b3e40/actions/publish" \  -H "X-Auth-Token: YOUR_API_KEY"
{  "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"}