Update an agent

Partial update of an existing agent. Send only the fields you want to change.

PATCH /api/v1/agents/:id

Partial update. Send only the fields you want to change, omitted fields stay unchanged. Honors Idempotency-Key.

Scope: agents:write

Path parameters

ParamTypeNotes
:idstringAgent ID (prefixed or bare).

Request body

Any subset of the create body fields, plus:

FieldTypeNotes
is_activebooleanActivation guard: rejected with 422 if any assigned connector is in auth_failed state. Reconnect the connector first.
deactivated_reasonstring | nullSet/cleared by the system on cascade events; settable manually for diagnostics.
deactivated_atISO 8601 | nullSee above.

Side effects of is_active toggle

Flipping is_active isn't just a flag, it cascades:

  • Triggers: deactivating the agent deactivates all of its triggers. Activating reactivates them. Zendesk webhooks are soft-toggled in place (status flipped on Zendesk's side) rather than torn down and recreated, so the webhook ID that the customer's own Zendesk Triggers reference is preserved.
  • Chatbots: any chatbot bound to this agent is paused/resumed.

Example: deactivate an agent

curl -X PATCH https://dashboard.getmacha.com/api/v1/agents/agent_64f1c0... \
  -H "Authorization: Bearer $MACHA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "is_active": false }'

Example: move an agent to a different model

curl -X PATCH https://dashboard.getmacha.com/api/v1/agents/agent_64f1c0... \
  -H "Authorization: Bearer $MACHA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "model": "gpt-5.4" }'

Example: replace the tool list entirely

curl -X PATCH https://dashboard.getmacha.com/api/v1/agents/agent_64f1c0... \
  -H "Authorization: Bearer $MACHA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tools": [
      { "name": "zendesk_get_ticket",       "connector_id": "connector_..." },
      { "name": "zendesk_update_priority",  "connector_id": "connector_..." }
    ]
  }'

Passing tools replaces the whole array, there's no PATCH-style "add this tool" or "remove this tool" today. Read the agent first, then send the desired final array.

Errors

StatusCodeWhen
404agent_not_foundUnknown ID or soft-deleted past trash window.
409agent_handle_takenRenaming to a handle that already exists.
422validation_failedBad handle format, unhealthy-connector activation block, plan limit on custom tools, self-referencing sub-agent, etc.
Tools are replace-not-merge

Sending "tools": [X] drops every other tool the agent had. To add a tool while keeping the existing ones, read the agent's current tool list, append X, then PATCH the full array back.

© 2026 AGZ Technologies Private Limited