Single Table Column
https://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_name/columns/column_name
This endpoint allows working with a single column from a given table.
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 |
column_name | The Column name | path | ✅ | string |
Get Column Information
GEThttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_name/columns/column_name
Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example address.country
.
Status Code | Description | Example Response/Type Definition |
---|---|---|
200 | OK |
|
400 | Bad Request |
|
401 | Authentication Error |
|
404 | Example response |
|
5XX | Unexpected Error |
Update Column
PATCHhttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_name/columns/column_name
Update column with partial data. Can be used for renaming the column by providing a new "name" field. To refer to sub-objects, the column name can contain dots. For example address.country
.
Request Body Example
{
"name": "newName",
"description": "Sample new description"
}
Request Body Type Definition
1 2 3 4 5 6 7 8 9
/** * @example {"name":"newName","description":"Sample new description"} */ type UpdateColumn = { /* * @minLength 1 */ name: string; };
Status Code | Description | Example Response/Type Definition |
---|---|---|
200 | Schema migration response with ID and migration status. |
|
400 | Bad Request |
|
401 | Authentication Error |
|
404 | Example response |
|
5XX | Unexpected Error |
Delete Column
DELETEhttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_name/columns/column_name
Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example address.country
.
Status Code | Description | Example Response/Type Definition |
---|---|---|
200 | Schema migration response with ID and migration status. |
|
400 | Bad Request |
|
401 | Authentication Error |
|
404 | Example response |
|
5XX | Unexpected Error |