---
title: "Api Refactor Org Locks"
method: POST
path: "/api/apps/refactor"
tags: ["apps"]
---

# Api Refactor Org Locks

`POST /api/apps/refactor`

## Request

- Base URL: `https://app.getdot.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.getdot.ai/api/apps/refactor`
- Auth: one of:
  - API key in header `X-API-KEY`
  - API key in cookie `Authorization`
  - OAuth 2 (password, token URL `/api/auth/token`)

Org-wide mechanical rename across every app's locked SQL — the
data-model refactor sweep (docs/apps-compiled-spec.md §6). sqlglot AST,
no LLM; each rewrite re-validated. Admin only; `dry_run` previews.

## Request body

- RefactorLockRequest: Mechanical rename spec: entries of {column, new_column, table?} and/or {table, new_table}.
  - `renames` object[]
  - `dry_run` boolean

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

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