Rela AIRela AI Docs
API Reference

API Reference — Overview

Base URL, JWT authentication, rate limits per plan, error format, status codes, and versioning.

Base URL

All requests are directed to:

https://api.relaai.com/api/v1/

Internal requests between microservices use:

http://internal-api:8000/api/v1/

Authentication

The API uses JSON Web Tokens (JWT) issued upon login. Include the token in the Authorization header:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
JWT FieldDescription
subUser ID
tenant_idTenant ID
roleUser role
permissionsPermission list
expExpiration (15 minutes by default)

Tokens are refreshed via POST /api/v1/auth/refresh with the refresh token.

Rate Limits per Plan

PlanRequests/minMax burst
Free3010
Starter12030
Professional600100
Enterprise3,000500

Response headers included in every request:

  • X-RateLimit-Limit — Total window limit
  • X-RateLimit-Remaining — Remaining requests
  • X-RateLimit-Reset — Reset timestamp (Unix epoch)

Error Format

All errors follow a consistent format:

{
  "detail": "Resource not found",
  "error_code": "NOT_FOUND",
  "request_id": "req_abc123"
}

Status Codes

CodeMeaning
200Successful operation
201Resource created
204Deleted, no content
400Invalid request
401Not authenticated
403No permissions or plan limit reached
404Resource not found
409Conflict (duplicate)
422Validation error
429Rate limit exceeded
500Internal server error

Pagination

List endpoints support pagination with skip and limit:

GET /api/v1/agents?skip=0&limit=20

The response includes pagination metadata in the body.

Versioning

The current version is v1. When a new version becomes available, deprecation headers will indicate the migration path:

Deprecation: true
Sunset: Sat, 01 Jan 2027 00:00:00 GMT
Link: </api/v2/resource>; rel="successor-version"

Internal Endpoints

Some endpoints are reserved for inter-service communication:

EndpointUsage
POST /internal/eventsInternal event ingestion
POST /internal/notificationsNotification queue
GET /internal/healthService health check

These endpoints require an internal service token and are not exposed in the public API.

On this page