Skip to main content

API Reference

The UAPK Gateway exposes a RESTful API for managing organizations, manifests, tokens, and action execution.

Base URL

http://localhost:8000/api/v1

For production deployments, use HTTPS:

https://gateway.yourdomain.com/api/v1

Authentication

The API supports two authentication methods:

MethodUse CaseHeader
Bearer TokenDashboard, admin operationsAuthorization: Bearer <token>
API KeyAgent integrationsX-API-Key: <key>

See Authentication for details.

Content Type

All requests and responses use JSON:

-H "Content-Type: application/json"

API Sections

  • Organizations & Users

    Manage organizations, users, and roles

    Organizations

  • Manifests

    Register and manage agent manifests

    Manifests

  • Gateway

    Evaluate and execute agent actions

    Gateway

  • Approvals

    Manage human-in-the-loop approvals

    Approvals

  • Logs

    Query and export audit logs

    Logs

Common Patterns

Pagination

List endpoints support pagination:

curl "http://localhost:8000/api/v1/orgs/$ORG_ID/logs?limit=50&offset=100" \
-H "Authorization: Bearer $TOKEN"
ParameterTypeDefaultDescription
limitinteger50Maximum items to return
offsetinteger0Number of items to skip

Filtering

Many endpoints support filtering:

curl "http://localhost:8000/api/v1/orgs/$ORG_ID/logs?uapk_id=my-agent&decision=approved" \
-H "Authorization: Bearer $TOKEN"

Error Responses

Errors return a consistent structure:

{
"detail": {
"code": "MANIFEST_NOT_FOUND",
"message": "No manifest found for agent 'unknown-agent'"
}
}
HTTP CodeMeaning
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid auth
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
409Conflict - Resource already exists
422Unprocessable Entity - Validation failed
500Internal Server Error

Rate Limiting

The API implements rate limiting per API key:

TierRequests/minuteRequests/day
Free6010,000
Pro600100,000
EnterpriseUnlimitedUnlimited

Rate limit headers are included in responses:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 55
X-RateLimit-Reset: 1702560000

Quick Reference

Organizations

MethodEndpointDescription
POST/orgsCreate organization
GET/orgs/{org_id}Get organization
PATCH/orgs/{org_id}Update organization

Users

MethodEndpointDescription
POST/orgs/{org_id}/usersCreate user
GET/orgs/{org_id}/usersList users
POST/auth/loginLogin
POST/auth/logoutLogout

API Keys

MethodEndpointDescription
POST/orgs/{org_id}/api-keysCreate API key
GET/orgs/{org_id}/api-keysList API keys
DELETE/orgs/{org_id}/api-keys/{key_id}Revoke API key

Manifests

MethodEndpointDescription
POST/orgs/{org_id}/manifestsRegister manifest
GET/orgs/{org_id}/manifestsList manifests
GET/orgs/{org_id}/manifests/{manifest_id}Get manifest
POST/orgs/{org_id}/manifests/{manifest_id}/approveApprove manifest
POST/orgs/{org_id}/manifests/{manifest_id}/suspendSuspend manifest

Gateway

MethodEndpointDescription
POST/gateway/evaluateEvaluate action (dry-run)
POST/gateway/executeExecute action

Approvals

MethodEndpointDescription
GET/orgs/{org_id}/approvalsList approvals
GET/orgs/{org_id}/approvals/{approval_id}Get approval
POST/orgs/{org_id}/approvals/{approval_id}/approveApprove request
POST/orgs/{org_id}/approvals/{approval_id}/denyDeny request

Logs

MethodEndpointDescription
GET/orgs/{org_id}/logsList logs
GET/orgs/{org_id}/logs/{record_id}Get log record
GET/orgs/{org_id}/logs/verify/{uapk_id}Verify chain
POST/orgs/{org_id}/logs/export/downloadExport logs (JSON)
POST/orgs/{org_id}/logs/export/jsonlExport logs (JSONL)

SDKs

Official SDKs are available for common languages:

pip install uapk-gateway
from uapk_gateway import GatewayClient

client = GatewayClient(
base_url="http://localhost:8000",
api_key="your-api-key"
)

result = client.execute(
uapk_id="my-agent",
action_type="email",
tool="send",
params={"to": "user@example.com", "subject": "Hello"}
)

OpenAPI Specification

The full OpenAPI specification is available at:

http://localhost:8000/openapi.json

Interactive documentation (Swagger UI):

http://localhost:8000/docs