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.
| Endpunkt | Scope | Beschreibung |
|---|---|---|
GET/guilds/{guildId}/flows | flows:read | List flows |
GET/guilds/{guildId}/flows/runs/{executionId} | flows:read | Get a flow run |
POST/guilds/{guildId}/flows/{workflowId}/runs | flows:run | Run a flow |
Neben den unten genannten eigenen Fehlern kann jeder Endpunkt diese allgemeinen zurückgeben:
List flows
GET/guilds/{guildId}/flows
Dieses Feature muss auf dem Server aktiviert sein: Flows
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
items | array of object | Ja | |
items[].id | integer | Ja | |
items[].name | string | Ja | |
items[].description | string | null | Ja | |
items[].enabled | boolean | Ja | |
items[].triggerType | string | null | Ja | e.g. trigger.manual, trigger.webhook, trigger.discord.messageCreated |
items[].runnable | boolean | Ja | Can be run with POST …/runs (enabled + Manual or Webhook trigger) |
items[].updatedAt | string | null | Ja |
{
"items": [
{
"id": 98765,
"name": "Example",
"description": "example",
"enabled": true,
"triggerType": "example",
"runnable": true,
"updatedAt": "2026-10-07T12:00:00.000Z"
}
]
}Beispiele
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/flows" \
-H "Authorization: Bearer $BOTGG_API_KEY"// 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);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
| HTTP | Codes |
|---|---|
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Get a flow run
GET/guilds/{guildId}/flows/runs/{executionId}
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
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
executionId | Pfad | string | Ja |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
executionId | integer | Ja | |
workflowId | integer | Ja | |
status | string | Ja | running | success | error | stopped | cancelled |
output | any | null | Ja | The last node’s output (finished runs only) |
error | string | null | Ja | |
startedAt | string | null | Ja | |
finishedAt | string | null | Ja | |
durationMs | integer | null | Ja |
{
"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 -s "https://console.botgg.app/api/v1/guilds/123456789012345678/flows/runs/234567890123456789" \
-H "Authorization: Bearer $BOTGG_API_KEY"// 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);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
| HTTP | Codes |
|---|---|
| 404 | FLOW_EXECUTION_NOT_FOUND |
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Run a flow
POST/guilds/{guildId}/flows/{workflowId}/runs
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
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
workflowId | Pfad | string | Ja | |
Idempotency-Key | Header | string | Nein | Optional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s |
Request-Body
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
input | any | Nein | Trigger data (any JSON): $trigger for Manual flows, $trigger.body for Webhook flows |
wait | boolean | Nein | Wait for the run to finish (default false → 202 right after it started) |
timeoutSeconds | integer | Nein | Longest wait; default = the flow timeout + 5 s 1–120 |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
executionId | integer | Ja | |
workflowId | integer | Ja | |
status | string | Ja | running | success | error | stopped | cancelled |
output | any | null | Ja | The last node’s output (finished runs only) |
error | string | null | Ja | |
startedAt | string | null | Ja | |
finishedAt | string | null | Ja | |
durationMs | integer | null | Ja |
{
"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 -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}'// 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);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
| HTTP | Codes |
|---|---|
| 400 | INVALID_JSON |
| 402 | PLAN_LIMIT |
| 404 | FLOW_NOT_FOUND |
| 409 | FEATURE_DISABLED, FLOW_NOT_RUNNABLE, FLOW_DISABLED |
| 413 | PAYLOAD_TOO_LARGE |
| 415 | UNSUPPORTED_MEDIA_TYPE |
| 422 | IDEMPOTENCY_KEY_REUSED |
| 503 | SERVICE_UNAVAILABLE |