---
title: "Refresh Dataset"
method: GET
path: "/api/PowerBiApp/RefreshDataset"
tags: ["PowerBiApp"]
---

# Refresh Dataset

`GET /api/PowerBiApp/RefreshDataset`

Refreshes a Power BI dataset for a specific customer and firm.

This endpoint decodes the provided customer key and report code, retrieves relevant customer and 
workspace details, and triggers a dataset refresh in Power BI using the specified report code.

Args:
    request (Request): The HTTP request object.
    customer_key (Annotated[Union[str], Header]): A base64 encoded string containing 'lscode' and 'firmcode'.
    report_code (Annotated[Union[str], Header]): A base64 encoded report code.
    db (Session): The database session dependency.

Returns:
    JSONResponse: A response indicating the success or failure of the dataset refresh operation. 
    It returns a success message if the refresh request is accepted by Power BI, otherwise an error message.

Raises:
    HTTPException: If settings could not be retrieved, customer or firm details are not found.
    JSONResponse: For any other exceptions during the process with a 500 status code.

## Headers

- `customer-key` string, required
- `report-code` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) · [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/leapsurgebi/leapsurgeapi/revisions/5a6b1464bfeb/schema)
