Skip to main content
PUT
/
api
/
v2
/
agents
/
{agent_name}
Update an agent
curl --request PUT \
  --url https://agp.eu.hcompany.ai/api/v2/agents/{agent_name} \
  --header 'Authorization: Bearer <token>'
Updates an existing agent. This is a full replacement of the Agent object. The name must match the URL identifier: 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

A full replacement of the Agent object. The name in the body must equal the URL identifier. Because this replaces the resource, resend a field’s current value to keep it unchanged.

Examples

curl -X PUT https://agp.eu.hcompany.ai/api/v2/agents/my-research-bot \
  -H "Authorization: Bearer $H_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-research-bot",
    "description": "Researches a topic and returns a sourced summary.",
    "environments": ["h/browser"],
    "instructions": "Always cite the page you took each claim from.",
    "skills": ["web-browse", "extract-data"]
  }'
Response
{
  "name": "my-research-bot",
  "description": "Researches a topic and returns a sourced summary.",
  "environments": ["h/browser"],
  "model": null,
  "instructions": "Always cite the page you took each claim from.",
  "skills": ["web-browse", "extract-data"],
  "subagents": null
}

Errors

StatusCause
400The name in the body does not match the URL identifier (renames are not supported).
403The agent is reserved (h/) and you are not an H employee.
404Agent not found or you don’t have access.
422Body fails validation; common cases: environments empty, invalid name shape.