Welcome to the API documentation for the FreePBX Middleware system. This API facilitates data ingestion from FreePBX and data consumption for PowerBI.
This API acts as a secure middleware and requires a Bearer Token for all requests. This ensures that only authorized services (FreePBX, PowerBI) can access the data.
You must include the Authorization header in every HTTP request with your secret token.
Authorization: Bearer YOUR_SECURE_TOKEN
Note: The token is generated securely by the system administrator and is not publicly available. If you lose your token, please contact the administrator to generate a new one from the server environment.
To ensure system stability, the API enforces the following limits:
429 Too Many Requests
response.limit and offset parameters to fetch data in
chunks (e.g., 1000 records at a time) rather than requesting the entire database at once.created_after to fetch only new records since your last
refresh. This is significantly faster and reduces load.429 errors by waiting a few minutes
before retrying.POST /api/v1/ingest
Uploads call data from FreePBX. Rejects duplicates based on call_id.
[
{
"call_id": "1769504531.76688",
"caller_id": "0946955993",
"timestamp": "2026-01-27 11:02:29",
"selections": [
{
"sequence": 1,
"stage": "City-Tripoli",
"dtmf": "1",
"timestamp": "2026-01-27 11:02:29"
}
]
}
]
GET /api/v1/data
Fetches flattened call data suitable for PowerBI ingestion.
limit: Number of records to return (default: 500)offset: Pagination offset (default: 0)created_after: Filter by creation date (ISO 8601, e.g., 2026-01-27T00:00:00Z)created_before: Filter by creation date (ISO 8601)[
{
"call_id": "1769504531.76688",
"caller_id": "0946955993",
"call_timestamp": "2026-01-27T11:02:29.000Z",
"selection_sequence": 1,
"selection_stage": "City-Tripoli",
"selection_dtmf": "1",
"selection_timestamp": "2026-01-27T11:02:29.000Z"
}
]
Manage global application settings dynamically without restarting.
/api/v1/settingsRetrieve current status of ingestion and consumption APIs.
{
"ingestion_enabled": true,
"consumption_enabled": true
}
/api/v1/settingsEnable or disable specific APIs. Useful for maintenance or pausing data flow.
{
"ingestion_enabled": false
}
{
"ingestion_enabled": true,
"consumption_enabled": true
}