Skip to main content
PATCH
/
api
/
v2
/
agents
/
{agent_name}
Patch an agent
curl --request PATCH \
  --url https://agp.eu.hcompany.ai/api/v2/agents/{agent_name} \
  --header 'Authorization: Bearer <token>'
Partial update: only the fields you send change, everything else is preserved. Send a field as null to clear it. The merged result is validated like a full update, and name is not patchable (renames are not supported). Returns the updated Agent object.

Path parameters

agent_name
string
required
The agent’s name (e.g. my-research-bot or myorg/web-helper). Slash-containing names are supported.

Request body

Any subset of the Agent object’s fields except name: description, environments, model, instructions, subagents, skills, answer_format, tools.

Examples

Change the instructions and nothing else:
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/agents/my-research-bot \
  -H "Authorization: Bearer $HAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"instructions": "Always cite the page you took each claim from."}'

Errors

StatusCause
403The agent is reserved (h/) and read-only.
404Agent not found (or a referenced skill, environment, or subagent isn’t), or you don’t have access.
422The merged spec fails validation, for example environments set to an empty list.