API Reference
The Garnet API provides programmatic access to Issues, Policies, and Agents. Base URL:https://api.garnet.ai/v1
Authentication
All API requests require a bearer token.Get API Token
- Go to dashboard.garnet.ai
- Settings → API Tokens → Create Token
- Copy token (shown only once)
Issues
List Issues
| Parameter | Type | Description |
|---|---|---|
severity | string | Filter by severity: critical, high, medium, low |
verdict | string | Filter by verdict: detected, blocked |
since | ISO 8601 | Issues created after this timestamp |
limit | integer | Max results (default: 100, max: 1000) |
cursor | string | Pagination cursor |
Get Issue Details
Policies
List Policies
Create Policy
Update Policy
Delete Policy
Agents
List Agents
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: connected, disconnected |
platform | string | Filter by platform: github_actions, kubernetes |
cluster | string | Filter by cluster name (K8s only) |
Update Agent Mode
Events
List Events
| Parameter | Type | Description |
|---|---|---|
type | string | Event type: dns, connect, process |
agent_id | string | Filter by specific agent |
since | ISO 8601 | Events after this timestamp |
limit | integer | Max results (default: 100) |
Error Handling
All errors return standard HTTP status codes and JSON error objects.Error Response Format
Common Status Codes
| Code | Meaning | Action |
|---|---|---|
400 | Bad Request | Check request parameters |
401 | Unauthorized | Verify API token |
403 | Forbidden | Check token permissions |
404 | Not Found | Resource doesn’t exist |
429 | Rate Limit | Wait and retry |
500 | Server Error | Contact support |
Rate Limits
| Endpoint | Limit | Window |
|---|---|---|
| All endpoints | 1000 requests | per hour |
/v1/events | 100 requests | per minute |
Webhooks
Configure webhooks to receive real-time Issue notifications.Setup
Dashboard → Settings → Webhooks → Create Webhook Payload:Verify Webhook Signature
All webhook payloads include a signature header:SDK / Client Libraries
Official SDKs (coming soon):- Python:
pip install garnet-sdk - JavaScript:
npm install @garnet/sdk - Go:
go get github.com/garnet-labs/sdk-go
Full API Spec
OpenAPI Specification
Complete OpenAPI 3.0 spec for code generation