Realm9 Logo
Search documentation...

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 environments
  • POST /api/environments - Create environment
  • GET /api/environments/[id] - Get environment details
  • PUT /api/environments/[id] - Update environment
  • DELETE /api/environments/[id] - Delete environment

Bookings

  • GET /api/bookings - List bookings
  • POST /api/bookings - Create booking
  • PUT /api/bookings/[id]/approve - Approve booking

Terraform

  • GET /api/terraform/projects - List projects
  • POST /api/terraform/runs - Trigger a run
  • GET /api/terraform/workspaces - List workspaces

Response Format

All responses are in JSON format:

{
  "success": true,
  "data": {...},
  "error": null
}

Error Handling

HTTP Status Codes:

  • 200 - Success
  • 201 - Created
  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 500 - Server Error

Rate Limiting

API requests are rate limited:

  • 1000 requests per hour per API token
  • Headers indicate remaining quota

Next Steps