> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Table

> Create a persistent table for a linked account.

Create a persistent table with a set of columns for a linked account. Up to 20 columns can be defined at creation; add more later with [Add Columns](/v3/api-reference/persistent-tables/add-columns).

## Authentication

<ParamField header="x-api-key" type="string" required>Your Refold API key.</ParamField>
<ParamField header="linked_account_id" type="string" required>The linked account the table belongs to.</ParamField>

## Body Parameters

<ParamField body="table_name" type="string" required>Name of the table. **Example:** `leads`</ParamField>

<ParamField body="columns" type="array" required>
  Column definitions (max 20), each an object with a `column_name`.
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="table_id" type="string">The ID of the new table.</ResponseField>
  </Tab>

  <Tab title="400 Bad Request">
    <ResponseField name="status_code" type="integer">HTTP status code.</ResponseField>
    <ResponseField name="http_error_type" type="string">Error category.</ResponseField>
    <ResponseField name="error_code" type="string">Internal error code.</ResponseField>
    <ResponseField name="message" type="string">Human-readable error description.</ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 theme={null}
  {
    "table_id": "6a314fc3d396207fd2506a0a"
  }
  ```

  ```json 400 theme={null}
  {
    "status_code": 400,
    "http_error_type": "BAD_REQUEST",
    "error_code": "SERVER_ERROR",
    "message": "table_name and columns are required"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://app.refold.ai/api/v2/public/tables" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
    -H "Content-Type: application/json" \
    -d '{
      "table_name": "leads",
      "columns": [ { "column_name": "email" }, { "column_name": "stage" } ]
    }'
  ```
</RequestExample>
