Create Table

Create a new table in a workspace. Define the table schema with typed columns, optional constraints (required, unique), and a name.

POST/api/v1/tables
X-API-Key<token>

Your Sim API key (personal or workspace). Generate one from the Sim dashboard under Settings > API Keys.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST \  "https://www.sim.ai/api/v1/tables" \  -H "X-API-Key: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "workspaceId": "YOUR_WORKSPACE_ID",    "name": "contacts",    "description": "Customer contacts",    "schema": {      "columns": [        { "name": "email", "type": "string", "required": true, "unique": true },        { "name": "name", "type": "string", "required": true },        { "name": "age", "type": "number" }      ]    }  }'
{
  "success": true,
  "data": {
    "table": {
      "id": "tbl_abc123",
      "name": "contacts",
      "description": "Customer contacts",
      "schema": {
        "columns": [
          {
            "name": "email",
            "type": "string",
            "required": true,
            "unique": true
          }
        ]
      },
      "rowCount": 0,
      "maxRows": 10000,
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-15T10:30:00Z"
    },
    "message": "Table created successfully"
  }
}
{
  "error": "string",
  "details": [
    {}
  ]
}
{
  "error": "string"
}
{
  "error": "string"
}
{
  "error": "string"
}