Skip to main content
POST
/
agents
/
main-agent
Set Main Agent
curl --request POST \
  --url https://api.example.com/agents/main-agent \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_resource_id": "<string>"
}
'
{
  "organization_id": "<string>",
  "name": "<string>",
  "slug": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "status": "active",
  "main_agent_resource_id": "<string>"
}

Body

application/json

Request body for setting the organization's main conversation agent.

Attributes: agent_resource_id: SurrealDB resource ID of the agent to use as the main conversation router.

agent_resource_id
string
required

Response

Successful Response

Organization record stored in shared SurrealDB namespace.

Represents a Clerk organization synced via webhooks. Stored in the shared namespace because organization data must be accessible before any organization context exists (e.g., during webhook processing).

Identity fields (frozen): organization_id: Clerk organization ID, used as SurrealDB record ID.

Metadata: name: Display name of the organization. slug: URL-friendly organization identifier from Clerk.

State (system-managed): status: Lifecycle status (active, deactivating, deleted).

Agent routing: main_agent_resource_id: SurrealDB resource ID of the organization's main conversation agent, used as the entry point for chat routing.

Inherited from PragmaModel: created_at: Creation timestamp (frozen). updated_at: Last update timestamp (mutable).

organization_id
string
required
name
string
required
slug
string
required
created_at
string<date-time>
updated_at
string<date-time>
status
enum<string>
default:active

Lifecycle status of an organization.

Available options:
active,
deactivating,
deleted
main_agent_resource_id
string | null