# Assets

***

## Endpoints

| Method   | Path                          | Permission       | Description                                       |
| -------- | ----------------------------- | ---------------- | ------------------------------------------------- |
| `GET`    | `/api/assets`                 | `assets:read`    | List all assets                                   |
| `GET`    | `/api/assets/:id`             | `assets:read`    | Get asset by ID                                   |
| `POST`   | `/api/assets`                 | `assets:write`   | Register a new asset                              |
| `PUT`    | `/api/assets/:id`             | `assets:write`   | Update asset                                      |
| `DELETE` | `/api/assets/:id`             | `assets:delete`  | Delete asset and all its monitors                 |
| `GET`    | `/api/assets/incident-counts` | `assets:read`    | Incident counts per asset grouped by monitor type |
| `GET`    | `/api/assets/scan-status`     | `assets:read`    | Current and last scan run per asset               |
| `GET`    | `/api/assets/metadata`        | `assets:read`    | Batch asset metadata for all assets               |
| `GET`    | `/api/assets/:id/metadata`    | `assets:read`    | Monitoring metadata for one asset                 |
| `GET`    | `/api/assets/:id/incidents`   | `incidents:read` | Incident counts for a specific asset              |
| `GET`    | `/api/assets/:id/columns`     | `assets:read`    | Live column schema from Fabric                    |

***

## GET /api/assets

List all assets for the current tenant.

**Query parameters:** `page`, `pageSize`, `search`, `sortBy`, `sortOrder`

**Response (200):**

```json
{
  "data": [
    {
      "id": "uuid",
      "workspaceId": "workspace-uuid",
      "lakehouseId": "lakehouse-uuid",
      "tableName": "orders",
      "displayName": "Orders Table",
      "description": "Core orders table",
      "tags": ["production", "critical"],
      "itemType": "Lakehouse",
      "schemaName": "dbo",
      "createdAt": "2026-03-01T10:00:00Z",
      "updatedAt": "2026-03-24T08:00:00Z"
    }
  ],
  "error": null,
  "meta": { "requestId": "...", "timestamp": "...", "pagination": { "page": 1, "pageSize": 25, "total": 12, "totalPages": 1 } }
}
```

***

## POST /api/assets

Register a Fabric table as a monitored asset.

**Request:**

```json
{
  "workspaceId": "workspace-uuid",
  "lakehouseId": "lakehouse-or-warehouse-uuid",
  "tableName": "orders",
  "displayName": "Orders Table",
  "description": "Core orders table",
  "tags": ["production"],
  "itemType": "Lakehouse",
  "schemaName": "dbo"
}
```

**Response (201):** Asset object (same shape as GET response item).

***

## GET /api/assets/scan-status

Returns the current and last completed scan run for every asset. Used by the Monitor Dashboard to show live scan progress.

**Response (200):**

```json
{
  "data": [
    {
      "assetId": "uuid",
      "assetName": "orders",
      "status": "running",
      "lastCompletedAt": "2026-03-24T08:30:00Z",
      "currentRun": {
        "jobId": "batch-uuid",
        "status": "running",
        "startedAt": "2026-03-24T09:00:00Z",
        "finishedAt": null,
        "progress": {
          "total": 4,
          "completed": 1,
          "running": 2,
          "failed": 0,
          "pending": 1
        },
        "monitors": [
          {
            "monitorId": "uuid",
            "monitorName": "Record Count",
            "stage": "completed",
            "durationMs": 1200,
            "query": "dbo.orders | count",
            "attribute": null,
            "error": null
          }
        ]
      },
      "lastRun": {
        "jobId": "batch-uuid-prev",
        "status": "completed",
        "startedAt": "2026-03-24T08:00:00Z",
        "finishedAt": "2026-03-24T08:30:00Z",
        "progress": { "total": 4, "completed": 4, "running": 0, "failed": 0, "pending": 0 },
        "monitors": []
      }
    },
    {
      "assetId": "uuid-2",
      "assetName": "customers",
      "status": "idle",
      "lastCompletedAt": null,
      "currentRun": null,
      "lastRun": null
    }
  ]
}
```

**Notes:**

* `status` values: `idle` | `running` | `completed` | `failed` | `partial_failure`
* Assets with no scan runs return `status: "idle"` and null runs
* Stale scan runs map to `stage: "failed"` with error `SCAN_TIMEOUT`
* Response limited to the latest 2 batches per asset


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fabric-docs.telm.ai/api-reference/assets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
