Skip to content

API Reference Overview

Squad exposes a REST API with automatic OpenAPI documentation. All responses are JSON. Real-time updates are delivered via Server-Sent Events (SSE).

Base URL

Your API base URL is provided during onboarding (e.g., https://yourorg.squadai.uk).

Interactive API documentation is available at:

  • Swagger UI: {base_url}/docs
  • ReDoc: {base_url}/redoc
  • OpenAPI JSON: {base_url}/openapi.json

Authentication

All endpoints require JWT authentication unless explicitly whitelisted. Squad integrates with your identity provider via OAuth2/OIDC.

Public Routes (No Auth Required)

EndpointPurpose
GET /healthLiveness check
GET /health/readyReadiness check
GET /auth/configOAuth bootstrap configuration
GET /docsSwagger UI
GET /redocReDoc documentation
GET /openapi.jsonOpenAPI specification

Authenticated Requests

Include the JWT token in the Authorization header:

Authorization: Bearer <your-jwt-token>

Tokens are obtained through your identity provider’s OAuth2 flow. The Squad frontend handles this automatically.

Endpoint Groups

Health

MethodEndpointDescription
GET/healthLiveness probe
GET/health/readyReadiness probe with component checks

Chat

MethodEndpointDescription
POST/api/v1/chatCreate a new chat session (rate limited: 60/min)
POST/api/v1/chat/{session_id}/messageSend a message (rate limited: 30/min)
GET/api/v1/chat/{session_id}/streamSSE event stream for real-time progress
GET/api/v1/chat/{session_id}/eventsHistorical event trace
GET/api/v1/chat/{session_id}/statusSession status
POST/api/v1/chat/{session_id}/disambiguateSend disambiguation response
POST/api/v1/chat/{session_id}/reviewSubmit review response
GET/api/v1/chat/{session_id}/historyGet session message history
GET/api/v1/chat/historyList all chat sessions

Query Curation

MethodEndpointDescription
GET/api/v1/aim/queries/statsQuery count breakdown by status
GET/api/v1/aim/queries/pendingList pending approval queries
GET/api/v1/aim/queries/approvedList approved templates
POST/api/v1/aim/queries/test-cypherExecute read-only query for testing
POST/api/v1/aim/queries/{id}/approveApprove a pending query
POST/api/v1/aim/queries/{id}/rejectReject a pending query
POST/api/v1/aim/queries/{id}/amendAmend and approve a query
DELETE/api/v1/aim/queries/{id}Delete a query

Review

MethodEndpointDescription
GET/api/v1/review/{session_id}/pendingGet pending reviews for a session
POST/api/v1/review/{session_id}/approveApprove a review item
POST/api/v1/review/{session_id}/rejectReject a review item
GET/api/v1/review/historyFull review history
GET/api/v1/review/{session_id}/memoriesSession memories

Workflows

MethodEndpointDescription
GET/api/v1/aim/workflowsList available workflows
POST/api/v1/aim/workflows/executeExecute a workflow

Documents

MethodEndpointDescription
POST/api/v1/documents/uploadUpload files for ingestion
GET/api/v1/documents/List all documents
GET/api/v1/documents/ingestion-statusIngestion status
GET/api/v1/documents/graphKnowledge graph entries
GET/api/v1/documents/{doc_id}/previewPreview a document
GET/api/v1/documents/{doc_id}/downloadDownload original file
PATCH/api/v1/documents/{doc_id}/statusUpdate document status
POST/api/v1/documents/{doc_id}/approveApprove for ingestion
POST/api/v1/documents/{doc_id}/ingestTrigger ingestion
DELETE/api/v1/documents/{doc_id}Delete a document

Tools

MethodEndpointDescription
GET/api/v1/aim/toolsList registered tools
GET/api/v1/aim/tools/{tool_name}/workflowsWorkflows using a tool

Runs & Files

MethodEndpointDescription
GET/api/v1/runs/{run_id}/filesList files for a run
GET/api/v1/runs/{run_id}/preview/{path}Preview a run artifact
GET/api/v1/runs/{run_id}/download/{path}Download a run artifact

Error Codes

CodeMeaning
400Invalid input: check request body
401Unauthorized: missing or invalid JWT
403Forbidden: insufficient role or permissions
404Resource not found
429Rate limited (session creation: 60/min, messages: 30/min)
500Server error
503Service unavailable

SSE Event Format

The chat stream endpoint delivers events as newline-delimited JSON:

{"timestamp": "2026-03-17T10:30:00Z", "event": "step_started", "data": {"node": "classify", "run_id": "abc-123"}}
{"timestamp": "2026-03-17T10:30:01Z", "event": "step_completed", "data": {"node": "classify", "query_type": "FACTUAL"}}
{"timestamp": "2026-03-17T10:30:02Z", "event": "tool_executed", "data": {"tool_name": "retriever", "success": true}}

Next Steps