Skip to main content
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 Chat and Tools

Agent Status

GET /v1/agent/status
FieldValue
AuthRequired
Check whether the agent is enabled. Response:
{
  "enabled": true,
  "version": "1.0.0"
}

Chat with Agent

POST /v1/agent/chat
FieldValue
AuthRequired
PermissioncanViewOrganization
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

POST /v1/agent/confirm
FieldValue
AuthRequired
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
FieldValue
AuthRequired
PermissioncanViewOrganization
Get the agent’s context for an organization (available data, capabilities, etc.).

Get Available Tools

GET /v1/organization/:organization/agent/tools
FieldValue
AuthRequired
PermissioncanViewOrganization
List the tools available to the agent for this organization.

Onboarding (Authenticated)

These endpoints require an active user session.
POST /v1/agent/onboarding/link
FieldValue
AuthRequired
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
FieldValue
AuthRequired
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
FieldValue
AuthRequired
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
FieldValue
AuthRequired
Mark the onboarding as complete.

Analyze Onboarding

POST /v1/agent/onboarding/analyze
FieldValue
AuthRequired
Trigger AI analysis of the onboarding context to extract entities, structure, and generate clarifying questions.

Build Organization

POST /v1/agent/onboarding/build
FieldValue
AuthRequired
Build the organization structure based on analyzed onboarding data.

Submit Clarification

POST /v1/agent/onboarding/clarify
FieldValue
AuthRequired
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
FieldValue
AuthRequired
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
FieldValue
AuthNone
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
FieldValue
AuthNone
Retrieve an onboarding context by ID.

Get Analysis Status

GET /v1/agent/onboarding/analysis-status/:id
FieldValue
AuthNone
Check the status of onboarding analysis. Response:
{
  "id": "uuid",
  "status": "analyzed",
  "analysisComplete": true,
  "hasQuestions": true
}

Get Clarifying Questions

GET /v1/agent/onboarding/questions/:id
FieldValue
AuthNone
Get the list of clarifying questions generated by the AI analysis.

Get Showcase Data

GET /v1/agent/onboarding/showcase/:id
FieldValue
AuthNone
Get the showcase data — a preview of the organization structure that will be built from the onboarding context.