Base URL:
http://localhost:3001/apiAuth: JWT Bearer token inAuthorizationheader (unless noted) Content-Type:application/json(except file uploads:multipart/form-data)
endpoint: /api/health
method: GET
auth: false
description: Health check
response:
status: 200
body:
status: "ok"
timestamp: "2026-04-07T00:00:00.000Z"curl http://localhost:3001/api/healthendpoint: /api/auth/register
method: POST
auth: false
request:
body:
email: string # required
password: string # required, min 6 chars
name: string # required
orgName: string # required
response:
status: 201
body:
token: string # JWT token (expires 7d)
user:
id: string
email: string
name: string
role: "founder"
orgId: stringcurl -X POST http://localhost:3001/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "secret123",
"name": "John Doe",
"orgName": "Acme Inc"
}'endpoint: /api/auth/login
method: POST
auth: false
request:
body:
email: string # required
password: string # required
response:
status: 200
body:
token: string
user:
id: string
email: string
name: string
role: "founder | team_member | cpa | admin"
orgId: stringcurl -X POST http://localhost:3001/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "secret123"
}'endpoint: /api/auth/me
method: GET
auth: true
response:
status: 200
body:
id: string
email: string
name: string
role: "founder | team_member | cpa | admin"
orgId: stringcurl http://localhost:3001/api/auth/me \
-H "Authorization: Bearer <token>"endpoint: /api/entities
method: GET
auth: true
description: List all entities for the organization
response:
status: 200
body: Entity[]curl http://localhost:3001/api/entities \
-H "Authorization: Bearer <token>"endpoint: /api/entities
method: POST
auth: true
description: Create entity and auto-calculate tax deadlines
request:
body:
legalName: string # required
entityType: string # required — C-Corp | LLC | S-Corp | Pvt-Ltd
stateOfIncorporation: string # required
ein: string # optional — format XX-XXXXXXX
fiscalYearEnd: string # optional — MM-DD, default 12-31
foreignSubsidiaries: string[] # optional
country: string # optional — default US
response:
status: 201
body:
id: string
orgId: string
legalName: string
entityType: string
stateOfIncorporation: string
ein: string
fiscalYearEnd: string
foreignSubsidiaries: string[]
country: string
status: "active"
createdAt: stringcurl -X POST http://localhost:3001/api/entities \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"legalName": "Acme Corp",
"entityType": "C-Corp",
"stateOfIncorporation": "Delaware",
"ein": "12-3456789",
"fiscalYearEnd": "12-31",
"country": "US"
}'endpoint: /api/entities/:id
method: GET
auth: true
response:
status: 200
body: Entitycurl http://localhost:3001/api/entities/<entity-id> \
-H "Authorization: Bearer <token>"endpoint: /api/entities/:id
method: PUT
auth: true
request:
body: # all fields optional (partial update)
legalName: string
entityType: string
stateOfIncorporation: string
ein: string
fiscalYearEnd: string
foreignSubsidiaries: string[]
country: string
response:
status: 200
body: Entitycurl -X PUT http://localhost:3001/api/entities/<entity-id> \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"legalName": "Acme Corp Updated"
}'endpoint: /api/entities/:id
method: DELETE
auth: true
description: Marks entity as dissolved (soft delete)
response:
status: 200
body:
message: stringcurl -X DELETE http://localhost:3001/api/entities/<entity-id> \
-H "Authorization: Bearer <token>"endpoint: /api/filings
method: GET
auth: true
query_params:
status: string # optional — filter by filing status
entityId: string # optional — filter by entity
year: number # optional — filter by tax year
response:
status: 200
body: Filing[]curl "http://localhost:3001/api/filings?status=intake&entityId=<id>&year=2025" \
-H "Authorization: Bearer <token>"endpoint: /api/filings
method: POST
auth: true
request:
body:
entityId: string # required
formType: string # required
formName: string # required
deadlineId: string # optional
taxYear: number # optional
response:
status: 201
body: Filing # status defaults to "intake"curl -X POST http://localhost:3001/api/filings \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"entityId": "<entity-id>",
"formType": "1120",
"formName": "U.S. Corporation Income Tax Return",
"taxYear": 2025
}'endpoint: /api/filings/:id
method: GET
auth: true
description: Returns filing with related conversations, documents, and approvals
response:
status: 200
body:
filing: Filing
conversations: AgentConversation[]
documents: Document[]
approvals: ApprovalQueue[]curl http://localhost:3001/api/filings/<filing-id> \
-H "Authorization: Bearer <token>"endpoint: /api/filings/:id/status
method: PUT
auth: true
description: |
Validates status transitions:
intake → ai_prep → cpa_review → founder_approval → submitted → archived
request:
body:
status: string # required — intake | ai_prep | cpa_review | founder_approval | submitted | archived
response:
status: 200
body:
message: stringcurl -X PUT http://localhost:3001/api/filings/<filing-id>/status \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"status": "ai_prep"}'endpoint: /api/filings/:id/approve
method: POST
auth: true
description: Founder approves and submits filing
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/filings/<filing-id>/approve \
-H "Authorization: Bearer <token>"endpoint: /api/filings/:id/reject
method: POST
auth: true
request:
body:
reason: string # required
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/filings/<filing-id>/reject \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"reason": "Numbers on line 12 look incorrect"}'endpoint: /api/filings/:id/pause
method: POST
auth: true
description: Pause the AI workflow
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/filings/<filing-id>/pause \
-H "Authorization: Bearer <token>"endpoint: /api/filings/:id/escalate-cpa
method: POST
auth: true
description: Escalate filing for CPA takeover
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/filings/<filing-id>/escalate-cpa \
-H "Authorization: Bearer <token>"endpoint: /api/deadlines
method: GET
auth: true
query_params:
entityId: string # optional
response:
status: 200
body: Deadline[]curl "http://localhost:3001/api/deadlines?entityId=<id>" \
-H "Authorization: Bearer <token>"endpoint: /api/deadlines/:id
method: GET
auth: true
response:
status: 200
body:
id: string
entityId: string
formType: string
formName: string
dueDate: string # ISO date
status: string # upcoming | overdue | filed | extended
aiPredicted: boolean
urgencyScore: number
description: string
createdAt: stringcurl http://localhost:3001/api/deadlines/<deadline-id> \
-H "Authorization: Bearer <token>"endpoint: /api/documents
method: GET
auth: true
query_params:
filingId: string # optional
reviewStatus: string # optional
response:
status: 200
body: Document[]curl "http://localhost:3001/api/documents?filingId=<id>" \
-H "Authorization: Bearer <token>"endpoint: /api/documents/upload
method: POST
auth: true
content_type: multipart/form-data
request:
form_data:
file: binary # required — max 25MB
filingId: string # optional
allowed_types:
- application/pdf
- image/png
- image/jpeg
- text/csv
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
response:
status: 201
body: Documentcurl -X POST http://localhost:3001/api/documents/upload \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/document.pdf" \
-F "filingId=<filing-id>"endpoint: /api/documents/:id
method: GET
auth: true
response:
status: 200
body: Documentcurl http://localhost:3001/api/documents/<document-id> \
-H "Authorization: Bearer <token>"endpoint: /api/documents/:id/review
method: PUT
auth: true
description: Mark document as human-reviewed
response:
status: 200
body:
message: stringcurl -X PUT http://localhost:3001/api/documents/<document-id>/review \
-H "Authorization: Bearer <token>"endpoint: /api/approvals
method: GET
auth: true
description: Returns approvals filtered by user role
response:
status: 200
body: ApprovalQueue[]curl http://localhost:3001/api/approvals \
-H "Authorization: Bearer <token>"endpoint: /api/approvals/:id/resolve
method: POST
auth: true
request:
body:
status: string # required — approved | rejected
reason: string # optional
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/approvals/<approval-id>/resolve \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"status": "approved"}'endpoint: /api/approvals/:id/escalate
method: POST
auth: true
description: Escalate approval item to CPA
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/approvals/<approval-id>/escalate \
-H "Authorization: Bearer <token>"endpoint: /api/audit
method: GET
auth: true
description: Organization-scoped, sorted descending by createdAt
query_params:
filingId: string # optional
actorType: string # optional — ai | cpa | founder | system
from: string # optional — ISO date
to: string # optional — ISO date
response:
status: 200
body:
- id: string
orgId: string
filingId: string
actorType: "ai | cpa | founder | system"
actorId: string
action: string
reasoning: string
inputs: object
outputs: object
modelVersion: string
confidenceScore: number
createdAt: stringcurl "http://localhost:3001/api/audit?filingId=<id>&actorType=ai&from=2025-01-01&to=2025-12-31" \
-H "Authorization: Bearer <token>"endpoint: /api/audit/export
method: GET
auth: true
query_params:
filingId: string # optional
response:
status: 200
content_type: text/csv
body: CSV file downloadcurl "http://localhost:3001/api/audit/export?filingId=<id>" \
-H "Authorization: Bearer <token>" \
-o audit_trail.csvendpoint: /api/agents/intake/start
method: POST
auth: true
request:
body:
filingId: string # required
response:
status: 200
body: object # initial agent resultcurl -X POST http://localhost:3001/api/agents/intake/start \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"filingId": "<filing-id>"}'endpoint: /api/agents/intake/message
method: POST
auth: true
description: Returns Server-Sent Events stream
request:
body:
filingId: string # required
message: string # required
response:
status: 200
content_type: text/event-stream
stream_format: |
data: {"text": "chunk..."}\n\n
data: [DONE]\n\ncurl -X POST http://localhost:3001/api/agents/intake/message \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"filingId": "<filing-id>", "message": "We have 2 W-2 employees"}' \
--no-bufferendpoint: /api/agents/deadline/run
method: POST
auth: true
request:
body:
entityId: string # required
response:
status: 200
body:
message: stringcurl -X POST http://localhost:3001/api/agents/deadline/run \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"entityId": "<entity-id>"}'endpoint: /api/agents/document/extract
method: POST
auth: true
request:
body:
documentId: string # required
response:
status: 200
body: object # extracted data resultcurl -X POST http://localhost:3001/api/agents/document/extract \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"documentId": "<document-id>"}'endpoint: /api/agents/prefill/run
method: POST
auth: true
request:
body:
filingId: string # required
response:
status: 200
body: object # prefilled form datacurl -X POST http://localhost:3001/api/agents/prefill/run \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"filingId": "<filing-id>"}'endpoint: /api/agents/audit-risk/run
method: POST
auth: true
request:
body:
filingId: string # required
response:
status: 200
body: object # risk assessment resultcurl -X POST http://localhost:3001/api/agents/audit-risk/run \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"filingId": "<filing-id>"}'endpoint: /api/agents/tax-qa/ask
method: POST
auth: true
description: Returns Server-Sent Events stream
request:
body:
question: string # required
response:
status: 200
content_type: text/event-stream
stream_format: |
data: {"text": "chunk..."}\n\n
data: [DONE]\n\ncurl -X POST http://localhost:3001/api/agents/tax-qa/ask \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"question": "When is Form 1120 due for a C-Corp with Dec fiscal year?"}' \
--no-buffererrors:
400:
description: Validation error (Zod)
body:
error: "Validation failed"
details:
- path: ["field"]
message: "error description"
401:
description: Missing or invalid JWT token
body:
error: "Unauthorized"
403:
description: Insufficient permissions or HITL gate
body:
error: "Forbidden"
404:
description: Resource not found
body:
error: "Not found"
500:
description: Internal server error
body:
error: "Internal server error"intake → ai_prep → cpa_review → founder_approval → submitted → archived
| Transition | Who Can Trigger |
|---|---|
intake → ai_prep |
System / AI |
ai_prep → cpa_review |
System / AI |
cpa_review → founder_approval |
CPA only |
founder_approval → submitted |
Founder (via approve) |
submitted → archived |
System |
roles:
founder: Full access, can approve/reject filings
team_member: Standard access
cpa: Can review filings, escalate, advance to founder_approval
admin: Full administrative access