REST API v3

Interact programmatically with the .git platform. Version 3 introduces improved webhook payloads, unified pagination, and stricter request validation for enhanced reliability.

Base URL: https://api.git.dev/v3
Content-Type: application/json
Auth: Bearer Token / API Key

Authentication

All API requests require authentication via a Bearer token in the Authorization header. Generate keys from your dashboard under Settings → API Access.

Example Request
# curl example
curl "https://api.git.dev/v3/projects" \n  -H "Authorization: Bearer GIT_API_KEY_HERE" \n  -H "Content-Type: application/json"

Never expose API keys in client-side code or public repositories. Use environment variables or secret managers.

Rate Limits

API requests are limited based on your plan tier. Exceeding limits returns 429 Too Many Requests with a Retry-After header.

{
  "x-ratelimit-limit": 1000,
  "x-ratelimit-remaining": 842,
  "x-ratelimit-reset": 1718892000
}

Core Endpoints

GET /projects

Retrieve a paginated list of all projects associated with your account.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100). Default: 20
cursorstringPagination token from X-Next-Cursor
statusstringFilter: active, archived, building
Response 200
{
  "projects": [
    {
      "id": "proj_8x2k9m1p",
      "name": "main-app",
      "status": "active",
      "created_at": "2025-01-14T09:22:00Z",
      "last_deploy": "2025-06-10T14:05:33Z"
    }
  ],
  "pagination": { "has_more": true, "next_cursor": "eyJpZCI6MTAyM30=" }
}
POST /projects/{project_id}/deployments

Trigger a new deployment for a specified project. Returns a deployment object and queued status.

Path Parameters

ParameterTypeDescription
project_idstring requiredUnique project identifier

Request Body

ParameterTypeDescription
branchstringTarget branch. Default: main
environmentstringproduction, staging, preview
commit_shastringSpecific commit hash to deploy
Request Example
{
  "environment": "production",
  "branch": "main",
  "auto_rollback": true
}
GET /deployments/{deployment_id}/logs

Stream or fetch build/runtime logs for a specific deployment. Supports real-time SSE for active builds.

Response 200
{
  "deployment_id": "dep_92a71x",
  "status": "running",
  "logs": [
    { "ts": "1718891200", "level": "info", "msg": "Installing dependencies..." },
    { "ts": "1718891204", "level": "info", "msg": "Build completed in 4.2s" }
  ],
  "sse_endpoint": "https://api.git.dev/v3/sse/logs/dep_92a71x"
}

Error Handling

.git uses standard HTTP status codes and returns structured JSON error objects.

{
  "error": {
    "code": "validation_failed",
    "message": "Invalid environment value: 'prod'. Use 'production' instead.",
    "details": { "field": "environment" },
    "request_id": "req_77x29m"
  }
}

Include the request_id when contacting support for faster debugging.