REST API v3
Interact programmatically with the .git platform. Version 3 introduces improved webhook payloads, unified pagination, and stricter request validation for enhanced reliability.
Authentication
All API requests require authentication via a Bearer token in the Authorization header. Generate keys from your dashboard under Settings → API Access.
# 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
Retrieve a paginated list of all projects associated with your account.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results (1-100). Default: 20 |
cursor | string | Pagination token from X-Next-Cursor |
status | string | Filter: active, archived, building |
{
"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=" }
}Trigger a new deployment for a specified project. Returns a deployment object and queued status.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
project_id | string required | Unique project identifier |
Request Body
| Parameter | Type | Description |
|---|---|---|
branch | string | Target branch. Default: main |
environment | string | production, staging, preview |
commit_sha | string | Specific commit hash to deploy |
{
"environment": "production",
"branch": "main",
"auto_rollback": true
}Stream or fetch build/runtime logs for a specific deployment. Supports real-time SSE for active builds.
{
"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.