Skip to content

API Reference

The Slabond REST API provides direct access to the watcher network. All endpoints are served from https://api.slabond.xyz.

Authentication

Protected endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <your-api-key>

Public Endpoints

GET /health

Returns the API health status.

bash
curl https://api.slabond.xyz/health

Response 200:

json
{
  "status": "ok",
  "version": "1.0.0",
  "uptime": 99.98
}

GET /status

Returns the current network status including active operators and pending SLAs.

bash
curl https://api.slabond.xyz/status

Response 200:

json
{
  "network": "mainnet",
  "activeOperators": 42,
  "pendingSLAs": 7,
  "avgSettlementTime": 45,
  "lastBlock": 19847532
}

GET /stats

Returns aggregate protocol statistics.

bash
curl https://api.slabond.xyz/stats

Response 200:

json
{
  "activeOperators": 42,
  "totalSLAs": 158320,
  "successRate": 99.7,
  "totalValueSettled": "24500000.00",
  "avgSettlementTime": 45,
  "uptime": 99.98
}

Authenticated Endpoints

POST /jobs

Creates a new SLA job.

bash
curl -X POST https://api.slabond.xyz/jobs \
  -H "Authorization: Bearer $SLABOND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "slaId": "payment-001",
    "requester": "0xYourWallet",
    "amount": "1000.00 USDC",
    "targetUrl": "https://api.stripe.com/v1/charges",
    "method": "POST",
    "bondTier": "instant",
    "timeout": 1800
  }'

Response 201:

json
{
  "id": "job_abc123",
  "slaId": "payment-001",
  "status": "CREATED",
  "requester": "0xYourWallet",
  "amount": "1000.00 USDC",
  "targetUrl": "https://api.stripe.com/v1/charges",
  "operator": null,
  "bondAmount": null,
  "proof": null,
  "settlementTx": null,
  "createdAt": "2026-03-15T10:30:00Z",
  "updatedAt": "2026-03-15T10:30:00Z"
}

GET /jobs

Lists all SLA jobs for the authenticated user.

bash
curl https://api.slabond.xyz/jobs \
  -H "Authorization: Bearer $SLABOND_API_KEY"

Response 200:

json
{
  "jobs": [
    {
      "id": "job_abc123",
      "slaId": "payment-001",
      "status": "SETTLED",
      "amount": "1000.00 USDC",
      "createdAt": "2026-03-15T10:30:00Z",
      "updatedAt": "2026-03-15T10:31:45Z"
    }
  ],
  "total": 1
}

GET /jobs/:id

Retrieves a specific SLA job by ID.

bash
curl https://api.slabond.xyz/jobs/job_abc123 \
  -H "Authorization: Bearer $SLABOND_API_KEY"

Response 200:

json
{
  "id": "job_abc123",
  "slaId": "payment-001",
  "status": "SETTLED",
  "requester": "0xYourWallet",
  "amount": "1000.00 USDC",
  "targetUrl": "https://api.stripe.com/v1/charges",
  "operator": "0xOperatorAddress",
  "bondAmount": "2000.00 USDC",
  "proof": "0x...",
  "settlementTx": "0xabc123...",
  "createdAt": "2026-03-15T10:30:00Z",
  "updatedAt": "2026-03-15T10:31:45Z"
}

Error Responses

All errors follow a consistent format:

json
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}

400 Bad Request

Returned when the request body is invalid or missing required fields.

json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Field 'slaId' is required"
  }
}

401 Unauthorized

Returned when the Authorization header is missing or the API key is invalid.

json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}

404 Not Found

Returned when the requested resource does not exist.

json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Job 'job_xyz' not found"
  }
}

500 Internal Server Error

Returned when an unexpected error occurs on the server.

json
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "An unexpected error occurred"
  }
}

Secured by Intel SGX, TLSNotary & Ethereum