Update an agent
Edit one agent's name, description, display copy or editable prompt (role, tasks, guidelines, extra instructions, humanisation pack), named by preset. Only the fields sent change. The platform rules above the prompt cannot be changed.
PATCH
https://app.trygtm.com/api/v1/agents/{preset}- Scope
write- MCP tool
- update_agent
Path parameters
presetstringrequired- The agent's role, from list_agents: leads, intent, outreach, copy or qa. Pass this or agentId.
leadsintentoutreachcopyqa
Headers
Idempotency-Keystringoptional- A key unique to this write, up to 255 characters. A retry carrying the same key returns the first response instead of running again. Kept for 24 hours.
Body
agent_idstringoptional- The agent's id, from list_agents. Pass this or preset.
namestringoptional- The agent's display name.
descriptionstringoptional- One or two sentences about what it does. Blank clears it.
rolestringoptional- Who the agent is, in the second person. Replaces the stored role.
tasksstring[]optional- What it does, one task per entry, up to 24. Replaces the stored list. Omit to leave unchanged.
guidelinesstring[]optional- How it does it, one rule per entry, up to 48. Replaces the stored list. Omit to leave unchanged.
extrastringoptional- Free-form extra instructions. Blank clears them.
humanization_packstringoptional- The humanisation pass applied after generation, by name. The default pack is default.
copyobjectoptional- Display copy the screens show. Never read by a model.
display_namestringoptional- Name shown on cards. Blank uses the role's.
taglinestringoptional- One line under the name. Blank uses the role's.
working_labelstringoptional- Status word while it works. Blank is Working.
idle_labelstringoptional- Status word while idle. Blank is Idle.
empty_statestringoptional- What its empty screen says. Blank uses the role's.
Request
curl -X PATCH https://app.trygtm.com/api/v1/agents/copy \
-H "Authorization: Bearer $TRYGTM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Q4 logistics leaders",
"role": "You write short, specific first messages for logistics buyers."
}'Response
{
"data": {
"id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"preset": "copy",
"name": "GTM Copy",
"version": 7,
"detail": "Saved role, guidelines. The platform rules above the prompt are unchanged."
}
}