Skip to main content

Get Reports

Retrieve all Power BI reports accessible to the authenticated user.
GET /reports

Authentication

Authorization
string
required
Valid session or Sanctum token

Permissions

Requires one of the following:
  • super-admin role
  • report.create permission
  • report.edit permission
  • report.destroy permission

Response Behavior

Returns all reports in the system with relationships:
  • Report creator (user)
  • Associated filters
Returns only reports assigned to the authenticated user

Response Fields

id
integer
Report database ID
name
string
Report display name
group_id
string
Power BI workspace/group ID
report_id
string
Power BI report ID
dataset_id
string
Power BI dataset ID
access_level
string
Access level (typically “View”)
token
string
Cached Power BI embed token
expiration_date
datetime
Token expiration timestamp
user_id
integer
ID of user who created the report
filter_array
string
JSON-encoded array of Power BI filters
created_at
datetime
Report creation timestamp
updated_at
datetime
Last update timestamp
created_by
object
User object who created the report
filters
array
Array of filter objects associated with this report

Example Request

curl -X GET https://your-domain.com/reports \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Example Response

[
  {
    "id": 1,
    "name": "Sales Dashboard",
    "group_id": "f089354e-8366-4e18-aea3-4cb4a3a50b48",
    "report_id": "5b218778-e7a5-4d73-8187-f10824047715",
    "dataset_id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
    "access_level": "View",
    "token": "H4sIAAAAAAAEAB2RxQ...",
    "expiration_date": "2026-03-04 10:30:00",
    "user_id": 1,
    "filter_array": "[{\"$schema\":\"http://powerbi.com/product/schema#basic\",\"target\":{\"table\":\"Sales\",\"column\":\"Region\"},\"operator\":\"In\",\"values\":[\"North\",\"South\"]}]",
    "created_at": "2026-01-15 14:30:00",
    "updated_at": "2026-03-04 09:15:00",
    "created_by": {
      "id": 1,
      "name": "John Doe",
      "email": "[email protected]"
    },
    "filters": [
      {
        "id": 1,
        "name": "Region Filter",
        "table": "Sales",
        "column": "Region",
        "operator": "In",
        "values": "North,South",
        "parse_values": ["North", "South"]
      }
    ]
  },
  {
    "id": 2,
    "name": "Financial Report",
    "group_id": "f089354e-8366-4e18-aea3-4cb4a3a50b48",
    "report_id": "7d329888-f9b6-5e84-9298-g21935158826",
    "dataset_id": "dfbfcfc2-9148-5e1d-997f-b57gc38gg330",
    "access_level": "View",
    "token": null,
    "expiration_date": null,
    "user_id": 1,
    "filter_array": "[]",
    "created_at": "2026-02-10 11:20:00",
    "updated_at": "2026-02-10 11:20:00",
    "created_by": {
      "id": 1,
      "name": "John Doe",
      "email": "[email protected]"
    },
    "filters": []
  }
]

Filter Array Structure

The filter_array field contains Power BI filter definitions:
[
  {
    "$schema": "http://powerbi.com/product/schema#basic",
    "target": {
      "table": "TableName",
      "column": "ColumnName"
    },
    "operator": "In",
    "values": ["Value1", "Value2"]
  }
]

Supported Filter Operators

  • In - Match any value in array
  • NotIn - Exclude values in array
  • Equals - Exact match (string)
  • Contains - Substring match
  • GreaterThan - Numeric comparison
  • LessThan - Numeric comparison

Error Responses

403 Forbidden

User lacks required permissions:
{
  "message": "This action is unauthorized."
}

401 Unauthorized

Missing or invalid authentication:
{
  "message": "Unauthenticated."
}

Implementation Notes

Source: app/Http/Controllers/ReportController.php:38
  • Super admins see all reports via Report::all()
  • Regular users see only their assigned reports via auth()->user()->reports
  • Reports are eager-loaded with user, created_by, and filters relationships for admins
  • The route uses middleware: auth:sanctum, verified, and role_or_permission

Build docs developers (and LLMs) love