TrylleDocs
API Reference

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_REDACTED

Example with cURL:

curl --fail-with-body \
  --header "Authorization: Bearer $TRYLLE_API_KEY" \
  --header "Accept: application/json" \
  https://api.trylle.com/v1/viewer

Unset temporary variables after use:

unset TRYLLE_API_KEY

Bot 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_ID

Bot 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:

  1. TRYLLE_BOT_TOKEN
  2. TRYLLE_API_KEY
  3. Saved personal CLI Key

Use explicit environment isolation when a machine operates as both a user and a bot.

Errors

StatusMeaning
400The request shape or parameter value is invalid
401The token is missing, invalid, or revoked
403The identity is valid but lacks access to the resource
404The resource is absent or not visible to the identity
409The requested state conflicts with current resource state
429A 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.

On this page