Overview
The Risk Legion API is a RESTful API built with FastAPI, providing comprehensive access to all platform features including BRA management, control assurance, governance, and administration.Base URLs
| Environment | Base URL |
|---|---|
| Production | https://api.risklegion.com |
| Staging | https://api-test.risklegion.com |
| Local Development | http://localhost:8000 |
/api/v1.
Authentication
All API endpoints (except/health) require authentication using JWT Bearer tokens.
Response Format
Success Responses
All successful responses follow this structure:Paginated Responses
List endpoints return paginated data:Error Responses
Error responses include:HTTP Status Codes
| Code | Meaning | When Used |
|---|---|---|
200 | OK | Successful GET, PATCH, DELETE |
201 | Created | Successful POST |
400 | Bad Request | Validation error, invalid input |
401 | Unauthorized | Missing or invalid token |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource doesn’t exist |
422 | Unprocessable Entity | Validation error (Pydantic) |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server error |
Pagination
Query Parameters
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
page | integer | 1 | - | Page number (1-indexed) |
page_size | integer | 25 | 100 | Items per page |
Example
Filtering
Most list endpoints support filtering:Rate Limiting
The API implements rate limiting to ensure fair usage:| Limit | Value |
|---|---|
| Requests per minute | 100 |
| Requests per hour | 1,000 |
API Versioning
The current API version isv1. The version is included in the URL path:
API Reference
Core Endpoints
BRA Management
Create, manage, and approve Business Risk Assessments
Control Assurance
Manage controls and assess effectiveness
Governance
Risk appetite, audit trails, and action plans
Admin Operations
Enterprise and user management
Quick Reference
| Resource | Endpoints |
|---|---|
| BRAs | GET, POST, PATCH /api/v1/bras |
| Scenarios | GET, POST /api/v1/bras/{id}/scenarios |
| Ratings | GET, POST /api/v1/bras/{id}/ratings |
| Controls | GET, POST, PATCH /api/v1/controls/* |
| Actions | GET, POST, PATCH /api/v1/mitigation-actions |
| Governance | GET, POST /api/v1/governance/* |
| Admin | GET, POST, PATCH /api/v1/admin/* |
Interactive Documentation
When running locally, access the interactive API documentation:| Tool | URL |
|---|---|
| Swagger UI | http://localhost:8000/docs |
| ReDoc | http://localhost:8000/redoc |
| OpenAPI JSON | http://localhost:8000/openapi.json |