.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.

Base URL: 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.

HTTP Header
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.

GET /v1/projects

List all projects

Returns a paginated list of all projects accessible to the authenticated API key.

ParameterTypeDescription
page optionalintegerPage number for pagination
per_page optionalintegerNumber of results per page (default: 20, max: 100)
Response 200
{
  "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.

POST /v1/projects/{project_id}/deployments

Trigger a deployment

Creates a new deployment for the specified project and environment.

ParameterTypeDescription
branch requiredstringGit branch to deploy
environment requiredstringTarget environment: production, staging, preview
commit_hash optionalstringSpecific commit to deploy (defaults to HEAD)
env_vars optionalobjectRuntime environment variables override
Request Body
{
  "branch": "main",
  "environment": "production",
  "env_vars": {
    "NEXT_PUBLIC_API_URL": "https://api.example.com"
  }
}
Response 202
{
  "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.

CodeMeaningDescription
400Bad RequestThe request is missing or has invalid parameters
401UnauthorizedInvalid or missing API key
403ForbiddenAPI key lacks required permissions
404Not FoundThe requested resource does not exist
429Rate Limit ExceededToo many requests. Retry after 10s
500Internal Server ErrorSomething went wrong on our end
Error Response
{
  "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:

Headers
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 582
X-RateLimit-Reset: 1727184540