Zum Hauptinhalt springenZenit-Hosting Logo
API-Referenz

Git

Git-Quellen und Deployments eines Servers.

GET /api/developer/v1/servers/{id}/git/deployments

Deployments auflisten

Der Verlauf der Deployments des Servers. Seitenweise Liste: limit (1 bis 100, Standard 25) und cursor. nextCursor ist null auf der letzten Seite, sonst der Wert für den nächsten Aufruf.

Rechte

  • git:read Git-Quellen lesen

Parameter

Parameter von GET /api/developer/v1/servers/{id}/git/deployments
NameOrtTypPflichtBeschreibung
idPfadstring (uuid)jaId des Servers.
limitQueryinteger (int32)neinEinträge je Seite, 1 bis 100. Standard 25. Ein Wert außerhalb ergibt 400 `VALIDATION_ERROR`.
cursorQuerystringneinWert von `nextCursor` der vorherigen Seite. Nicht ändern, nicht auswerten. Ein ungültiger Cursor ergibt 400 `VALIDATION_ERROR`.

Antworten

OK

application/json

SchemaDevGitDeploymentDtoPage
Felder der Antwort 200 OK von GET /api/developer/v1/servers/{id}/git/deployments
FeldTypPflichtBeschreibung
dataDevGitDeploymentDto[]ja
data[].idstring (uuid)ja
data[].sourceIdstring (uuid)ja
data[].kindstringja
data[].triggerstringja
data[].statusstringja
data[].phasestring | nullja
data[].branchstringja
data[].targetShastring | nullja
data[].deployedShastring | nullja
data[].commitMessagestring | nullja
data[].errorCodestring | nullja
data[].messagestring | nullja
data[].createdAtstring (date-time)ja
data[].startedAtstring (date-time) | nullja
data[].finishedAtstring (date-time) | nullja
nextCursorstring | nullja
{
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "sourceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "kind": "string",
      "trigger": "string",
      "status": "string",
      "phase": "string",
      "branch": "string",
      "targetSha": "string",
      "deployedSha": "string",
      "commitMessage": "string",
      "errorCode": "string",
      "message": "string",
      "createdAt": "2026-10-05T12:00:00Z",
      "startedAt": "2026-10-05T12:00:00Z",
      "finishedAt": "2026-10-05T12:00:00Z"
    }
  ],
  "nextCursor": "string"
}

Codebeispiele

curl "https://api.zenit-hosting.de/api/developer/v1/servers/<id>/git/deployments" \
  -H "Authorization: Bearer $ZENIT_TOKEN"

GET /api/developer/v1/servers/{id}/git/deployments/{deploymentId}

Deployment lesen

Ein Deployment mit Status, Phase und Fehlermeldung.

Rechte

  • git:read Git-Quellen lesen

Parameter

Parameter von GET /api/developer/v1/servers/{id}/git/deployments/{deploymentId}
NameOrtTypPflichtBeschreibung
idPfadstring (uuid)jaId des Servers.
deploymentIdPfadstring (uuid)jaId des Deployments.

Antworten

OK

application/json

SchemaDevGitDeploymentDto
Felder der Antwort 200 OK von GET /api/developer/v1/servers/{id}/git/deployments/{deploymentId}
FeldTypPflichtBeschreibung
idstring (uuid)ja
sourceIdstring (uuid)ja
kindstringja
triggerstringja
statusstringja
phasestring | nullja
branchstringja
targetShastring | nullja
deployedShastring | nullja
commitMessagestring | nullja
errorCodestring | nullja
messagestring | nullja
createdAtstring (date-time)ja
startedAtstring (date-time) | nullja
finishedAtstring (date-time) | nullja
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "sourceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "string",
  "trigger": "string",
  "status": "string",
  "phase": "string",
  "branch": "string",
  "targetSha": "string",
  "deployedSha": "string",
  "commitMessage": "string",
  "errorCode": "string",
  "message": "string",
  "createdAt": "2026-10-05T12:00:00Z",
  "startedAt": "2026-10-05T12:00:00Z",
  "finishedAt": "2026-10-05T12:00:00Z"
}

Codebeispiele

curl "https://api.zenit-hosting.de/api/developer/v1/servers/<id>/git/deployments/<deploymentId>" \
  -H "Authorization: Bearer $ZENIT_TOKEN"

GET /api/developer/v1/servers/{id}/git/sources

Git-Quellen auflisten

Die Git-Quellen des Servers ohne Zugangsdaten, Webhook-Secrets oder Deploy-Keys.

Rechte

  • git:read Git-Quellen lesen

