Set the main conversation agent for the organization.
The main agent is the entry point for all user chat messages. It receives messages non-streaming and routes them to the appropriate specialist agent.
Returns: Updated organization record.
Raises: NotFoundError: If agent resource not found in the organization.
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.
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).