---
title: "Add several related tables at once"
description: "Add several related tables at once"
canonical: "https://grid82.com/docs/builder-api/tables/create-many"
updated: "2026-11-20"
---

# Add several related tables at once

`POST https://studio.grid82.app/v1/apps/{appId}/tables/batch`

Add several related tables at once

Create up to 20 tables in one change, links between them included: a `link` field's `config.tableId` may be the NAME (or plural) of a table in this same call, or of one that already exists, so no order and no follow-up `fields.create` is needed. Prefer it to several `tables.create` whenever a request needs more than one table (a CRM, an inventory). Each field is `{ name, type, config? }`; `fields.types` lists the settings each type takes. Omit every `id` to receive minted `tbl_…` and `fld_…` ids, in the order sent. All or nothing: one refused table creates none.

Requires the `schema:write` scope. Operation `tables.createMany`. MCP tool `tables_createMany`. CLI: `grid82 tables create-many` (`npx @grid82/cli`).

## Path parameters

| Name    | Type   | Required | Description |
| ------- | ------ | -------- | ----------- |
| `appId` | string | yes      |             |

## Headers

| Name              | Type   | Required | Description                                                                                                                                                                                                                                                        |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Idempotency-Key` | string | no       | Any unique string. Sending the same key with the same request again returns the first response (marked `Idempotency-Replayed: true`) instead of running it twice. Reusing it for a different request is refused with 409. Kept for 24 hours. Up to 255 characters. |

## Request body

| Field    | Type      | Required | Description    |
| -------- | --------- | -------- | -------------- |
| `tables` | object\[] | yes      | 1 to 20 items. |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**201**: Success

- `data` (`object[]`, required)
- `data.id` (`string`, required, pattern: `^[a-z][a-z0-9_]{0,62}$`)
- `data.name` (`string`, required, length: `1–120 chars`)
- `data.plural` (`string`, length: `1–120 chars`)
- `data.description` (`string`, length: `≤ 2000 chars`)
- `data.icon` (`string | null`)
- `data.primaryFieldId` (`string`, required, pattern: `^[a-z][a-z0-9_]{0,62}$`)
- `data.fields` (`object[]`, required, items: `1–200 items`)
- `data.fields.id` (`string`, required, pattern: `^[a-z][a-z0-9_]{0,62}$`)
- `data.fields.name` (`string`, required, length: `1–120 chars`)
- `data.fields.width` (`integer`, range: `60–900`)
- `data.fields.type` (`string`, required)
- `data.fields.config` (`object`, required, default: `{}`)

```json
{
  "data": [
    {
      "id": "<string>",
      "name": "<string>",
      "plural": "<string>",
      "description": "<string>",
      "icon": "<string>",
      "primaryFieldId": "<string>",
      "fields": [
        {
          "id": "<string>",
          "name": "<string>",
          "width": 123,
          "type": "<string>",
          "config": {}
        }
      ]
    }
  ]
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://studio.grid82.app/v1/apps/<appId>/tables/batch' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "tables": [
    {
      "name": "<string>",
      "fields": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ]
    }
  ]
}'
```
