---
title: "Create a new table in workspace"
method: POST
path: "/workspaces/{workspace_id}/tables"
tags: ["tables"]
---

# Create a new table in workspace

`POST /workspaces/{workspace_id}/tables`

Creates a new table with the deeplake access method using the provided schema. The table schema is specified as a map of column names to column definitions.

## Path parameters

- `workspace_id` string, required

## Request body

- GithubComActiveloopaiDeeplakeApiInternalTablesCreateTableRequest
  - `columns` string[] — Optional: explicit column order. If not provided, columns are sorted alphabetically
  - `table_name` string
  - `table_schema` object — column_name -> column_definition

## Response `201`

Table created successfully with schema details

- GithubComActiveloopaiDeeplakeApiInternalTablesTableSchema
  - `columns` GithubComActiveloopaiDeeplakeApiInternalTablesTableColumn[]
    - `default` string — Nullable
    - `name` string
    - `nullable` boolean
    - `type` string
  - `row_count` integer — Nullable
  - `table_name` string

## Other responses

- `400` — Invalid request (bad workspace ID, invalid body, or invalid table schema)
- `401` — Unauthorized - missing or invalid authentication
- `403` — Access denied - user does not have access to this workspace
- `404` — Workspace schema not found
- `500` — Internal server error - table creation failed

---

[API](https://skmtc.net/deeplake/apis/deeplake-api.md) · [All operations](https://skmtc.net/deeplake/apis/deeplake-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeplake/deeplake-api/revisions/e16ed11d991c/schema)
