Source: equa-server/modules/agent/src/endpoints/agent-endpoints.ts
Agent Endpoints
These endpoints are only available when the Equanaut AI assistant is enabled.
Requires the AGENT_* environment variables to be configured.
Source: endpoints.ts line 124 — if (isAgentEnabled(process.env))
Endpoints for the Equanaut AI assistant — the intelligent agent that helps users manage their organizations through natural language. Includes chat, tool access, action confirmation, and an AI-powered onboarding flow.
The agent is enabled when ANTHROPIC_API_KEY is set (and AGENT_ENABLED is not false).
Agent Status
Check whether the agent is enabled.
Response:
{
"enabled": true,
"version": "1.0.0"
}
Chat with Agent
| Field | Value |
|---|
| Auth | Required |
| Permission | canViewOrganization |
Send a message to the Equanaut agent and receive a response. Supports conversation history for multi-turn interactions.
Request:
{
"organization": "uuid",
"message": "How many shareholders does this company have?",
"conversationId": "uuid-optional",
"history": [
{ "role": "user", "content": "Previous message" },
{ "role": "assistant", "content": "Previous response" }
]
}
Response:
{
"response": "Your company has 12 shareholders across 3 security types.",
"conversationId": "uuid",
"toolCalls": [],
"pendingConfirmations": []
}
Confirm Agent Action
Confirm or reject a pending write operation initiated by the agent. Write operations require user confirmation by default (AGENT_CONFIRM_WRITE_OPERATIONS).
Request:
{
"stepId": "uuid",
"confirmed": true
}
Get Organization Context
GET /v1/organization/:organization/agent/context
| Field | Value |
|---|
| Auth | Required |
| Permission | canViewOrganization |
Get the agent’s context for an organization (available data, capabilities, etc.).
GET /v1/organization/:organization/agent/tools
| Field | Value |
|---|
| Auth | Required |
| Permission | canViewOrganization |
List the tools available to the agent for this organization.
Onboarding (Authenticated)
These endpoints require an active user session.
Link User to Onboarding
POST /v1/agent/onboarding/link
Link the authenticated user to a pre-existing onboarding context (created during sign-up).
Request:
{
"onboardingId": "uuid"
}
Run Onboarding Setup
POST /v1/agent/onboarding/setup
Execute the onboarding setup — the agent creates the organization, cap table structure, members, and other entities based on the onboarding context.
Request:
{
"onboardingId": "uuid"
}
Get First Login Context
GET /v1/agent/onboarding/first-login
Check if this is the user’s first login and retrieve onboarding context including a welcome message.
Response:
{
"isFirstLogin": true,
"onboardingId": "uuid",
"setupResult": { ... },
"welcomeMessage": "Welcome! I've set up your organization..."
}
Complete Onboarding
POST /v1/agent/onboarding/complete
Mark the onboarding as complete.
Analyze Onboarding
POST /v1/agent/onboarding/analyze
Trigger AI analysis of the onboarding context to extract entities, structure, and generate clarifying questions.
Build Organization
POST /v1/agent/onboarding/build
Build the organization structure based on analyzed onboarding data.
Submit Clarification
POST /v1/agent/onboarding/clarify
Submit an answer to a clarifying question generated during onboarding analysis.
Request:
{
"onboardingId": "uuid",
"questionId": "uuid",
"answer": "Yes, we have 3 co-founders"
}
Submit Correction
POST /v1/agent/onboarding/correct
Submit a correction to an item in the onboarding showcase.
Request:
{
"onboardingId": "uuid",
"itemId": "uuid",
"fieldPath": "name",
"newValue": "Corrected Company Name"
}
Onboarding (Public)
These endpoints do not require authentication and are used during the sign-up flow before the user has an account.
Create Onboarding Context
POST /v1/agent/onboarding/create
Create a new onboarding context with the user’s email and initial prompt describing their company.
Request:
{
"email": "founder@startup.com",
"initialPrompt": "I'm starting a Delaware C-Corp with two co-founders..."
}
Get Onboarding Context
GET /v1/agent/onboarding/:id
Retrieve an onboarding context by ID.
Get Analysis Status
GET /v1/agent/onboarding/analysis-status/:id
Check the status of onboarding analysis.
Response:
{
"id": "uuid",
"status": "analyzed",
"analysisComplete": true,
"hasQuestions": true
}
Get Clarifying Questions
GET /v1/agent/onboarding/questions/:id
Get the list of clarifying questions generated by the AI analysis.
Get Showcase Data
GET /v1/agent/onboarding/showcase/:id
Get the showcase data — a preview of the organization structure that will be built from the onboarding context.