Skip to content

API Tokens

Every programmatic call to Gaard authenticates with a bearer token. Gaard offers two kinds of credentials for different jobs: API keys scoped to a flow, and personal access tokens tied to your user. This guide shows how to create, scope, and revoke each one.

  • An Administrator account to manage API keys in Settings → Platform → Integrations.
  • The gaard CLI installed if you want to create personal access tokens.
API keyPersonal access token (PAT)
Created inSettings → Platform → IntegrationsThe gaard CLI
ScopeA single flowYour user (all tenants you belong to)
Best forA service or integration that submits video to one flowThe CLI and personal automation
PrefixA generated key valuepat_
Managed byAny administratorThe token owner

Both are sent the same way: as a bearer token in the Authorization header:

terminal
curl -X POST https://vision.gaard.ai/api/classify \
-H "Authorization: Bearer $GAARD_TOKEN" \

An API key belongs to a flow and is the credential most integrations use to submit video.

  1. Open Settings → Platform → Integrations.

  2. Select the API Key integration.

  3. Choose the Flow the key should authenticate against.

  4. Give the key a Name that identifies where it is used, for example edge-uploader.

  5. Copy the generated API Key value and store it securely: treat it like a password.

  6. Select Save. The key appears in the integrations list with its flow.

The key authenticates classify API calls for its flow. See Getting Started for a full request walkthrough.

Personal access tokens are user-scoped and created with the CLI. They carry a pat_ prefix and can be given an expiry.

terminal
# Create a token
gaard token create --name ci-bot
# Create a token that expires in 30 days
gaard token create --name nightly-job --expires 720h
# List your tokens
gaard token list

For the full command syntax, run gaard token --help.

Rotate credentials on a schedule and whenever one may have been exposed.

API keys: API keys do not rotate in place. To rotate one, create a new API key for the same flow, move your integration to the new key, then delete the old key from the integrations list using its row menu.

Personal access tokens: set an expiry with --expires when you create a token, and revoke a token immediately when it is no longer needed:

terminal
gaard token list
gaard token revoke <token-id>