API referenceSections

Connect the site to a GitHub, GitLab, Gitea or Bitbucket branch; the webhook secret is returned once

Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication

PUT /api/v1/tenants/{tid}/sites/{id}/git

Connect the site to a GitHub, GitLab, Gitea or Bitbucket branch; the webhook secret is returned once

Authentication: session cookie __Host-panel_session (contract default; see Authentication).

Parameters

NameInTypeRequiredDescription
tidpathstringrequired
idpathstringrequired
X-CSRF-Tokenheaderstringoptional

Required on unsafe requests authenticated by session cookie; API keys do not use it.

Request body

required

Content type: application/json

object
  • url string required
  • branch string required
  • token string optional

    Read access; optional for public repositories

  • provider string optional

    gitlab or gitea for one on its own domain

    Allowed values: "" "github" "gitlab" "gitea"
Example
{
  "url": "string",
  "branch": "string",
  "token": "string",
  "provider": ""
}

Responses

200 Connected

Content type: application/json

GitConnection & object
  • provider string required
    Allowed values: "github" "gitlab" "gitea" "bitbucket"
  • url string required
  • branch string required
  • has_token boolean required
  • webhook_path string required
  • last_commit string required
  • last_state string required
    Allowed values: "" "succeeded" "failed"
  • last_error string required
  • last_at string (date-time) | null required
  • webhook_secret string required
Example
{
  "provider": "github",
  "url": "string",
  "branch": "string",
  "has_token": true,
  "webhook_path": "string",
  "last_commit": "string",
  "last_state": "",
  "last_error": "string",
  "last_at": "2026-01-01T00:00:00Z",
  "webhook_secret": "string"
}

default Error

Content type: application/json

  • code string required
  • message string required
  • details_redacted boolean required
  • correlation_id string required
  • retryable boolean required