ReferenceAPI Reference

API Reference

Complete reference documentation for the SilentAuth REST API.

Base URL

https://api.silentauth.io/v1

Authentication

All API requests require authentication using your project's secret key:

Authorization: Bearer sk_live_your_secret_key

Endpoints

POST
/v1/intents

Create an intent declaring what action the agent wants to perform

GET
/v1/intents/:id

Get the status of an intent (pending, approved, denied, expired)

POST
/v1/intents/:id/approve

Approve a pending intent and issue a signed permit

POST
/v1/intents/:id/deny

Deny a pending intent with optional reason

POST
/v1/permits/validate

Validate a permit token (can also be done offline)

GET
/v1/projects/:id/audit

Get audit log of intents and approvals for a project

Example: Create Intent & Get Permit

1. Create an intent:

POST /v1/intents
Content-Type: application/json
Authorization: Bearer sk_live_xxx

{
  "action": "deploy_production",
  "params": { "env": "prod", "version": "2.1.0" },
  "approvers": ["ops-team"],
  "expires_in": 3600
}

Response:

{
  "id": "int_abc123",
  "status": "pending",
  "action": "deploy_production",
  "approval_url": "https://app.silentauth.io/approve/int_abc123",
  "expires_at": "2024-01-15T11:30:00Z"
}

2. After human approval, poll or use webhook to get the permit:

{
  "id": "int_abc123",
  "status": "approved",
  "permit": {
    "token": "eyJhbGciOiJSUzI1NiIs...",
    "expires_at": "2024-01-15T10:35:00Z",
    "approved_by": "jane@acme.co",
    "approved_at": "2024-01-15T10:30:00Z"
  }
}

Error Codes

CodeDescription
intent_not_foundThe specified intent ID does not exist
intent_expiredThe intent has expired and can no longer be approved
intent_already_resolvedThe intent has already been approved or denied
permit_invalidThe permit token is invalid, expired, or tampered with
policy_violationThe intent violates project policy rules
unauthorizedInvalid or missing API key