---
title: "Modify a table"
method: POST
path: "/databases/{id}/tables/modify"
tags: ["Database"]
---

# Modify a table

`POST /databases/{id}/tables/modify`

Modify an existing table in the database

## Path parameters

- `id` string, required — MongoDB ObjectId represented as a hexadecimal string

## Request body

- object
  - `name` string — Table name
  - `columns` object[]
    - `name` string — Column name
    - `new_name` string — New column name (for rename operations)
    - `type` string — Column data type
    - `action` 'add' | 'modify' | 'drop' — Action to perform on the column

## Response `200`

Table modified successfully

- Success
  - `code` integer
  - `message` string
  - `data` object

## Changes

- **2025-03-02** `526e5bdf6dee` — 2 breaking, 4 warning, 11 info
  - request body became required
  - added the pattern `^[0-9a-fA-F]{24}$` to the `path` request parameter `id`
  - removed the request property `database_name`
  - removed the request property `table`
  - …13 more

[Change history](https://skmtc.dev/crawlab-team/apis/crawlab-api/changes/databases/:id/tables/modify/post.md)

---

[API](https://skmtc.dev/crawlab-team/apis/crawlab-api.md) · [All operations](https://skmtc.dev/crawlab-team/apis/crawlab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crawlab-team/crawlab-api/revisions/526e5bdf6dee/schema)
