API Reference
Realm9 provides a comprehensive REST API for programmatic access.
Authentication
All API requests require authentication:
curl -X GET https://realm9.app/api/environments \
-H "Authorization: Bearer YOUR_API_TOKEN"
Base URL
https://realm9.app/api
Endpoints
Environments
GET /api/environments- List environmentsPOST /api/environments- Create environmentGET /api/environments/[id]- Get environment detailsPUT /api/environments/[id]- Update environmentDELETE /api/environments/[id]- Delete environment
Bookings
GET /api/bookings- List bookingsPOST /api/bookings- Create bookingPUT /api/bookings/[id]/approve- Approve booking
Terraform
GET /api/terraform/projects- List projectsPOST /api/terraform/runs- Trigger a runGET /api/terraform/workspaces- List workspaces
Response Format
All responses are in JSON format:
{
"success": true,
"data": {...},
"error": null
}
Error Handling
HTTP Status Codes:
200- Success201- Created400- Bad Request401- Unauthorized403- Forbidden404- Not Found500- Server Error
Rate Limiting
API requests are rate limited:
- 1000 requests per hour per API token
- Headers indicate remaining quota
