SDKs & API Reference
Integrate .git into your workflow programmatically. Full control over deployments, repositories, CI/CD pipelines, and edge infrastructure.
Overview #
The .git API follows RESTful conventions and uses standard HTTP response codes, authentication, and verbs. All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
https://api.git.dev/v2. All endpoints are versioned to ensure backward compatibility.Authentication #
.git uses API keys to authenticate requests. Generate your keys from the Dashboard under Settings → API Keys. Never expose your secret key in client-side code.
Authorization: Bearer gpk_live_4f3a2b1c9d8e7f6g5h4i3j2k1l0m
Key Types
Public Keys (gpk_) identify your organization. Secret Keys (gsk_) authenticate requests. Scope your keys to specific projects using the dashboard.
Official SDKs #
Install and use our officially maintained SDKs. All SDKs share a consistent interface and automatic retry logic.
npm install @git/sdk
import { GitClient } from '@git/sdk';
const git = new GitClient({ apiKey: process.env.GIT_API_KEY });
const deployment = await git.deployments.create({
project: 'my-app',
branch: 'main',
env: { NODE_ENV: 'production' }
});
console.log(deployment.url); // https://my-app.git.dev
pip install git-sdk
import git_sdk
client = git_sdk.Client(api_key=os.getenv("GIT_API_KEY"))
deployment = client.deployments.create(
project="my-app",
branch="main",
env={"NODE_ENV": "production"}
)
print(deployment.url)
go get git.dev/sdk-go/v2
import "git.dev/sdk-go/v2"
client := git.New(os.Getenv("GIT_API_KEY"))
dep, err := client.Deployments.Create(context.Background(), &git.DeployRequest{
Project: "my-app",
Branch: "main",
})
if err != nil { log.Fatal(err) }
fmt.Println(dep.URL)
gem install git-sdk
require 'git_sdk'
client = GitSDK::Client.new(api_key: ENV['GIT_API_KEY'])
dep = client.deployments.create(
project: 'my-app',
branch: 'main'
)
puts dep.url
API Endpoints #
Webhooks #
Configure webhooks to receive real-time events about deployments, build status, and security alerts. All payloads are signed using HMAC-SHA256.
{
"id": "evt_8x9y7z6w5v4u",
"type": "deployment.completed",
"timestamp": 1718942301,
"data": {
"project": "my-app",
"status": "live",
"url": "https://my-app.git.dev",
"duration_ms": 2400
}
}
X-Git-Signature header before processing webhook requests to prevent spoofing.Rate Limits #
API requests are limited based on your plan. Headers include X-RateLimit-Remaining and X-RateLimit-Reset.
Rate Limits #
API requests are limited based on your plan. Headers include X-RateLimit-Remaining and X-RateLimit-Reset.
| Plan | Requests / min | Burst |
|---|---|---|
| Starter | 60 | 10 |
| Pro | 600 | 50 |
| Enterprise | 6,000 | 200 |
Changelog #
- v2.4.1 Added WebSocket support for log streaming. Fixed env-var encoding issue.
- v2.4.0 New deployment preview endpoints. SDK retry logic improvements.
- v2.3.2 Security patch for webhook signature verification.