API Reference
The CodeDig REST API lets you programmatically analyze repositories, run PR gate checks, manage API keys, and retrieve usage data.
Getting Started
All API requests (except auth endpoints) require authentication. Include your token in the Authorization header:
Authorization: Bearer <your-jwt-token>
# or with an API key:
Authorization: Bearer aca_k1_xxxxx...The base URL for all endpoints is: https://api.codedig.ai
For CI/CD integrations, we recommend creating an API key rather than using a user JWT token.
Authentication
API Keys
PR Gate
Repositories
Usage & Billing
Webhooks
Rate Limits
API requests are rate limited per API key or authenticated user. When you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header.
| Plan | Rate Limit |
|---|---|
| Free | 100 requests/minute |
| Team | 500 requests/minute |
| Business | 2,000 requests/minute |
| Enterprise | Custom |
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Error Responses
The API uses standard HTTP status codes. Error responses include a JSON body:
{
"error": "Bad Request",
"message": "Missing required field: name"
}| Status | Meaning |
|---|---|
| 400 | Bad Request - invalid parameters |
| 401 | Unauthorized - missing or invalid token |
| 403 | Forbidden - insufficient permissions |
| 404 | Not Found - resource does not exist |
| 429 | Too Many Requests - rate limit exceeded |
| 500 | Internal Server Error |