Table of Contents
Authentication
All API requests require authentication using API keys. Each organization has unique API keys for secure access.
API Key Authentication
Include your API key in the request header for all API calls:
Authorization: Bearer your-api-key-here
Getting Your API Keys
API keys can be generated and managed through your organization dashboard:
- Navigate to Settings → API Keys
- Click "Generate New API Key"
- Copy the key and store it securely
- Configure key permissions as needed
Rate Limiting
API requests are rate-limited to ensure fair usage and system stability.
Standard Plan
- Requests per minute: 60
- Requests per hour: 1,000
- Requests per day: 10,000
Enterprise Plan
- Requests per minute: 200
- Requests per hour: 5,000
- Requests per day: 50,000
Rate Limit Headers
All API responses include rate limit headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1640995200
API Endpoints
Complete list of available API endpoints with descriptions and parameters.
Core Resources
Retrieve organization information and settings
Parameters:
include_users(boolean) - Include user informationinclude_settings(boolean) - Include organization settings
Create a new organization
Body Parameters:
name(string, required) - Organization nameindustry(string) - Industry typesize(string) - Organization size
Retrieve user information
Parameters:
page(integer) - Page number for paginationper_page(integer) - Items per page (max 100)role(string) - Filter by user role
Analytics & Reporting
Retrieve performance analytics data
Parameters:
start_date(string, required) - Start date (YYYY-MM-DD)end_date(string, required) - End date (YYYY-MM-DD)metrics(array) - Specific metrics to include
Calculate ROI metrics for specific time period
Parameters:
period(string) - Time period (monthly, quarterly, yearly)include_comparison(boolean) - Include comparison data
Webhooks
Receive real-time notifications for important events in your flumberico implementation.
Available Webhook Events
organization.updated
Triggered when organization settings are updated
user.created
Triggered when a new user is added to the organization
analytics.ready
Triggered when new analytics data is available
Setting Up Webhooks
- Navigate to Settings → Webhooks in your dashboard
- Click "Add Webhook Endpoint"
- Enter your endpoint URL
- Select the events you want to receive
- Configure security settings
Code Examples
Implementation examples in popular programming languages.
JavaScript (Node.js)
const axios = require('axios');
const apiClient = axios.create({
baseURL: 'https://api.flumberico.com/v2',
headers: {
'Authorization': 'Bearer your-api-key-here',
'Content-Type': 'application/json'
}
});
// Get organization information
async function getOrganization() {
try {
const response = await apiClient.get('/organizations');
console.log(response.data);
} catch (error) {
console.error('API Error:', error.response.data);
}
}
Python
import requests
API_BASE_URL = 'https://api.flumberico.com/v2'
API_KEY = 'your-api-key-here'
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
def get_analytics(start_date, end_date):
params = {
'start_date': start_date,
'end_date': end_date
}
response = requests.get(
f'{API_BASE_URL}/analytics/performance',
headers=headers,
params=params
)
if response.status_code == 200:
return response.json()
else:
raise Exception(f'API Error: {response.status_code}')
PHP
$apiKey = 'your-api-key-here';
$baseUrl = 'https://api.flumberico.com/v2';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $baseUrl . '/organizations');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode === 200) {
$data = json_decode($response, true);
// Process organization data
} else {
// Handle API error
}
curl_close($ch);
Error Handling
All API errors follow a consistent format for easy handling.
Common Error Codes
| Code | Description | Resolution |
|---|---|---|
| 400 | Bad Request | Check request parameters and format |
| 401 | Unauthorized | Verify API key and authentication |
| 403 | Forbidden | Check API key permissions |
| 404 | Not Found | Resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Contact support |
Best Practices
Follow these best practices for optimal API integration.
Error Handling
Always implement proper error handling for API responses. Check status codes and handle errors gracefully.
Rate Limiting
Monitor rate limit headers and implement backoff strategies when approaching limits.
Security
Store API keys securely and never expose them in client-side code or public repositories.
Performance
Implement caching strategies for frequently accessed data and use pagination for large datasets.