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}/gitConnect 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tid | path | string | required | |
id | path | string | required | |
X-CSRF-Token | header | string | optional | Required on unsafe requests authenticated by session cookie; API keys do not use it. |
Request body
required
Content type: application/json
object
urlstring requiredbranchstring requiredtokenstring optionalRead access; optional for public repositories
providerstring optionalgitlab 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
providerstring requiredAllowed values:"github""gitlab""gitea""bitbucket"urlstring requiredbranchstring requiredhas_tokenboolean requiredwebhook_pathstring requiredlast_commitstring requiredlast_statestring requiredAllowed values:"""succeeded""failed"last_errorstring requiredlast_atstring (date-time) | null requiredwebhook_secretstring 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
codestring requiredmessagestring requireddetails_redactedboolean requiredcorrelation_idstring requiredretryableboolean required