.git API Reference
Welcome to the .git REST API. This documentation covers all endpoints for managing projects, deployments, environments, and integrations. All requests must be made over HTTPS. Calls made over plain HTTP will fail.
https://api.git.dev/v1
Authentication
The .git API uses API keys for authentication. All API keys must be included in the request header as a Bearer token.
Authorization: Bearer gl_api_your_personal_access_token
Keep your API keys secure. Never expose them in client-side code or public repositories. Generate keys from your .git dashboard under Settings → API Keys.
Projects
Projects represent your code repositories connected to .git.
List all projects
Returns a paginated list of all projects accessible to the authenticated API key.
| Parameter | Type | Description |
|---|---|---|
| page optional | integer | Page number for pagination |
| per_page optional | integer | Number of results per page (default: 20, max: 100) |
{
"data": [
{
"id": "proj_8f2a9c",
"name": "main-app",
"framework": "nextjs",
"created_at": "2025-09-12T14:20:00Z"
}
],
"meta": {
"total": 42,
"page": 1
}
}
Deployments
Deployments are triggered when code is pushed or manually via the API.
Trigger a deployment
Creates a new deployment for the specified project and environment.
| Parameter | Type | Description |
|---|---|---|
| branch required | string | Git branch to deploy |
| environment required | string | Target environment: production, staging, preview |
| commit_hash optional | string | Specific commit to deploy (defaults to HEAD) |
| env_vars optional | object | Runtime environment variables override |
{
"branch": "main",
"environment": "production",
"env_vars": {
"NEXT_PUBLIC_API_URL": "https://api.example.com"
}
}
{
"id": "dep_9x2k4m",
"status": "queued",
"url": "https://api.git.dev/v1/deployments/dep_9x2k4m",
"started_at": "2025-10-04T09:12:33Z"
}
Error Handling
The .git API uses standard HTTP status codes to indicate success or failure of a request. Codes in the 2xx range indicate success, while 4xx indicate client errors and 5xx indicate server errors.
| Code | Meaning | Description |
|---|---|---|
| 400 | Bad Request | The request is missing or has invalid parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | API key lacks required permissions |
| 404 | Not Found | The requested resource does not exist |
| 429 | Rate Limit Exceeded | Too many requests. Retry after 10s |
| 500 | Internal Server Error | Something went wrong on our end |
{
"error": {
"code": 422,
"message": "Validation failed",
"details": [
{
"field": "environment",
"message": "Must be one of: production, staging, preview"
}
]
}
}
Rate Limits
API requests are rate-limited based on your plan:
- Free: 60 requests per minute
- Pro: 600 requests per minute
- Enterprise: Custom limits (contact sales)
Rate limit headers are included in every response:
X-RateLimit-Limit: 600 X-RateLimit-Remaining: 582 X-RateLimit-Reset: 1727184540