---
title: "Data Isolation Backfill Workspaces"
method: POST
path: "/admin/data-isolation/backfill-workspaces"
tags: ["Admin"]
---

# Data Isolation Backfill Workspaces

`POST /admin/data-isolation/backfill-workspaces`

## Request

- Base URL: `https://api.kolens.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolens.ai/admin/data-isolation/backfill-workspaces`
- Auth: none declared

Stamp ``workspace_id`` on legacy ``user_discoveries`` rows.

For every row with ``workspace_id IS NULL``, sets it to the
discovering user's Personal workspace (created on demand). Safe to
run twice — the second pass updates zero rows.

Returns counts: ``rows_examined``, ``rows_updated``, ``users_seen``,
``dry_run``. ``dry_run=true`` counts what WOULD be written without
writing — same shape as ``/data-isolation/backfill``.

## Query parameters

- `dry_run` boolean

## Headers

- `x-admin-secret` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kolens/apis/kolens-api.md) · [All operations](https://skmtc.dev/kolens/apis/kolens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kolens/apis/kolens-api/revisions/5d6865ab0a24?raw)
