API Overview
Base URL and Versioning
- Base URL:
https://chattz.net/api - Versioned endpoints:
https://chattz.net/api/v1/...
Example:
https://chattz.net/api/v1/users/data?id=42
Authentication
Most endpoints require the community API key.
Accepted API key inputs:
X-Chattz-Api-Key: <key>(preferred)X-Api-Key: <key>Authorization: Bearer <key>- Query string:
?api_key=<key>
Community scope rules:
- Community endpoints validate that the API key belongs to the same community as the target channel, thread, or message.
GET /api/v1/users/datais public and does not require a key.
Authentication Examples
curl "https://chattz.net/api/v1/channels/123456789012/messages" \
-H "X-Chattz-Api-Key: YOUR_KEY"
curl "https://chattz.net/api/v1/channels/123456789012/messages" \
-H "X-Api-Key: YOUR_KEY"
curl "https://chattz.net/api/v1/channels/123456789012/messages" \
-H "Authorization: Bearer YOUR_KEY"
curl "https://chattz.net/api/v1/channels/123456789012/messages?api_key=YOUR_KEY"
Rate Limits
Default per endpoint:
5requests per1second
When rate-limited:
- HTTP
429 code: "chattz_api_rate_limited"meta.retry_aftercontains retry timing details
Response Format
Success
{
"success": true,
"code": "some_code",
"...": "payload fields"
}
Error
{
"success": false,
"code": "error_code",
"message": "Human readable message",
"meta": {}
}
Common Error Cases
400: Invalid IDs, invalid pagination, invalid or missing JSON fields401: Missing or invalid API key403: Valid key but not allowed for target community404: User, channel, thread, or message not found405: HTTP method not allowed429: Rate limit exceeded500/503: Internal or storage availability failure