Esc
Tracklytic
AnleitungenAPI-ReferenzSDKsChangelogTracklytic öffnen

Event ändern

View as MarkdownThe page as plain text

Beschreibung, Tags, Schweregrad und weitere Event-Felder aktualisieren.

PATCH/v1/event/{eventId}

Authentifizierung: Benutzer-Access-JWT mit Projektzugriff.

Body

Mindestens eines dieser Felder: description, badge, logLevel, notify, tags, userId, status, actions, logs. badge: null entfernt den Badge. Normale Statuswerte: pending, active, completed, failed, cancelled.

Bei Pipeline-Events können status und Event-actions hier nicht geändert werden. Nutze dafür Step-Updates und Step-Actions. Projekt, Kanal und Eventname gehören nicht zum Update-Body.

Antwort

HTTP 200 liefert das aktualisierte Event; rechts ist nur ein Auszug dargestellt.

Request

curl -X PATCH 'https://api.tracklytic.de/v1/event/EVENT_ID' \
  -H "Authorization: Bearer $TRACKLYTIC_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "description": "Deployment überprüft",
  "badge": {
    "title": "Geprüft",
    "color": "success"
  }
}'
const response = await fetch("https://api.tracklytic.de/v1/event/EVENT_ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.TRACKLYTIC_ACCESS_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify(
    {
      "description": "Deployment überprüft",
      "badge": {
        "title": "Geprüft",
        "color": "success"
      }
    }
  )
});

if (!response.ok) throw new Error(await response.text());
const result = await response.json();
import json
import os
from urllib.request import Request, urlopen

payload = {
  "description": "Deployment überprüft",
  "badge": {
    "title": "Geprüft",
    "color": "success"
  }
}

request = Request(
    "https://api.tracklytic.de/v1/event/EVENT_ID",
    method="PATCH",
    headers={
        "Authorization": "Bearer " + os.environ["TRACKLYTIC_ACCESS_TOKEN"],
        "Content-Type": "application/json"
    },
    data=json.dumps(payload).encode("utf-8")
)

with urlopen(request) as response:
    result = json.load(response)

Response

200
{
  "id": "EVENT_ID",
  "description": "Deployment überprüft",
  "badge": {
    "title": "Geprüft",
    "color": "success"
  }
}