Skip to main content
Connect a Git repository to a pod for automatic or manual deployments. Supports GitHub (with webhooks and commit status checks) and any Git URL via HTTPS.

Get Git Config

GET /api/pods/{name}/git
Response: 200 OK
{
  "repo_url": "https://github.com/you/repo",
  "branch": "main",
  "auto_deploy": true,
  "build_command": "",
  "last_deployment": {
    "id": "deploy_abc123",
    "status": "success",
    "commit_sha": "a1b2c3d",
    "commit_message": "fix: update error handling",
    "created_at": "2026-02-20T10:30:00Z",
    "finished_at": "2026-02-20T10:30:18Z"
  },
  "created_at": "2026-02-20T09:00:00Z"
}
Returns null if no repository is connected.

Connect a Repository

POST /api/pods/{name}/git
Request Body:
{
  "repo_url": "https://github.com/you/repo",
  "branch": "main",
  "auth_token": "ghp_optional_for_private_repos",
  "build_command": "",
  "auto_deploy": true
}
FieldTypeRequiredDescription
repo_urlstringYesGit repository URL (HTTPS)
branchstringNoBranch to deploy (default: main)
auth_tokenstringNoPersonal access token for private repos
build_commandstringNoCustom build command (overrides auto-detection)
auto_deploybooleanNoDeploy on push (default: true)
Response: 201 Created Returns the git config object. Errors:
CodeReason
400Invalid URL, pod not running
409Repository already connected

Update Settings

PUT /api/pods/{name}/git
Request Body:
{
  "branch": "develop",
  "build_command": "npm ci && npm run build",
  "auto_deploy": false
}
All fields are optional. Only provided fields are updated. Response: 200 OK

Disconnect

DELETE /api/pods/{name}/git
Response: 200 OK
{
  "status": "disconnected"
}

Trigger Deploy

POST /api/pods/{name}/git/deploy
No request body required. Pulls the latest code from the configured branch and deploys. Response: 202 Accepted
{
  "id": "deploy_xyz789",
  "status": "deploying",
  "created_at": "2026-02-20T11:00:00Z"
}
Deployment runs asynchronously. Poll the deployment detail endpoint to check status.

List Deployments

GET /api/pods/{name}/git/deployments
Query ParamTypeDefaultDescription
limitint10Max deployments to return
Response: 200 OK
{
  "deployments": [
    {
      "id": "deploy_abc123",
      "status": "success",
      "commit_sha": "a1b2c3d",
      "commit_message": "fix: update error handling",
      "trigger": "push",
      "created_at": "2026-02-20T10:30:00Z",
      "finished_at": "2026-02-20T10:30:18Z"
    }
  ]
}
Deployment statuses: deploying, success, failed, rolled_back Trigger types: push (webhook), manual, rollback

Get Deployment Detail

GET /api/pods/{name}/git/deployments/{id}
Response: 200 OK Returns a single deployment object with a build_log field containing the full build output:
{
  "id": "deploy_abc123",
  "status": "success",
  "commit_sha": "a1b2c3d",
  "commit_message": "fix: update error handling",
  "trigger": "push",
  "build_log": "Pulling latest code...\nnpm install...\nnpm run build...\nRestarting service...\nDeploy complete.",
  "created_at": "2026-02-20T10:30:00Z",
  "finished_at": "2026-02-20T10:30:18Z"
}

Rollback

POST /api/pods/{name}/git/rollback
Request Body:
{
  "deployment_id": "deploy_abc123"
}
FieldTypeRequiredDescription
deployment_idstringNoTarget deployment ID (defaults to previous deployment)
Response: 202 Accepted Returns a new deployment object with trigger: "rollback".

Webhooks

These endpoints are public (no auth required). They receive push events from Git providers.
POST /api/webhooks/github
POST /api/webhooks/git/{podName}
The GitHub webhook is configured automatically when connecting a GitHub repository. For other providers, use the generic webhook URL shown in the dashboard. Commits containing [skip deploy] in the message are ignored.