API v1
Agents
Agents CRUD

Create Ai Agent

Create a new AI agent with specified configuration, tools, and knowledge bases

post/v1/agents

Request

  • Base URL
    https://api.xpander.ai (the document declares no server; this is the origin it was published from)
  • Auth
    API key in header x-api-key

Request body

default_user_idstring nullable

Fallback organization user for unattended executions; also used for user budgets and usage attribution.

background_user_overridesobject
namestring required

Human-readable name for the agent. Must be unique within the organization. Examples: 'Customer Support Agent', 'Research Assistant'.

descriptionstring nullable

A brief description of what the agent does. Shown in agent listings and used by other agents when deciding delegation. Keep it concise and action-oriented.

iconstring nullable

Identity string xpi:<icon>:<colour> rendered as a gradient tile next to the agent name, never an emoji. Omit it and the server derives one from the agent.

avatarstring nullable

Avatar identifier for the agent's visual representation in chat interfaces.

type'manager' | 'regular' | 'a2a' | 'curl' | 'orchestration'

Enumeration of the agent types.

Attributes: Manager: marks the agent as a Managing agent. Regular: marks the agent as a regular agent. A2A: marks the agent as an external agent used via A2A protocol. Curl: marks the agent as an external agent used via a CURL. Orchestration: marks the agent as an Orchestration object.

created_bystring nullable

User ID of the creator. Auto-populated from the API key if not provided.

model_namestring nullable

The specific model identifier within the chosen provider. Must match a model from GET /llm_providers/{provider}/models. Examples: 'claude-opus-5-5', 'gpt-4o', 'gemini-2.0-flash'.

llm_reasoning_effort'low' | 'medium' | 'high' | 'xhigh'
llm_api_basestring nullable

Custom API base URL for the LLM provider. Use this when connecting to a self-hosted or proxied LLM endpoint instead of the provider's default URL. Leave None to use the provider's standard endpoint.

llm_credentials_keystring nullable

Reference key to stored LLM API credentials in the xpander.ai vault. When set, the agent uses these credentials instead of the organization's default. Create credentials via the platform settings.

llm_credentials_key_type'xpander' | 'custom'
llm_extra_headersobject nullable

Additional HTTP headers to include in every LLM API request. Useful for custom authentication, routing through gateways (e.g., Helicone, Cloudflare AI Gateway), or passing metadata.

expected_outputstring nullable

Description of the expected output format and content. Guides the agent on what the final response should look like. Used in the system prompt to set output expectations.

output_format'text' | 'markdown' | 'json' | 'voice'
output_schemaobject nullable

JSON Schema defining the structure of the agent's output when output_format is 'json'. The agent will conform its response to match this schema. Must be a valid JSON Schema object.

frameworkstring nullable

