Skip to content

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

# .env — never commit this file
A8_ADMIN_TOKEN=your-admin-token-here
A8_SYNC_TOKEN=your-sync-token-here
A8_FILE_TOKEN=your-file-token-here
A8_LOG_TOKEN=your-log-token-here
A8_SCRAPE_TOKEN=your-scrape-token-here
# config/default.json reads from env automatically
config = load_config("config/default.json")

config = {
    "API_URL": "https://extapi.authentic8.com",
    "ADMIN_TOKEN": "your-admin-token",  # never hardcode in real code
}
browsing = BrowsingAPI(config)
# Store and manage tokens
python scripts/key_manager.py set-token your-token-value
python scripts/key_manager.py list-keys
python scripts/key_manager.py show-token

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)