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.

PlanRate Limit
Free100 requests/minute
Team500 requests/minute
Business2,000 requests/minute
EnterpriseCustom

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"
}
StatusMeaning
400Bad Request - invalid parameters
401Unauthorized - missing or invalid token
403Forbidden - insufficient permissions
404Not Found - resource does not exist
429Too Many Requests - rate limit exceeded
500Internal Server Error