The execution framework for this agent. Omit it to use the organization default runtime (the external harness, on the CLI the organization's default LLM maps to). 'external-harness' runs the agent as a CLI session (Claude Code, Codex or OpenCode); 'agno' is the xpander.ai in-process framework. Other options: 'langchain', 'open-ai-agents', 'google-adk', 'strands-agents'.

deep_planningboolean nullable

Enable deep planning mode where the agent creates a detailed execution plan before taking actions. Useful for complex multi-step tasks. Increases latency but improves accuracy on complex workflows.

enforce_deep_planningboolean nullable

When True, forces the agent to always use deep planning regardless of task complexity. When False (default), the agent decides when to plan based on the task.

deployment_type'serverless' | 'container'
access_scope'personal' | 'organizational' | 'project'
environment_idstring nullable

Target deployment environment ID. Leave None for the organization's default environment. Use this to deploy agents to specific on-premise or regional environments.

voice_idstring nullable

Voice ID for text-to-speech output when output_format is 'voice'. References a voice profile in the platform's TTS service.

using_nemoboolean nullable

Enable NVIDIA NeMo guardrails integration for this agent. Provides additional safety and content filtering capabilities.

is_supervisedboolean nullable

Enable supervised mode where the agent requires human approval before executing mutating operations (write/update/delete). Non-mutating operations (read/search) execute automatically.

is_autonomousboolean nullable

Run the agent in autonomous mode.

discoverableboolean nullable

Omni's entry on the agent's caller list. When True, Omni finds the agent and can send it tasks. When False, Omni cannot see it or send it tasks.

with_auto_context_managementboolean nullable

When True, the SDK runs its automatic context optimizer (compaction). When False, context management is skipped.

developer_accessboolean nullable

When True, the agent is reachable from the developer API and webhook entry points. When False, external API/webhook invocation is rejected.

should_stage_before_publishboolean nullable

When True, edits are staged as a draft version before being published. When False, edits publish directly. Ignored for agents while drafts are off (the default, AGENT_DRAFTS_ENABLED): every edit saves to live.

gated_commandsobject[] nullable

Approval-required workspace commands: a list of {match, unless?, note?, approvers?, channels?}. match is the LITERAL command text (a plain substring, no regex, no escaping); unless names a safe variant that stays exempt (e.g. '--dry-run'). A workspace command containing a match is held for a person's approval before it runs - even on an autonomous/scheduled run. approvers ({user_ids, group_ids}) names who is asked; omit it and the agent's owner is asked. channels (e.g. ['slack']) routes the notification; omit it and each approver's own preferences decide.

on_prem_event_streamingboolean nullable

Enable real-time event streaming for on-premise deployments. When True, task progress events are streamed to connected clients.

use_oidc_pre_authboolean nullable

Enable OIDC pre-authentication for this agent. When enabled, the agent requires a valid OIDC token from the invoking user before execution. Used for user-context-aware operations.

pre_auth_audiencesstring[] nullable

List of allowed OIDC token audiences for pre-authentication validation. Only tokens with matching audience claims are accepted.

use_oidc_pre_auth_token_for_llmboolean nullable

When True, the user's OIDC token is forwarded to the LLM provider for authenticated LLM calls. Requires use_oidc_pre_auth to be enabled.

oidc_pre_auth_token_llm_audiencestring nullable

The audience claim to request when exchanging the user's OIDC token for LLM provider access. Only used when use_oidc_pre_auth_token_for_llm is True.

oidc_pre_auth_token_mcp_audiencestring nullable

The audience claim to request when exchanging the user's OIDC token for MCP server access. Enables user-context-aware MCP tool execution.

Response

Successful Response

idstring nullable
unique_namestring nullable
origin_templatestring nullable
environment_idstring nullable
runtime_environment_idstring nullable
deployment_type'serverless' | 'container'
promptsstring[] nullable
is_latestboolean nullable
has_pending_changesboolean nullable
deep_planningboolean nullable
enforce_deep_planningboolean nullable
use_agent_gatewayboolean nullable
namestring required
frameworkstring nullable
descriptionstring nullable
iconstring nullable
avatarstring nullable
access_scope'personal' | 'organizational' | 'project'
project_idstring nullable
oasobject nullable
is_omniboolean nullable
kind'gateway' | 'cloud_code'

A platform-made agent: the gateway one is hidden from lists, counts and delegation; every kind stays out of the agents quota.

skillsobject[] nullable
runtime_environmentobject nullable
company_brain_enabledboolean
agent_brainsstring[] nullable
secret_bindingsobject[] nullable
required_secretsobject[]
gated_commandsobject[] nullable
status'DRAFT' | 'ACTIVE' | 'INACTIVE'

Enumeration of possible agent statuses.

Attributes: DRAFT: Agent is in a draft state. ACTIVE: Agent is active and operational. INACTIVE: Agent is inactive and not operational.

versioninteger nullable
organization_idstring required
created_bystring nullable
default_user_idstring nullable

Organization user to run as when a non-UI invocation has no resolved user.

background_user_overridesobject
created_atstring date-time nullable
type'manager' | 'regular' | 'a2a' | 'curl' | 'orchestration'

Enumeration of the agent types.

Attributes: Manager: marks the agent as a Managing agent. Regular: marks the agent as a regular agent. A2A: marks the agent as an external agent used via A2A protocol. Curl: marks the agent as an external agent used via a CURL. Orchestration: marks the agent as an Orchestration object.

using_nemoboolean nullable
deletableboolean nullable
model_provider'openai' | 'nim' | 'amazon_bedrock' | 'azure_ai_foundary' | 'huggingFace' | 'friendlyAI' | 'anthropic' | 'gemini' | 'fireworks' | 'google_ai_studio' | 'helicone' | 'bytedance' | 'tzafon_lightcone' | 'cerebras' | 'open_router' | 'nebius' | 'cloudflare_ai_gw' | 'z_ai'
model_namestring nullable
llm_reasoning_effort'low' | 'medium' | 'high' | 'xhigh'
llm_api_basestring nullable
output_format'text' | 'markdown' | 'json' | 'voice'
voice_idstring nullable
output_schemaobject nullable
llm_credentials_keystring nullable
llm_credentials_key_type'xpander' | 'custom'
llm_extra_headersobject nullable
expected_outputstring nullable
on_prem_event_streamingboolean nullable
is_supervisedboolean nullable
use_oidc_pre_authboolean nullable
pre_auth_audiencesstring[] nullable
use_oidc_pre_auth_token_for_llmboolean nullable
oidc_pre_auth_token_llm_audiencestring nullable
oidc_pre_auth_token_mcp_audiencestring nullable
can_self_scheduleboolean nullable
can_archive_conversationsboolean nullable
max_self_schedulesinteger nullable
use_dynamic_toolsboolean nullable
workspace_tools_enabledboolean nullable
live_surface_sharing_enabledboolean nullable
is_autonomousboolean nullable
discoverableboolean nullable
conversation_retentionAgentConversationRetention
with_auto_context_managementboolean nullable
developer_accessboolean nullable
should_stage_before_publishboolean nullable
webhook_urlstring required

Changes

No recorded changes to this operation across all 4 revisions of this API.