Comp AI API v1

Welcome to the Comp AI API v1 reference documentation. This section provides detailed information about our REST API endpoints, including request parameters, response formats, and example code.

Authentication

Most API endpoints require authentication using an API key. You can manage your API keys in the Settings > API Keys section of the dashboard.

API keys can be passed in one of two ways:

  • In the Authorization header as a Bearer token: Authorization: Bearer {api_key}
  • In the X-API-Key header: X-API-Key: {api_key}

Base URL

All API endpoints are relative to:

https://app.trycomp.ai/api/v1

or, if you self-host:

https://app.yourdomain.com/v1/employees

Available Endpoints

The API provides access to the following resources:

  • Employees - Manage employees in your organization
  • Risks - Manage risks and their mitigations

Response Format

All API responses follow a consistent JSON format:

{
  "success": true | false,
  "data": {...} | null,       // Present on successful responses
  "error": "Error message",   // Present on error responses
  "details": {...}            // Optional detailed error information
}

Error Codes

Common error codes you might encounter:

Status CodeDescription
400Bad Request - Often due to missing or invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Valid API key but insufficient permissions
404Not Found - The requested resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Need Help?

If you have questions or need assistance with the API, please contact our support team at support@trycomp.ai or join our Discord community.