APIs

REST recipes

These assume SIRIUS=http://localhost:8080 and a $TOK bearer on a secured deployment. Add -H "Authorization: Bearer $TOK" to each call. On an open local stack you can omit it.

Sign in and list integrations

ACCESS=$(curl -s -X POST "$SIRIUS/auth/login" \
  -H 'content-type: application/json' \
  -d '{"tenant_id":"default","username":"admin","password":"password"}' \
  | jq -r .access_token)

curl -s "$SIRIUS/components?tenant_id=default" \
  -H "Authorization: Bearer $ACCESS" \
  | jq '.[] | {id, name, state}'

Mint a token for CI

curl -s -X POST "$SIRIUS/api-tokens" \
  -H "Authorization: Bearer $ACCESS" \
  -H 'content-type: application/json' \
  -d '{"tenant_id":"default","name":"deploy","roles":["operator"],"expires_in_days":90}'

Store secret. Use it as Authorization: Bearer sk_… from then on.

Create a source, destination, and integration

curl -s -X POST "$SIRIUS/sources" -H 'content-type: application/json' -d '{
  "tenant_id": "default",
  "name": "Order intake",
  "kind": "http",
  "config": { "path": "/ingest/orders" }
}'

curl -s -X POST "$SIRIUS/destinations" -H 'content-type: application/json' -d '{
  "tenant_id": "default",
  "name": "Warehouse API",
  "kind": "http",
  "config": { "url": "https://warehouse.example.org/ingest" }
}'

curl -s -X POST "$SIRIUS/sources/order-intake/probe"
curl -s -X POST "$SIRIUS/destinations/warehouse-api/probe"

curl -s -X POST "$SIRIUS/components" -H 'content-type: application/json' -d '{
  "tenant_id": "default",
  "name": "Orders to warehouse",
  "kind": "http",
  "tags": ["orders"],
  "auto_start": true
}'

Save and publish a graph

WF=$(curl -s -X POST "$SIRIUS/workflows" -H 'content-type: application/json' \
  -d '{"tenant_id":"default","name":"Orders to warehouse"}' | jq -r .id)

curl -s -X PUT "$SIRIUS/workflows/$WF/versions/1/graph" \
  -H 'content-type: application/json' -d '{
  "tenant_id": "default",
  "nodes": [
    {"id": "in", "kind": "source", "label": "HTTP in",
     "connector_kind": "http", "settings": {"path": "/ingest/orders"}},
    {"id": "map", "kind": "transform", "label": "Normalize",
     "config": {"language": "javascript", "code": "result = { message: sirius.json.decode(msg.raw) };"}},
    {"id": "out", "kind": "destination", "label": "HTTP out",
     "connector_kind": "http", "settings": {"url": "https://warehouse.example.org/ingest"}}
  ],
  "edges": [
    {"id": "e1", "source_id": "in", "target_id": "map"},
    {"id": "e2", "source_id": "map", "target_id": "out"}
  ]
}'

curl -s -X POST "$SIRIUS/workflows/$WF/versions/1/validate" -d '{"tenant_id":"default"}'
curl -s -X POST "$SIRIUS/workflows/$WF/versions/1/publish" -d '{"tenant_id":"default"}'

Export a portable package (secret references only):

curl -s "$SIRIUS/workflows/$WF/export" -o orders.sirius.json
curl -s -X POST "$SIRIUS/workflows/import/validate" --data-binary @orders.sirius.json
curl -s -X POST "$SIRIUS/workflows/import" --data-binary @orders.sirius.json

Replay and work the dead-letter queue

curl -s "$SIRIUS/messages?tenant_id=default&limit=20"
curl -s -X POST "$SIRIUS/messages/<queue_id>/<sequence>/replay" \
  -H 'content-type: application/json' -d '{"request_id":"replay-001"}'

curl -s "$SIRIUS/failures?tenant_id=default&limit=50"
curl -s -X POST "$SIRIUS/failures/<id>/retry"
curl -s -X POST "$SIRIUS/failures/<id>/resolve"

Search logs and read the dashboard

curl -s "$SIRIUS/logs?tenant_id=default&level=warn&q=timeout"
curl -s "$SIRIUS/logs?tenant_id=default&related_to=<queue_id>:<sequence>"
curl -s "$SIRIUS/operations/overview?tenant_id=default" | jq '.kpis'
curl -s "$SIRIUS/operations/instance/metrics" | jq '{cpu:.cpu.used_pct, mem:.memory.used_pct}'

Configure an alert

curl -s -X POST "$SIRIUS/alerts/channels" -H 'content-type: application/json' -d '{
  "name": "Ops webhook",
  "type": "webhook",
  "secret_provider": "managed",
  "secret_name": "ops-webhook"
}'
curl -s -X POST "$SIRIUS/alerts/channels/ops-webhook/test"

curl -s -X POST "$SIRIUS/alerts/rules" -H 'content-type: application/json' -d '{
  "name": "Orders down",
  "signal": "integration_status",
  "severity": "critical",
  "selector": {"integration_names": ["Orders to warehouse"]},
  "condition": {"type": "status_transition", "status_to": "down"},
  "channel_ids": ["ops-webhook"],
  "throttle_seconds": 300
}'

Translate a script

curl -s -X POST "$SIRIUS/migration/<engine>/analyze" \
  -H 'content-type: application/json' \
  -d '{"source":"…script text…"}'

curl -s -X POST "$SIRIUS/migration/<engine>/translate" \
  -H 'content-type: application/json' \
  -d '{"source":"…script text…","mode":"native"}'

{engine} is the dialect you are leaving. The output is always native Sirius. Read the report before you bind connectors.

Start a durable process

curl -s "$SIRIUS/bpmn/readiness"
curl -s -X POST "$SIRIUS/bpmn/processes/<id>/execute" \
  -H 'content-type: application/json' \
  -d '{"tenant_id":"default","variables":{"amount":200}}'
curl -s -X POST "$SIRIUS/bpmn/processes/<id>/instances" \
  -H 'content-type: application/json' \
  -d '{"tenant_id":"default","variables":{"amount":5000}}'
curl -s "$SIRIUS/bpmn/instances?tenant_id=default"

Sample-run a stream

curl -s "$SIRIUS/streams/readiness"
curl -s -X POST "$SIRIUS/streams/topologies/orders-per-5m/run" \
  -H 'content-type: application/json' \
  -d '{"record":{"event_type":"order.created","warehouse":"west"}}'

Python

import requests

SIRIUS = "http://localhost:8080"
TENANT = "default"

def login(user, password, tenant=TENANT):
    r = requests.post(
        f"{SIRIUS}/auth/login",
        json={"tenant_id": tenant, "username": user, "password": password},
    )
    r.raise_for_status()
    return r.json()["access_token"]

token = login("admin", "password")
s = requests.Session()
s.headers.update({"Authorization": f"Bearer {token}"})

components = s.get(f"{SIRIUS}/components", params={"tenant_id": TENANT}).json()

For unattended jobs, skip login and set Authorization: Bearer sk_….

JavaScript

const SIRIUS = "http://localhost:8080";
const headers = {
  "content-type": "application/json",
  authorization: `Bearer ${token}`,
};

const res = await fetch(`${SIRIUS}/components?tenant_id=default`, { headers });
if (!res.ok) {
  const body = await res.json();
  throw new Error(body.error.message);
}
const components = await res.json();