FreePBX Middleware API Documentation

Welcome to the API documentation for the FreePBX Middleware system. This API facilitates data ingestion from FreePBX and data consumption for PowerBI.

Authentication

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.

How to Authenticate

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.

Rate Limiting & Usage Guidelines

To ensure system stability, the API enforces the following limits:

PowerBI Best Practices

Endpoints

2. Consumption Data (PowerBI) SECURE

GET /api/v1/data

Fetches flattened call data suitable for PowerBI ingestion.

Query Parameters

Response Format (Paginated JSON)

{
  "data": [
    {
      "id": 1025,
      "eventtype": "CHAN_START",
      "eventtime": "2026-03-28T08:30:05.000Z",
      "cid_name": "John Doe",
      "cid_num": "101",
      "cid_ani": "101",
      "cid_rdnis": "",
      "cid_dnid": "900",
      "exten": "s",
      "context": "from-internal",
      "channame": "PJSIP/101-000000a1",
      "appname": "",
      "appdata": "",
      "amaflags": 3,
      "accountcode": "",
      "uniqueid": "1711611005.161",
      "linkedid": "1711611005.161",
      "peer": "",
      "userdeftype": "",
      "extra": "{\"header\":\"value\"}"
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "limit": 500,
      "offset": 0,
      "hasNextPage": false,
      "hasPrevPage": false,
      "nextOffset": null,
      "prevOffset": null
    }
  }
}