---
title: "Api Refactor App Lock"
method: POST
path: "/api/apps/{app_id}/refactor"
tags: ["apps"]
---

# Api Refactor App Lock

`POST /api/apps/{app_id}/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/{app_id}/refactor`
- Auth: one of:
  - API key in header `X-API-KEY`
  - API key in cookie `Authorization`
  - OAuth 2 (password, token URL `/api/auth/token`)

Mechanically rename columns/tables in this app's locked SQL (sqlglot
AST, no LLM), re-validating each rewrite. `dry_run` returns the would-be
diff without writing.

## Path parameters

- `app_id` string, required

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