Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.animam.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Animam API supports multiple authentication methods. Use an API token in the Authorization header:
curl https://api.animam.ai/tenants/{slug}/corpus \
  -H "Authorization: Bearer ak_your_token"

Creating a token

  1. Go to Dashboard > API Tokens
  2. Click Create token
  3. Give it a descriptive name
  4. Select the required scopes
  5. Copy the token (displayed only once)
Tokens are only displayed once at creation. Store them securely.

Scopes

Each token has specific permissions:
ScopeDescription
corpus:readRead corpus
corpus:writeModify corpus
conversations:readView conversations
settings:readRead tenant settings
settings:writeModify settings
tokens:readList tokens
tokens:writeCreate/delete tokens
*Full access

Example

A token with corpus:read can read the corpus but not modify it:
# OK
curl https://api.animam.ai/tenants/{slug}/corpus \
  -H "Authorization: Bearer ak_corpus_readonly"

# 403 Forbidden
curl -X POST https://api.animam.ai/tenants/{slug}/corpus \
  -H "Authorization: Bearer ak_corpus_readonly" \
  -d '{"title": "Test"}'
For the web dashboard only. Not usable for external API.
Cookie: animam_session=...

Legacy API Key

For backward compatibility with older integrations:
curl https://api.animam.ai/tenants/{slug}/corpus \
  -H "X-API-Key: your_old_key"
Legacy API Keys have full access. Migrate to Bearer tokens for finer control.

Authentication errors

CodeMessageSolution
401UnauthorizedMissing or invalid token
403ForbiddenInsufficient scope
403Token expiredCreate a new token
{
  "error": "Missing required scope: corpus:write"
}

Best practices

  1. One token per integration - Easier revocation
  2. Minimal scopes - Principle of least privilege
  3. Regular rotation - Change tokens periodically
  4. Environment variables - Never commit tokens
# .env
ANIMAM_API_TOKEN=ak_...

# Code
const token = process.env.ANIMAM_API_TOKEN