persona_id you pass when creating a chat session.
Create an agent
Request body
string
required
Display name for the agent.
string
required
Short description shown in the agent picker UI.
string
required
The system prompt injected before every conversation. Use this to set tone, persona, constraints, and capabilities.
string
required
Additional task-level instructions appended to the system prompt.
boolean
required
When
true, injects the current date and time into the system prompt.boolean
default:"false"
When
true, the system_prompt fully replaces the default Onyx base system prompt instead of prepending to it.boolean
required
When
true, the agent is visible to all users in your tenant.array
required
IDs of document sets this agent searches. Pass an empty array for a general-purpose agent with no scoped knowledge.
array
required
IDs of tools enabled for this agent (e.g. search tool, image generation tool). Pass an empty array to disable tools.
string
Override the LLM provider (e.g.
openai, anthropic).string
Override the model version (e.g.
gpt-4o, claude-3-5-sonnet-20241022).array
Suggested starter prompts shown to users when opening a new chat with this agent.
array
UUIDs of users who can access this agent when
is_public is false.array
Group IDs that can access this agent when
is_public is false.string (ISO 8601)
Only search documents updated after this date.
array
Label IDs to tag this agent with for organization.
boolean
default:"false"
Feature this agent prominently in the UI.
integer
Sort order in the agent list. Lower values appear first.
array
IDs of hierarchy nodes (folders, spaces, channels) to scope search to.
array
IDs of individual documents to attach for scoped search.
array
IDs of user-uploaded files to attach.
Response
Returns aPersonaSnapshot with the created agent’s full details.
integer
Unique agent ID. Use this as
persona_id when creating chat sessions.string
Agent name.
string
Agent description.
boolean
Whether the agent is publicly visible.
boolean
Whether this is a built-in Hadiq.io agent (cannot be deleted).
array
Tools enabled for this agent.
array
Document sets this agent searches.
string
The agent’s system prompt.
Update an agent
This endpoint cannot update
display_priority or builtin_persona. Use the admin display-priority endpoint to reorder agents.Path parameters
integer
required
ID of the agent to update.
Request body
Same as create an agent. All fields may be updated.Get an agent
Path parameters
integer
required
The agent to retrieve.
Response
Returns aFullPersonaSnapshot, which extends PersonaSnapshot with search_start_date.
List agents
Query parameters
integer
default:"0"
Page number (0-indexed).
integer
default:"10"
Items per page. Maximum
1000.boolean
default:"false"
Include soft-deleted agents.
boolean
default:"false"
When
true, only returns agents you can edit.boolean
default:"true"
Include the built-in default agents.
Response
array
Page of
MinimalPersonaSnapshot objects.integer
Total number of agents matching the query.
Delete an agent
Path parameters
integer
required
The agent to delete.
204 No Content on success.
Admin: list agents (paginated)
GET /api/agents. Returns PersonaSnapshot objects (more detailed than MinimalPersonaSnapshot). Requires admin or curator role.