---
title: "Mark Schema Migration Applied"
method: POST
path: "/admin/migrations/mark-applied"
tags: ["Admin"]
---

# Mark Schema Migration Applied

`POST /admin/migrations/mark-applied`

## 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/migrations/mark-applied`
- Auth: none declared

Mark one migration as applied WITHOUT running its SQL.

Escape hatch for migrations that contain DML where the data side
has already run historically (e.g. 004_add_job_videos_mapping.sql
has an INSERT … SELECT backfill that ran once in prod months ago).
The auto-detector keeps these PENDING out of safety; this endpoint
lets the operator stamp the tracking row directly.

Same shape + idempotency as ``apply``: a second call returns
``already_applied=true``. ``applied_by`` defaults to
``"manually-marked"`` so a future audit of the table shows the
provenance distinct from ``"auto-detected"`` and ``"admin"``.

## Headers

- `x-admin-user` string, nullable
- `x-admin-secret` string, nullable

## Request body

- ApplyMigrationRequest
  - `filename` string, required: Migration filename, e.g. 006_translate_kol_fields.sql
  - `target` string: Which database: 'app' (Neon, DATABASE_URL) or 'supabase'.

## 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)
