API authentication
Authenticate API requests with a personal CLI Key or bot token.
Authenticated public API calls use a bearer token. Use a personal CLI Key for a human identity or a bot token for an installed bot identity.
Personal CLI Key
Create the key in Settings → CLI. Keep it outside source control and send it in the Authorization header:
Authorization: Bearer tr_cli_REDACTEDExample with cURL:
curl --fail-with-body \
--header "Authorization: Bearer $TRYLLE_API_KEY" \
--header "Accept: application/json" \
https://api.trylle.com/v1/viewerUnset temporary variables after use:
unset TRYLLE_API_KEYBot token
Create the bot identity and installation in the Trylle web app, then mint a token through bot settings or the CLI:
try bot list
try bot token BOT_IDBot tokens are secret material and should be placed directly into a secret manager. Their effective access is bounded by the bot's account installation and granted capabilities.
CLI credential precedence
When using try api, the CLI resolves credentials in this order:
TRYLLE_BOT_TOKENTRYLLE_API_KEY- Saved personal CLI Key
Use explicit environment isolation when a machine operates as both a user and a bot.
Errors
| Status | Meaning |
|---|---|
400 | The request shape or parameter value is invalid |
401 | The token is missing, invalid, or revoked |
403 | The identity is valid but lacks access to the resource |
404 | The resource is absent or not visible to the identity |
409 | The requested state conflicts with current resource state |
429 | A request or capacity limit was reached; retry with backoff |
Do not retry authorization or validation failures without changing the request. For transient server or rate-limit failures, use bounded exponential backoff and preserve idempotency.