API|~4 min read

5. REST API Reference & Integration

Complete OpenAPI endpoint catalog, authentication headers, request/response schemas, error codes, and webhooks.

01

API Authentication & Envelopes

Dual credential headers, JSON response envelope contracts, and HTTP status code matrices.

Authentication Headers

All REST API endpoints require standard Bearer token authorization:

http
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json

Response Envelope Contract

Standard responses follow the unified envelope:

json
{
  "success": true,
  "data": {
    "id": "dc71920c-14e2-4bf0-ab7c-211818f3206a",
    "status": "COMPLETED",
    "version": 1
  },
  "message": "Analysis retrieved successfully"
}
02

Core Endpoints Reference

Interactive request and response examples for Analyses, Projects, Formats, and Health Probes.

Endpoints Catalog

1. Create Analysis Job — POST /api/analyze

Creates an asynchronous requirements generation task.

curl -X POST https://sra-backend.onrender.com/api/analyze \
  -H "Authorization: Bearer $AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inputText": "Design an automated incident response platform...",
    "projectTitle": "OpsBridge",
    "format": "ieee830"
  }'

2. Live SSE Progress Stream — GET /api/analyze/:id/stream

Subscribes to real-time Server-Sent Events (SSE) for a running analysis job:

http
GET /api/analyze/dc71920c-14e2-4bf0-ab7c-211818f3206a/stream
Accept: text/event-stream

Event Stream Payloads:

text
event: progress
data: {"stage":"MULTI_AGENT_ANALYSIS","percent":40,"message":"Architect Agent designing schema..."}

event: complete
data: {"status":"COMPLETED","analysisId":"dc71920c-14e2-4bf0-ab7c-211818f3206a"}

3. Deep Health Probe — GET /api/health

Returns comprehensive health status of database connectivity, Redis cache, and embedding keys:

json
{
  "status": "healthy",
  "timestamp": "2026-08-30T12:00:00.000Z",
  "database": { "status": "connected", "latencyMs": 4 },
  "redis": { "status": "connected" },
  "embeddings": { "configured": true }
}
Was this page helpful?

Help us improve the SRA enterprise documentation.