Authentication
The TimelinesAI API uses Bearer token authentication. Every request must include your API token in theAuthorization header.
Getting your API token
Sign in to TimelinesAI
Go to app.timelines.ai
Using your token
Include the token in theAuthorization header of every request:
Example request
Token security
Best practices
Use environment variables
Use environment variables
Never hardcode tokens in your source code. Use environment variables:
Don't commit tokens to Git
Don't commit tokens to Git
Add your environment files to
.gitignore:Rotate tokens if compromised
Rotate tokens if compromised
If you suspect your token has been exposed, generate a new one immediately from the API settings page.
Use server-side only
Use server-side only
Never expose your API token in client-side code (browsers, mobile apps). Always make API calls from your backend server.
Error responses
401 Unauthorized
If your token is missing or invalid:- Missing
Authorizationheader - Token copied incorrectly (check for extra spaces)
- Token has been regenerated
403 Forbidden
If your token is valid but lacks permission:- Attempting to access resources from another workspace
- Feature not available on your plan
Token scope
Your API token has access to:| Resource | Access |
|---|---|
| Chats | Read & Write |
| Messages | Read & Write |
| Labels | Read & Write |
| Files | Read & Write |
| WhatsApp Accounts | Read only |
| Webhooks | Read & Write |
All operations are scoped to your workspace. You cannot access data from other TimelinesAI accounts.

