Admin

Apply Schema Migration

Apply one migration file end-to-end. Idempotent: a second call with the same filename returns already_applied=true and does no work.

Returns error (non-null) if the SQL execution failed — the response wire is still 200 so the UI can show the message inline. The whole file rolls back on any error; the tracking row is only inserted after every statement succeeds.

post/admin/migrations/apply

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/apply
  • Auth: none declared

Headers

x-admin-userstring nullable
x-admin-secretstring nullable

Request body

filenamestring required

Migration filename, e.g. 006_translate_kol_fields.sql

targetstring

Which database: 'app' (Neon, DATABASE_URL) or 'supabase'.

Response

Successful Response

object required

Changes

No recorded changes to this operation across all 1 revision of this API.