REST API v1 · Entwickler · API-Referenz

Flows-API-Referenz

Alle 3 Flows-Endpunkte der BotGG-REST-API v1: Scopes, Parameter, Felder, Fehler und sofort ausführbare Beispiele in curl, JavaScript und Python.

Entwicklerdokumentation
Auf dieser Seite

Endpunkte

Pfade sind relativ zu https://console.botgg.app/api/v1. Sende deinen API-Schlüssel als Authorization: Bearer botgg_…; IDs sind Strings.

Flows-Endpunkte
EndpunktScopeBeschreibung
GET/guilds/{guildId}/flowsflows:readList flows
GET/guilds/{guildId}/flows/runs/{executionId}flows:readGet a flow run
POST/guilds/{guildId}/flows/{workflowId}/runsflows:runRun a flow

Neben den unten genannten eigenen Fehlern kann jeder Endpunkt diese allgemeinen zurückgeben:

List flows

GET/guilds/{guildId}/flows

Scope: flows:read

Dieses Feature muss auf dem Server aktiviert sein: Flows

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
itemsarray of objectJa
items[].idintegerJa
items[].namestringJa
items[].descriptionstring | nullJa
items[].enabledbooleanJa
items[].triggerTypestring | nullJae.g. trigger.manual, trigger.webhook, trigger.discord.messageCreated
items[].runnablebooleanJaCan be run with POST …/runs (enabled + Manual or Webhook trigger)
items[].updatedAtstring | nullJa
Antwort · 200
{
  "items": [
    {
      "id": 98765,
      "name": "Example",
      "description": "example",
      "enabled": true,
      "triggerType": "example",
      "runnable": true,
      "updatedAt": "2026-10-07T12:00:00.000Z"
    }
  ]
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/flows" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/flows', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/flows",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Get a flow run

GET/guilds/{guildId}/flows/runs/{executionId}

Scope: flows:read

Status of a run (any run of this server’s flows); output is the last node’s output once it finished.

Dieses Feature muss auf dem Server aktiviert sein: Flows

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
executionIdPfadstringJa

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
executionIdintegerJa
workflowIdintegerJa
statusstringJarunning | success | error | stopped | cancelled
outputany | nullJaThe last node’s output (finished runs only)
errorstring | nullJa
startedAtstring | nullJa
finishedAtstring | nullJa
durationMsinteger | nullJa
Antwort · 200
{
  "executionId": 98765,
  "workflowId": 98765,
  "status": "example",
  "output": null,
  "error": "example",
  "startedAt": "2026-10-07T12:00:00.000Z",
  "finishedAt": "2026-10-07T12:00:00.000Z",
  "durationMs": 10
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/flows/runs/234567890123456789" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/flows/runs/234567890123456789', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/flows/runs/234567890123456789",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Run a flow

POST/guilds/{guildId}/flows/{workflowId}/runs

Scope: flows:runSensibelIdempotency-Key

Only enabled flows with a Manual or Webhook trigger. A Webhook flow runs as if its webhook URL was called with input as the JSON body. Counts toward the plan’s daily runs. 202 { executionId, status: "running" }, or with wait: true 200 with the final status and output (202 when it is still running after the timeout — poll GET …/flows/runs/{executionId}).

Dieses Feature muss auf dem Server aktiviert sein: Flows

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
workflowIdPfadstringJa
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
inputanyNeinTrigger data (any JSON): $trigger for Manual flows, $trigger.body for Webhook flows
waitbooleanNeinWait for the run to finish (default false → 202 right after it started)
timeoutSecondsintegerNeinLongest wait; default = the flow timeout + 5 s
1–120

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
executionIdintegerJa
workflowIdintegerJa
statusstringJarunning | success | error | stopped | cancelled
outputany | nullJaThe last node’s output (finished runs only)
errorstring | nullJa
startedAtstring | nullJa
finishedAtstring | nullJa
durationMsinteger | nullJa
Antwort · 202
{
  "executionId": 98765,
  "workflowId": 98765,
  "status": "example",
  "output": null,
  "error": "example",
  "startedAt": "2026-10-07T12:00:00.000Z",
  "finishedAt": "2026-10-07T12:00:00.000Z",
  "durationMs": 10
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/flows/234567890123456789/runs" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"input":null,"wait":true,"timeoutSeconds":3600}'
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/flows/234567890123456789/runs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(), // reuse it when you retry this request
  },
  body: JSON.stringify({
    input: null,
    wait: true,
    timeoutSeconds: 3600,
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os, uuid
import requests

res = requests.post(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/flows/234567890123456789/runs",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),  # reuse it when you retry this request
    },
    json={
        "input": None,
        "wait": True,
        "timeoutSeconds": 3600,
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Bereit, deinen Server aufs nächste Level zu bringen?

Füge BotGG kostenlos hinzu und aktiviere die Features dann in der Web-Konsole.