Authentication¶
How Authentication Works¶
Every API request to the Authentic8 platform requires an API token passed as the first command in the request array. The SDK handles this automatically — you pass your token to the API client once on initialization, and it prepends setauth to every request.
# Under the hood, every SDK call sends:
[
{"command": "setauth", "data": "your_token_here"}, # auto-injected
{"command": "listusers", "org": "my_org"} # params are FLAT alongside "command"
]
You never need to construct the setauth command yourself.
Obtaining Tokens¶
Tokens are issued by the Authentic8 platform administrator. Each token type has separate permissions scoped to specific API modules. Contact your Authentic8 account team to obtain tokens for each capability you need.
See Token Types for the complete reference mapping tokens to API modules and wire commands.
Setting Up Tokens¶
Using Multiple API Modules¶
You can initialize multiple API clients from the same config dict. Each client validates that its required token is present on init:
from silo_sdk import BrowsingAPI, UserManagementAPI, LogExtractionAPI, load_config
config = load_config("config/default.json")
browsing = BrowsingAPI(config) # requires ADMIN_TOKEN
users = UserManagementAPI(config) # requires SYNC_TOKEN
logs = LogExtractionAPI(config) # requires LOG_TOKEN
If a required token is missing, the client raises ConfigurationError immediately — before any network call.
Authentication Errors¶
| Error | Cause | Fix |
|---|---|---|
ConfigurationError |
Token not in config | Check .env and config file |
AuthenticationError / InvalidTokenError |
Token rejected by API | Verify token is correct and not expired |
InsufficientPermissionsError |
Wrong token type | Use the correct token for this API module (see Token Types) |