API Authentication
Learn how to authenticate with the FluenzR API.
API Authentication
The FluenzR API uses API keys for authentication.
Get an API key
Prerequisites
- Active Pro plan
- Administrator rights on the account
Generate a key
- Log in to FluenzR
- Go to Settings > API
- Click on Generate a new key
- Give the key a descriptive name
- Copy the displayed key immediately
Warning The key is only shown once. Keep it in a safe place. If you lose it, you'll need to generate a new one.
Use the API key
Authorization header
Include your API key in the Authorization header of each request:
curl -X GET "https://api.fluenzr.co/v1/contacts" \
-H "Authorization: Bearer flz_sk_your_api_key_here" \
-H "Content-Type: application/json"
Key format
FluenzR API keys follow this format:
flz_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
flz: FluenzR prefixsk: Secret keyxxx...: 32 alphanumeric characters
Examples by language
cURL
curl -X GET "https://api.fluenzr.co/v1/contacts" \
-H "Authorization: Bearer flz_sk_abc123..." \
-H "Content-Type: application/json"
JavaScript (fetch)
const response = await fetch('https://api.fluenzr.co/v1/contacts', {
headers: {
'Authorization': 'Bearer flz_sk_abc123...',
'Content-Type': 'application/json'
}
});
const data = await response.json();
JavaScript (axios)
import axios from 'axios';
const client = axios.create({
baseURL: 'https://api.fluenzr.co/v1',
headers: {
'Authorization': 'Bearer flz_sk_abc123...'
}
});
const { data } = await client.get('/contacts');
Python (requests)
import requests
headers = {
'Authorization': 'Bearer flz_sk_abc123...',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.fluenzr.co/v1/contacts',
headers=headers
)
data = response.json()
PHP
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.fluenzr.co/v1/contacts',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer flz_sk_abc123...',
'Content-Type: application/json'
]
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
Ruby
require 'net/http'
require 'json'
uri = URI('https://api.fluenzr.co/v1/contacts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer flz_sk_abc123...'
request['Content-Type'] = 'application/json'
response = http.request(request)
data = JSON.parse(response.body)
Manage your API keys
View existing keys
In Settings > API, view your key list:
| Name | Created | Last used | Actions |
|---|---|---|---|
| Production | 01/01/2025 | 01/10/2025 | Revoke |
| Dev/Test | 01/05/2025 | 01/08/2025 | Revoke |
Revoke a key
- Click Revoke next to the key
- Confirm revocation
Danger Revocation is immediate and irreversible. All applications using this key will stop working.
Best practices
One key per environment
| Environment | Key | Permissions |
|---|---|---|
| Production | flz_sk_prod_xxx | All |
| Staging | flz_sk_stag_xxx | All |
| Development | flz_sk_dev_xxx | Read-only |
Never expose keys
Never do:
- Commit to a Git repo
- Include client-side (frontend)
- Share via email/chat
Always do:
- Use environment variables
- Store in a secrets manager
- Keep server-side only
Environment variables
# .env (don't commit)
FLUENZR_API_KEY=flz_sk_abc123...
// Node.js
const apiKey = process.env.FLUENZR_API_KEY;
# Python
import os
api_key = os.environ.get('FLUENZR_API_KEY')
Authentication errors
401 Unauthorized
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}
Possible causes:
- Missing API key
- Invalid API key
- Revoked API key
403 Forbidden
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "API access requires Pro plan"
}
}
Possible causes:
- Account paused after the trial ended (API not available)
- API key without required permissions
Security
Key rotation
Change your API keys regularly:
- Generate a new key
- Update your applications
- Verify everything works
- Revoke the old key
Monitoring
Monitor your key usage:
- Check "last used" regularly
- Identify unused keys
- Detect suspicious usage
In case of compromise
If a key is compromised:
- Immediately revoke the key in FluenzR
- Generate a new key
- Update your applications
- Analyze logs to detect malicious use
- Contact support if necessary
