Authentication
All ChatAgent API requests require authentication. Use an API key to authenticate.
Getting an API key
Section titled “Getting an API key”- Log in to app.chatagent.so
- Go to Settings → API
- Click Generate API Key
- Copy the key (shown once — store it securely)
Using the key
Section titled “Using the key”Include the key in the Authorization header:
Authorization: Bearer YOUR_API_KEYExample: cURL
Section titled “Example: cURL”curl -X GET https://api.chatagent.so/v1/conversations \ -H "Authorization: Bearer ghp_xxxxxxxxxxxx"Example: JavaScript
Section titled “Example: JavaScript”const response = await fetch("https://api.chatagent.so/v1/conversations", { headers: { "Authorization": "Bearer ghp_xxxxxxxxxxxx", },});const data = await response.json();Example: Python
Section titled “Example: Python”import requests
response = requests.get( "https://api.chatagent.so/v1/conversations", headers={"Authorization": "Bearer ghp_xxxxxxxxxxxx"})data = response.json()Key types
Section titled “Key types”| Type | Permissions | Use case |
|---|---|---|
| Full access | Read + write | Server-side integrations |
| Read-only | Read only | Dashboards and reporting |
| Webhook | Event delivery | Webhook verification |
Security
Section titled “Security”- Keep keys secret — never expose in client-side code or public repos
- Rotate regularly — regenerate keys periodically
- Use least privilege — use read-only keys when write access isn’t needed
- Monitor usage — check Settings → API for unusual activity
Revoking a key
Section titled “Revoking a key”- Go to Settings → API
- Find the key you want to revoke
- Click Revoke
- Confirm
Revoking a key immediately disables all integrations using it. Update your applications with the new key.
Error responses
Section titled “Error responses”| Status | Meaning |
|---|---|
401 |
Invalid or missing API key |
403 |
Key doesn’t have permission for this action |
429 |
Rate limit exceeded |
Next steps
Section titled “Next steps”- Webhooks — receive real-time events
- API Overview — getting started
- API Reference — full endpoint docs