---
title: Create table template
url: https://anyrow.ai/docs/api/table-templates/create
canonical_url: https://anyrow.ai/docs/api/table-templates/create
---

# Create table template

`POST /v1/table-templates`

Authentication: `Authorization: ApiKey {your_api_key}`.

## Request body

Content type: `application/json` (required).

- `category` (string, required): 1 to 64 characters.
- `columns_json` (array of objects, required): 1 to 100 items.
  - `currency_code` (string, optional): Exactly 3 characters.
  - `default` (any, optional)
  - `description` (string, optional, nullable): Up to 256 characters.
  - `id` (string, required): 1 to 36 characters.
  - `instruction` (string, optional, nullable): Up to 512 characters.
  - `name` (string, required): 1 to 64 characters. Matches `^[\w\s.-]+$`.
  - `options` (array of strings, optional): Up to 500 items.
  - `required` (boolean, optional): Defaults to `false`.
  - `searchable` (boolean, optional)
  - `type` (string, optional): One of `array`, `boolean`, `currency`, `date`, `email`, `enum`, `multi_select`, `number`, `string`, `text`, `url`. Defaults to `string`.
- `description` (string, optional, nullable): Up to 512 characters.
- `insert_mode` (string, optional): One of `append`, `dedup`, `merge`, `replace`.
- `instruction` (string, optional, nullable): Up to 512 characters.
- `merge_columns_json` (array of strings, optional, nullable): At least 1 items.
- `name` (string, required): 1 to 128 characters.
- `strictness` (string, optional): One of `strict`, `balanced`, `flexible`.

## Returns

201 `application/json`: created.

- `created_at` (integer, required): At least 0.
- `updated_at` (integer, required): At least 0.
- `id` (string, required): 1 to 48 characters.
- `category` (string, required): Up to 64 characters.
- `columns_json` (array of objects, required): 1 to 100 items.
  - `currency_code` (string, optional): Exactly 3 characters.
  - `default` (any, optional)
  - `description` (string, optional, nullable): Up to 256 characters.
  - `id` (string, required): 1 to 36 characters.
  - `instruction` (string, optional, nullable): Up to 512 characters.
  - `name` (string, required): 1 to 64 characters. Matches `^[\w\s.-]+$`.
  - `options` (array of strings, optional): Up to 500 items.
  - `required` (boolean, required): Defaults to `false`.
  - `searchable` (boolean, optional)
  - `type` (string, required): One of `array`, `boolean`, `currency`, `date`, `email`, `enum`, `multi_select`, `number`, `string`, `text`, `url`. Defaults to `string`.
- `creator_display_name` (string, required, nullable): Up to 101 characters.
- `creator_user_id` (string, required, nullable): Up to 48 characters.
- `description` (string, required, nullable): Up to 512 characters.
- `insert_mode` (string, required): One of `append`, `dedup`, `merge`, `replace`.
- `instruction` (string, required, nullable): Up to 512 characters.
- `merge_columns_json` (array of strings, required, nullable): At least 1 items.
- `name` (string, required): Up to 128 characters.
- `strictness` (string, required): One of `strict`, `balanced`, `flexible`.
- `usage_count` (integer, required): At least 0.

## Errors

- 404: `not_found`

Errors every endpoint can return: [Errors](https://anyrow.ai/docs/api/errors.md).

## Request

```ts title="Node.js"
import { AnyrowSDK } from "@anyrow/sdk"

const anyrow = new AnyrowSDK({
  baseURL: "https://api.anyrow.ai",
  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },
})

const { data, error } = await anyrow.tableTemplate.create({
  json: {
    category: "string",
    columns_json: [
      {
        currency_code: "string",
        description: "string",
        id: "string",
        instruction: "string",
        name: "string",
        options: [
          "string"
        ],
        required: false,
        searchable: true,
        type: "string"
      }
    ],
    description: "string",
    insert_mode: "append",
    instruction: "string",
    merge_columns_json: [
      "string"
    ],
    name: "string",
    strictness: "strict"
  },
})
```

```bash title="cURL"
curl -X POST 'https://api.anyrow.ai/v1/table-templates' \
  -H 'Authorization: ApiKey {your_api_key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "category": "string",
  "columns_json": [
    {
      "currency_code": "string",
      "description": "string",
      "id": "string",
      "instruction": "string",
      "name": "string",
      "options": [
        "string"
      ],
      "required": false,
      "searchable": true,
      "type": "string"
    }
  ],
  "description": "string",
  "insert_mode": "append",
  "instruction": "string",
  "merge_columns_json": [
    "string"
  ],
  "name": "string",
  "strictness": "strict"
}'
```

```js title="JavaScript"
const response = await fetch("https://api.anyrow.ai/v1/table-templates", {
  method: "POST",
  headers: {
    Authorization: "ApiKey {your_api_key}",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "category": "string",
    "columns_json": [
      {
        "currency_code": "string",
        "description": "string",
        "id": "string",
        "instruction": "string",
        "name": "string",
        "options": [
          "string"
        ],
        "required": false,
        "searchable": true,
        "type": "string"
      }
    ],
    "description": "string",
    "insert_mode": "append",
    "instruction": "string",
    "merge_columns_json": [
      "string"
    ],
    "name": "string",
    "strictness": "strict"
  }),
})
const data = await response.json()
```

```python title="Python"
import requests

response = requests.post(
    "https://api.anyrow.ai/v1/table-templates",
    headers={
        "Authorization": "ApiKey {your_api_key}",
    },
    json={
        "category": "string",
        "columns_json": [
            {
                "currency_code": "string",
                "description": "string",
                "id": "string",
                "instruction": "string",
                "name": "string",
                "options": [
                    "string",
                ],
                "required": False,
                "searchable": True,
                "type": "string",
            },
        ],
        "description": "string",
        "insert_mode": "append",
        "instruction": "string",
        "merge_columns_json": [
            "string",
        ],
        "name": "string",
        "strictness": "strict",
    },
)
print(response.json())
```

## Response

```json title="201"
{
  "created_at": 1711468800000,
  "updated_at": 1711468800000,
  "id": "ttmpl_01h5a3g8k9m2n4p6q8r0t2v4x6",
  "category": "string",
  "columns_json": [
    {
      "currency_code": "string",
      "description": "string",
      "id": "string",
      "instruction": "string",
      "name": "string",
      "options": [
        "string"
      ],
      "required": false,
      "searchable": true,
      "type": "string"
    }
  ],
  "creator_display_name": "string",
  "creator_user_id": "string",
  "description": "string",
  "insert_mode": "append",
  "instruction": "string",
  "merge_columns_json": [
    "string"
  ],
  "name": "string",
  "strictness": "strict",
  "usage_count": 42
}
```
