Database Table by Name
https://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_nameThis endpoint provides a way to mutate a specific table on a database.
Expected parameters
| Name | Description | In | Required | Schema |
|---|---|---|---|---|
db_branch_name | The DBBranchName matches the pattern `{db_name}:{branch_name}`. | path | ✅ | string |
table_name | The Table name | path | ✅ | string |
Create Table
PUThttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_nameCreates a new table with the given name. Returns 422 if a table with the same name already exists.
Responses
Delete Table
DELETEhttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_nameDeletes the table with the given name.
Responses
Update Table
PATCHhttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_nameUpdate table. Currently there is only one update operation supported: renaming the table by providing a new name. In the example below, we rename a table from “users” to “people”: ```json // PATCH /db/test:main/tables/users { "name": "people" } ```