DOCS

API Reference

REST API endpoints, authentication, request/response formats, error codes, and rate limits for SURADAR.

The SURADAR REST API is available at https://api.suradar.dev. All requests use JSON and require authentication.

Authentication

Include your API key as a Bearer token in the Authorization header:

Authorization: Bearer sk_live_abc123...

Endpoints

POST /v1/agents

Enroll a new agent in your organization.

Request:

{
  "name": "order-processor",
  "description": "Processes incoming purchase orders",
  "org_id": "org_xyz789",
  "metadata": {
    "team": "commerce",
    "environment": "production"
  }
}

Response (201):

{
  "id": "agt_abc123",
  "name": "order-processor",
  "status": "active",
  "created_at": "2026-04-15T08:00:00Z",
  "credential": "cred_..."
}

GET /v1/agents/:id

Retrieve details for an enrolled agent.

Response (200):

{
  "id": "agt_abc123",
  "name": "order-processor",
  "description": "Processes incoming purchase orders",
  "status": "active",
  "created_at": "2026-04-15T08:00:00Z",
  "last_active_at": "2026-04-15T12:34:56Z",
  "metadata": {
    "team": "commerce",
    "environment": "production"
  }
}

POST /v1/policies

Create a governance policy.

Request:

{
  "name": "production-rate-limit",
  "scope": "org",
  "rules": [
    {
      "type": "rate_limit",
      "max_requests_per_minute": 1000
    },
    {
      "type": "action_allowlist",
      "actions": ["read", "write"]
    }
  ]
}

Response (201):

{
  "id": "pol_def456",
  "name": "production-rate-limit",
  "scope": "org",
  "status": "active",
  "created_at": "2026-04-15T08:00:00Z"
}

GET /v1/audit

Query the audit log. Supports filtering by agent, action, and time range.

Query parameters:

ParameterTypeDescription
agent_idstringFilter by agent ID
actionstringFilter by action type
fromISO 8601Start of time range
toISO 8601End of time range
limitintegerMax results (default: 100, max: 1000)

Response (200):

{
  "events": [
    {
      "id": "evt_ghi789",
      "agent_id": "agt_abc123",
      "action": "write",
      "resource": "orders/12345",
      "result": "allowed",
      "timestamp": "2026-04-15T12:34:56Z"
    }
  ],
  "has_more": true,
  "cursor": "cur_..."
}

GET /v1/usage

Retrieve usage metrics for your organization.

Response (200):

{
  "period": "2026-04",
  "total_requests": 142857,
  "agents_active": 23,
  "policy_evaluations": 142857,
  "actions_denied": 312
}

Error Format

All errors follow a consistent format:

{
  "error": {
    "code": "invalid_request",
    "message": "The 'name' field is required.",
    "status": 400
  }
}

Error Codes

CodeStatusDescription
invalid_request400Missing or malformed parameters
unauthorized401Invalid or missing API key
forbidden403Valid key but insufficient permissions
not_found404Resource does not exist
conflict409Resource already exists
rate_limited429Too many requests
internal_error500Server error — retry with backoff

Rate Limits

PlanRequests per minute
Starter100
Pro1,000
EnterpriseCustom

Rate limit headers are included in every response:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 997
X-RateLimit-Reset: 1713168000

Next Steps