API Reference

Base URL: https://api.savants.cloud/api/v1. Authenticated endpoints require a Bearer token.

FSM Schemas

MethodEndpointAuthDescription
GET/fsm/schemasYesList schemas for your org
POST/fsm/schemasYesCreate or update a schema

Create a schema

curl -X POST https://api.savants.cloud/api/v1/fsm/schemas \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-workflow",
    "version": "1.0",
    "initial_state": "draft",
    "states": { "draft": { "type": "initial" }, "done": { "type": "terminal" } },
    "events": ["finish"],
    "transitions": [{ "from": "draft", "event": "finish", "to": "done" }]
  }'

Entity Instances

MethodEndpointAuthDescription
GET/fsm/instancesYesList all entities with current states
GET/fsm/instances/:schema/:entityYesGet specific entity state
POST/fsm/instances/:id/eventYesSend an event to an entity

Send an event

curl -X POST https://api.savants.cloud/api/v1/fsm/instances/pod-123/event \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "schema_id": "pod",
    "event": "crash_detected",
    "context": { "restart_count": 5, "namespace": "production" }
  }'

# Response:
# { "success": false, "guard_blocked": true, "from_state": "running", "to_state": null }

Guards

MethodEndpointAuthDescription
GET/fsm/guardsYesList all guards
POST/fsm/guardsYesSet a guard rule
DELETE/fsm/guardsYesRemove a guard

Transition Audit Log

MethodEndpointAuthDescription
GET/fsm/transitionsYesQuery transition history

Community Registry

MethodEndpointAuthDescription
GET/registryNoBrowse packages
GET/registry/search?q=...NoSearch packages
GET/registry/categoriesNoList categories
GET/registry/:slugNoPackage detail
GET/registry/:slug/versionsNoVersion history
POST/registry/publishYesPublish a profile
POST/registry/:slug/installYesInstall to your org
POST/registry/:slug/starYesStar a package

Authentication

All authenticated endpoints accept a Bearer token in the Authorization header:

Authorization: Bearer YOUR_JWT_OR_API_KEY

Get a token by signing in at savants.cloud/activate or creating an API key in the dashboard.