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.

Endpoints to manage API access tokens.

GET /tenants//tokens

List all tenant tokens. Required scope: tokens:read

Request

curl https://api.animam.ai/tenants/my-company/tokens \
  -H "Authorization: Bearer ak_your_token"

Response

{
  "tokens": [
    {
      "id": "tok_abc123",
      "name": "Production API",
      "prefix": "ak_prod_",
      "scopes": ["corpus:read", "corpus:write"],
      "createdAt": "2024-01-15T10:30:00Z",
      "lastUsedAt": "2024-01-25T14:22:00Z",
      "expiresAt": null
    },
    {
      "id": "tok_xyz789",
      "name": "Analytics readonly",
      "prefix": "ak_analytics_",
      "scopes": ["conversations:read"],
      "createdAt": "2024-01-20T08:00:00Z",
      "lastUsedAt": null,
      "expiresAt": "2024-12-31T23:59:59Z"
    }
  ]
}
The full token is never returned. Only the prefix is visible.

POST /tenants//tokens

Create a new token. Required scope: tokens:write

Request

curl -X POST https://api.animam.ai/tenants/my-company/tokens \
  -H "Authorization: Bearer ak_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI/CD Pipeline",
    "scopes": ["corpus:read", "corpus:write"],
    "expiresAt": "2025-01-01T00:00:00Z"
  }'

Body

FieldTypeRequiredDescription
namestringYesDescriptive name
scopesstring[]YesList of scopes
expiresAtstringNoExpiration date (ISO 8601)

Response

{
  "id": "tok_new456",
  "name": "CI/CD Pipeline",
  "token": "ak_live_abc123xyz789...",
  "scopes": ["corpus:read", "corpus:write"],
  "createdAt": "2024-01-25T10:30:00Z",
  "expiresAt": "2025-01-01T00:00:00Z"
}
The token field is only returned at creation. Store it immediately.

DELETE /tenants//tokens/

Revoke a token. Required scope: tokens:write

Request

curl -X DELETE https://api.animam.ai/tenants/my-company/tokens/tok_abc123 \
  -H "Authorization: Bearer ak_your_token"

Response

{
  "deleted": true,
  "id": "tok_abc123"
}

Available scopes

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 (admin)

Best practices

Naming

Use descriptive names:
  • Production API - Main token
  • CI/CD Corpus Sync - Specific integration
  • Analytics Dashboard - Read-only access

Minimal scopes

// Bad: too many permissions
{ "scopes": ["*"] }

// Good: minimal permissions
{ "scopes": ["corpus:read"] }

Expiration

For temporary tokens (CI/CD, tests):
{
  "name": "Temporary test token",
  "scopes": ["corpus:read"],
  "expiresAt": "2024-02-01T00:00:00Z"
}

Rotation

Review and rotate your tokens regularly:
  1. Create a new token
  2. Update your integrations
  3. Verify everything works
  4. Delete the old token