/v1/agents endpoints.
All requests go to the base URL https://api.hq.zone and authenticate with a personal access token:
Read operations require the
agents:read scope. Every write operation (create, update, disable, enable, set default, replace skills/MCP, upload avatar, suggest instructions) requires the admin scope. Each endpoint is scoped to your own workspace; you can never see or modify another workspace’s agents.Discover what’s available
List your agents
Returns every agent in your workspace, ordered with the default agent first, then enabled agents, then by slug. See List agents.Each agent carries
id, slug, display_name, description, instructions, instructions_is_default, tone, verbosity, cautions, languages, aliases, runtime_profile, model, delivery_mode, is_default, status, avatar_url, and created_at.List selectable models
The agent editor’s model picker. Pass the optional
runtime query parameter (claude-sdk, openai-agents, or opencode) to restrict to one runtime profile; otherwise all selectable models are returned. See List models.Create an agent
POST a new agent
Only
slug and display_name are required. Everything else is optional. See Create agent.Know the field rules
The request accepts:
slug, display_name, description, instructions, tone, verbosity, cautions, languages, aliases, runtime_profile, model, avatar_url, enabled_skill_slugs, and enabled_mcp_slugs.slugand each entry ofaliasesmust be 2-32 characters, lowercase ASCII letters/digits/hyphens, not starting or ending with a hyphen, with no--, and not a reserved token (hq,me,help,default,none,agent,anyone,all,system,admin,bot). An alias must differ from the slug and must not collide with any other agent’s slug or alias in the workspace.tonemust be one offormal,friendly,direct,casual(or omitted).verbositymust be one ofconcise,balanced,detailed(or omitted).instructionsis capped at 8 KiB; longer content should live in a skill.languagesare BCP-47 codes (e.g.en,sv,pt-BR), max 8.cautionsare short phrases, max 120 characters each, max 8 items.runtime_profiledefaults toclaude-sdkif omitted.modelmust be a selectable model belonging toruntime_profile; omit it to use the runtime’s platform default.
If you omit
avatar_url, an avatar is generated automatically for the new agent (best-effort, asynchronous). To set one explicitly at create time, avatar_url must be an internal artifact path produced by the avatar upload flow — external URLs are rejected. See Upload an avatar below.Update an agent
PATCH /v1/agents/{id} changes only the fields you send; omitted fields are left unchanged. For nullable fields (description, instructions, tone, verbosity, model, avatar_url), sending an explicit null clears the value back to its default. See Update agent.
slug, display_name, description, instructions, tone, verbosity, cautions, languages, aliases, runtime_profile, and model, avatar_url. Slug and alias rules match creation, including the collision check.
A 400 is returned for an invalid slug, alias conflict, or bad field; 404 if the agent is not in your workspace.
Enable, disable, and set the default
Disable an agent
Sets
status to disabled so it stops routing on every surface. The default agent cannot be disabled. See Disable agent.Re-enable an agent
Flips
status back to enabled. It is idempotent — calling it on an already-enabled agent is a no-op. See Enable agent.Promote to default
Atomically clears the default flag from whichever agent held it and sets this one. The target must be enabled. See Set default.
404 if the agent is not in your workspace.
Attach skills and MCP servers
Each agent has an enabled subset of skills and MCP servers. An empty list means “use everything installed for the workspace.” ThePUT endpoints fully replace the current subset — they do not merge with what’s already there.
Inspect the current subsets
See List skills and List MCP.
Replace the skill subset
Send the complete
enabled list. Each slug must be a skill currently installed for the workspace. See Replace skills.Replace the MCP subset
Same contract for MCP servers. See Replace MCP.
Upload an avatar
POST /v1/agents/{id}/avatar uploads an avatar image. The image is sent as base64 in a JSON body (not multipart). The body has three fields: filename, content_type, and body_b64. See Upload avatar.
content_typemust be one ofimage/png,image/jpeg,image/svg+xml,image/webp, orimage/gif.- The decoded image must be non-empty and at most 2 MiB.
- The handler stores the bytes and writes the resulting internal artifact path into the agent’s
avatar_url.
Suggest tailored instructions
POST /v1/agents/{id}/suggest-instructions drafts a tailored system prompt for the agent based on your workspace’s profile and the agent’s current role, and returns it for review. See Suggest instructions.
A
404 is returned if the agent is not in your workspace; a 500 is returned if the tailor feature is disabled (no Anthropic key configured on the control plane).