API Overview¶
The fifthelement.ai API provides programmatic access to platform features including chat agents, document management, and repository operations.
Base URL¶
Authentication¶
All API requests require authentication using API keys. Create an API key from Settings > Security & Access > API Keys in the platform.
Creating an API Token¶
Endpoint: POST /user-api-tokens
Generate an API token with a custom name for identification:
curl -X POST https://PLATFORM-URL-PLACEHOLDER/v1/api/user-api-tokens \
-H "Authorization: Bearer YOUR_EXISTING_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My API Token"}'
API Categories¶
The fifthelement.ai API is organized into the following categories:
-
Chat API
Send messages to AI agents and manage conversations.
-
Document API
Upload, manage, and query documents in repositories.
-
Repository API
Manage knowledge repositories and settings.
-
Jobs API
Monitor and manage background jobs.
Rate Limits¶
API requests are rate-limited based on your account tier:
- Standard: 1,000 requests per hour
- Premium: 10,000 requests per hour
- Enterprise: Custom limits
Rate limit headers are included in all responses:
Response Format¶
All API responses follow a consistent format:
Success Response¶
Error Response¶
{
"data": null,
"error": {
"name": "ValidationError",
"message": "Invalid request parameters",
"details": {}
}
}
Error Codes¶
| Status Code | Description |
|---|---|
200 | Success - Request completed successfully |
400 | Bad Request - Invalid input data or malformed request |
401 | Unauthorized - Authentication required or invalid credentials |
403 | Forbidden - Insufficient permissions for this resource |
404 | Not Found - Resource does not exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server-side error occurred |
Interactive Documentation¶
For interactive API testing and detailed schemas, visit our Swagger UI:
https://PLATFORM-URL-PLACEHOLDER/v1/documentation
Quick Start Example¶
Here's a complete example showing how to chat with an agent:
# 1. Get your API token from Settings > API Keys
# 2. Send a message to an agent
curl -X POST "https://PLATFORM-URL-PLACEHOLDER/v1/api/chat/your-agent-slug" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, how can you help me?",
"stream": false,
"conversationId": null
}'
Next Steps¶
- Chat API - Send messages to AI agents
- Document API - Manage knowledge base documents
- Repository API - Configure knowledge repositories
- Jobs API - Monitor background tasks