The Secureagentics REST API uses API keys for authentication. Every request must include a valid API key in theDocumentation Index
Fetch the complete documentation index at: https://docs.adrian.secureagentics.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header as a Bearer token.
How API keys work
When you make a request tohttps://api.secureagentics.ai/v1, Secureagentics checks the Authorization header for a Bearer token. If the token is valid and has the required scope for the operation, the request succeeds. If the token is missing, invalid, or lacks the required scope, Secureagentics returns an error.
API keys are scoped — each key is created with a specific set of permissions. This lets you issue least-privilege keys for different parts of your system.
Generate an API key
Name and scope the key
Enter a descriptive label for the key — for example,
production-agent or ci-read-only. Then select a scope. See Key scopes below for a description of each option.Make an authenticated request
Pass your API key in theAuthorization header of every request.
YOUR_API_KEY with the key you copied from the dashboard. In production, load the key from an environment variable rather than hardcoding it.
Key scopes
Each API key is assigned one of the following scopes at creation time. You cannot change the scope of an existing key — create a new key if you need different permissions.| Scope | What it allows |
|---|---|
read | Read agents, events, and audit logs. No write access. |
write | Create agents, send events, and create or update policies. Includes all read permissions. |
admin | Full API access, including team management and workspace settings. Use only for trusted automation. |
read; an agent SDK integration needs write.
Authentication errors
| HTTP status | Error | Cause and fix |
|---|---|---|
401 Unauthorized | invalid_token | The key is missing, malformed, or has been revoked. Check that you’re passing the Authorization: Bearer <key> header and that the key is still active in Settings → API Keys. |
403 Forbidden | insufficient_scope | The key exists but does not have permission for this operation. Create a new key with a higher scope or check which scope is required for the endpoint you’re calling. |
Key rotation best practices
Rotate API keys regularly to limit exposure if a key is ever leaked.- Set a rotation schedule. Treat API keys like passwords. Rotate keys used in production at least every 90 days.
- Use one key per service. Assign a unique key to each application or service that calls the API. This lets you revoke a single key without disrupting other integrations.
- Rotate before revoking. When replacing a key, create the new key, deploy it to your service, verify requests succeed, then revoke the old key. This avoids downtime.
- Audit key usage. Check the audit log in Settings → Audit log to see which keys have been used recently. Revoke keys that are no longer in use.