Skip to main content

Create Report

Create a new Power BI report entry in the system.
POST /reports

Authentication & Permissions

Authorization
string
required
Valid session or Sanctum token
Requires one of:
  • super-admin role
  • report.create permission
  • report.edit permission

Request Body

name
string
required
Display name for the report
group_id
string
required
Power BI workspace/group ID (UUID format)
report_id
string
required
Power BI report ID (UUID format)
dataset_id
string
required
Power BI dataset ID (UUID format)
access_level
string
default:"View"
Access level for the report (typically “View”)

Response

status
integer
HTTP status code (200 on success)
data
array
Array of all reports accessible to the user (including newly created)

Example Request

curl -X POST https://your-domain.com/reports \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Q1 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"
  }'

Example Response

[
  {
    "id": 1,
    "name": "Existing 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",
    "user_id": 1,
    "created_at": "2026-01-15 14:30:00",
    "updated_at": "2026-01-15 14:30:00"
  },
  {
    "id": 2,
    "name": "Q1 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",
    "user_id": 1,
    "created_at": "2026-03-04 10:15:00",
    "updated_at": "2026-03-04 10:15:00"
  }
]

Update Report

Update an existing Power BI report entry.
PUT /reports/{id}

Path Parameters

id
integer
required
Report database ID

Request Body

Same fields as create (all optional for updates):
name
string
Updated display name
group_id
string
Updated Power BI workspace ID
report_id
string
Updated Power BI report ID
dataset_id
string
Updated Power BI dataset ID
access_level
string
Updated access level

Example Request

curl -X PUT https://your-domain.com/reports/2 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Q1 Sales Dashboard - Updated"
  }'

Response

Returns array of all accessible reports with updates applied (200 status).

Delete Report

Delete a Power BI report entry from the system.
DELETE /reports/{id}

Path Parameters

id
integer
required
Report database ID to delete

Permissions

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

Example Request

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

Response

Returns array of remaining accessible reports (200 status).
[
  {
    "id": 1,
    "name": "Existing 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",
    "user_id": 1
  }
]

Implementation Notes

Source: app/Http/Controllers/ReportController.php:105-153

Automatic Fields

  • user_id is automatically set to the authenticated user’s ID
  • created_at and updated_at timestamps are managed by Laravel
  • token and expiration_date are managed by the Power BI integration trait

Response Behavior

  • Super admins receive reports with user, created_by, and filters relationships
  • Regular users receive only their assigned reports without eager loading

Validation

While not explicitly shown in the controller, these fields are fillable:
  • name, group_id, report_id, access_level, dataset_id, user_id, token, expiration_date

Error Responses

403 Forbidden

{
  "message": "This action is unauthorized."
}

404 Not Found (Update/Delete)

{
  "message": "Report not found."
}

422 Validation Error

{
  "message": "The given data was invalid.",
  "errors": {
    "name": ["The name field is required."],
    "group_id": ["The group id field is required."]
  }
}

Build docs developers (and LLMs) love