Parameter

Parameter von GET /api/developer/v1/servers/{id}/git/sources
NameOrtTypPflichtBeschreibung
idPfadstring (uuid)jaId des Servers.

Antworten

OK

application/json

SchemaDevGitSourceDto[]
Felder der Antwort 200 OK von GET /api/developer/v1/servers/{id}/git/sources
FeldTypPflichtBeschreibung
[].idstring (uuid)ja
[].namestringja
[].providerstringja
[].repositorystringja
[].repositoryUrlstring | nullja
[].branchstringja
[].targetDirectorystringja
[].autoDeploybooleanja
[].statusstringja
[].lastDeploymentDevGitDeploymentDto | nullja
[].lastDeployment.idstring (uuid)ja
[].lastDeployment.sourceIdstring (uuid)ja
[].lastDeployment.kindstringja
[].lastDeployment.triggerstringja
[].lastDeployment.statusstringja
[].lastDeployment.phasestring | nullja
[].lastDeployment.branchstringja
[].lastDeployment.targetShastring | nullja
[].lastDeployment.deployedShastring | nullja
[].lastDeployment.commitMessagestring | nullja
[].lastDeployment.errorCodestring | nullja
[].lastDeployment.messagestring | nullja
[].lastDeployment.createdAtstring (date-time)ja
[].lastDeployment.startedAtstring (date-time) | nullja
[].lastDeployment.finishedAtstring (date-time) | nullja
[].createdAtstring (date-time)ja
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "string",
    "provider": "string",
    "repository": "string",
    "repositoryUrl": "string",
    "branch": "string",
    "targetDirectory": "string",
    "autoDeploy": true,
    "status": "string",
    "lastDeployment": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "sourceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "kind": "string",
      "trigger": "string",
      "status": "string",
      "phase": "string",
      "branch": "string",
      "targetSha": "string",
      "deployedSha": "string",
      "commitMessage": "string",
      "errorCode": "string",
      "message": "string",
      "createdAt": "2026-10-05T12:00:00Z",
      "startedAt": "2026-10-05T12:00:00Z",
      "finishedAt": "2026-10-05T12:00:00Z"
    },
    "createdAt": "2026-10-05T12:00:00Z"
  }
]

Codebeispiele

curl "https://api.zenit-hosting.de/api/developer/v1/servers/<id>/git/sources" \
  -H "Authorization: Bearer $ZENIT_TOKEN"

POST /api/developer/v1/servers/{id}/git/sources/{sourceId}/deploy

Deployment auslösen

Reiht ein Deployment mit dem Auslöser api ein (202). Ohne sha wird der Kopf des Branches ausgerollt. Wie ein Deploy aus CI oder per Push wartet es auf das Deploy-Zeitfenster der Quelle: die Antwort bleibt 202, der Lauf startet dann erst mit Beginn des Fensters. Erreicht die Quelle ihren Stundendeckel, kommt 429 RATE_LIMITED mit Retry-After.

Rechte

  • git:deploy Git-Deploy auslösen

Parameter

Parameter von POST /api/developer/v1/servers/{id}/git/sources/{sourceId}/deploy
NameOrtTypPflichtBeschreibung
idPfadstring (uuid)jaId des Servers.
sourceIdPfadstring (uuid)jaId der Git-Quelle.
Idempotency-KeyHeaderstringneinEmpfohlen für jeden POST. 1 bis 128 sichtbare ASCII-Zeichen ohne Leerzeichen. Derselbe Schlüssel mit derselben Anfrage liefert innerhalb von 24 Stunden die gespeicherte Antwort (Header `Idempotency-Replayed: true`), mit einer anderen Anfrage 422, solange die erste läuft 409.

Request-Body

application/json

SchemaDevGitDeployRequest
Felder des Request-Bodys von POST /api/developer/v1/servers/{id}/git/sources/{sourceId}/deploy
FeldTypPflichtBeschreibung
shastring | nullnein
{
  "sha": "string"
}

Antworten

Accepted

application/json

SchemaDevGitDeployAcceptedDto
Felder der Antwort 202 Accepted von POST /api/developer/v1/servers/{id}/git/sources/{sourceId}/deploy
FeldTypPflichtBeschreibung
deploymentIdstring (uuid)ja
statusstringja
{
  "deploymentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "string"
}

Codebeispiele

curl -X POST "https://api.zenit-hosting.de/api/developer/v1/servers/<id>/git/sources/<sourceId>/deploy" \
  -H "Authorization: Bearer $ZENIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "sha": "string"
}'

Bereich Git geladen, 4 Endpunkte.