---
title: "Re-fit the Archive Map's basis (moves every point)"
method: POST
path: "/v2/workspaces/{id}/projection/refit"
tags: ["Memories"]
---

# Re-fit the Archive Map's basis (moves every point)

`POST /v2/workspaces/{id}/projection/refit`

## Request

- Base URL: `https://api.infolang.ai`
- URL: `https://api.infolang.ai/v2/workspaces/{id}/projection/refit`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

DESTRUCTIVE TO POSITIONS, deliberately explicit. Re-fits the PCA basis at the current `corpus_version` and answers with the map it just fitted. Every point in the namespace moves, for every member of the workspace — warn the user before calling it.

A separate route rather than `?refit=true` on the GET so that a fumbled query string on a read can never reshuffle a map, and so a read-only client cannot express the operation at all.

Requires `memories:write`, which is STRICTER than the `memories:read` Kairos itself asks for: the basis is shared process state keyed by (workspace, namespace), so re-fitting mutates what every other member sees. ReadOnly members, and credentials consented to `memories:read` only, may draw the map but not move it.

Body `{ns}` — absent re-fits EVERY namespace in the workspace. On success the gateway drops its cached maps for that namespace across all credential ceilings, so no client keeps serving the old positions.

Requires the `memories:write` scope. Accepts all three lanes: a session JWT (bounded by the caller's role on this workspace) or an `il_*` machine credential whose own scope set, workspace set and validity window cover it — both ceilings apply and neither can raise the other, so a credential carrying `memories:write` is still refused where the role does not permit it.

A credential with no scope record resolves to `LEGACY_DEFAULT`, which INCLUDES `memories:write` — every key minted before scoping keeps working here.

## Path parameters

- `id` string, required

## Request body

- object
  - `ns` string

## Response `200`

The freshly fitted map

- object
  - `namespaces` object[], required
    - `namespace` string, required
    - `count` integer, required
    - `skipped` integer, required
    - `corpus_version` number, required
    - `basis_version` number, required
    - `basis_stale` boolean, required
    - `basis_memories` integer, required
    - `variance_explained` number[], required
    - `degenerate_axes` boolean[], required
    - `out_of_extent` integer, required
    - `points` object[], required
      - `id` string, required
      - `x` number, required
      - `y` number, required
      - `properties` object
  - `cache` object, required
    - `hit` boolean, required
    - `age_ms` integer, required
    - `ttl_ms` integer, required
    - `corpus_versions` object, required
    - `basis_versions` object, required

## Other responses

- `401`: Missing/invalid credential
- `403`: The credential holds no grant on this workspace. Or `lane_not_supported` — the credential is well-formed but this route does not accept its lane
- `502`: Upstream Kairos failure

---

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