Saylor

Developers

Provision Saylor like infrastructure

One typed REST API and Terraform module behind a single Auth0 token.

Base URL & authentication

All requests target https://api.saylor.app. Authenticate with a bearer token from your Auth0 M2M application, scoped to the saylor:fleet audience.

bash
curl https://api.saylor.app/v1/devices \
  -H "Authorization: Bearer $SAYLOR_TOKEN" \
  -H "Content-Type: application/json"

Endpoints

MethodPathDescription
POST/v1/devicesRegister a new device and stake its SOL.
GET/v1/devices/{id}Get a device's trust score and last telemetry checkpoint.
POST/v1/devices/{id}/quarantineForce-quarantine a device. Requires admin scope.
GET/v1/threatsList on-chain ThreatConsensus cases with paging and filters.
POST/v1/threats/{id}/voteCast a peer vote on an open case. Idempotent per voter.
GET/v1/eventsStream every chain event for your tenant over SSE.

Register a device

bash
curl -X POST https://api.saylor.app/v1/devices \
  -H "Authorization: Bearer $SAYLOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "warehouse-a-17",
    "region": "us-east-1",
    "category": "indoor",
    "peer_group_name": "Warehouse A North Cluster",
    "sensors": ["temperature"],
    "stake_sol": 0.01
  }'
json
{
  "id": "dev-042",
  "name": "warehouse-a-17",
  "trust_score": 1.0,
  "stake_sol": 0.01,
  "solana_pubkey": "5Hk...",
  "registered_at": "2026-04-24T17:21:04Z"
}

Streaming events

The events endpoint is a long-lived SSE connection. Each frame is a JSON object matching the ChainEvent type.

ts
const es = new EventSource(
  "https://api.saylor.app/v1/events",
  { headers: { Authorization: `Bearer ${token}` } }
);

es.onmessage = (msg) => {
  const evt = JSON.parse(msg.data);
  console.log(evt.kind, evt.signature);
};