---
title: "Add a page"
description: "Create a page definition with its name, mode, roles that can see it, and optional associated table."
canonical: "https://grid82.com/docs/builder-api/pages/create"
updated: "2026-11-13"
---

# Add a page

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

Create a page definition with its name, mode, roles that can see it, and optional associated table.

It has no code; save a version with `pages.code.set` or ask the assistant to draft one.

Requires the `pages:write` scope. Operation `pages.create`. MCP tool `pages_create`. CLI: `grid82 pages create` (`npx grid82`).

## 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          |
| ----------- | ----------------------- | -------- | -------------------- |
| `name`      | string                  | yes      | Up to 60 characters. |
| `kind`      | "declarative" or "code" | no       | Default `"code"`.    |
| `mode`      | "locked" or "template"  | no       | Default `"locked"`.  |
| `tableId`   | string                  | no       | Up to 64 characters. |
| `visibleTo` | "\*" or string\[]       | no       | Default `"*"`.       |

**Authorizations**

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

## Response

**201**: Success

- `data` (`object`, required)
- `data.id` (`string`, required, length: `1–64 chars`)
- `data.name` (`string`, required, length: `1–120 chars`)
- `data.kind` (`enum<string>`, required, one of: `declarative, code`)
- `data.mode` (`enum<string>`, required, one of: `locked, template, canvas`)
- `data.owner` (`enum<string>`, required, one of: `admin, user`)
- `data.ownerUserId` (`string`, length: `≤ 64 chars`)
- `data.tableId` (`string`, pattern: `^[a-z][a-z0-9_]{0,62}$`)
- `data.forkedFrom` (`string`, length: `≤ 64 chars`)
- `data.visibleTo` (`string | string[]`, required, default: `*`)
- `data.reads` (`object`)
- `data.reads.tables` (`string[]`, required, default: `[]`)
- `data.reads.fields` (`string[]`, required, default: `[]`)
- `data.reads.views` (`string[]`, required, default: `[]`)
- `data.bundleHash` (`string`, length: `≤ 128 chars`)
- `data.publishedVersion` (`integer`, range: `≥ 1`)
- `data.theme` (`object`)
- `data.theme.accent` (`string`, pattern: `^(?:#[0-9a-fA-F]{3,8}|oklch\([0-9.%\s/]{1,60}\))$`)
- `data.theme.radius` (`number`, range: `0–24`)
- `data.document` (`object`)
- `data.version` (`integer`, required, default: `1`, range: `≥ 1`)
- `data.updatedAt` (`string`, required)

```json
{
  "data": {
    "id": "<string>",
    "name": "<string>",
    "kind": "declarative",
    "mode": "locked",
    "owner": "admin",
    "ownerUserId": "<string>",
    "tableId": "<string>",
    "forkedFrom": "<string>",
    "visibleTo": "*",
    "reads": {
      "tables": [],
      "fields": [],
      "views": []
    },
    "bundleHash": "<string>",
    "publishedVersion": 123,
    "theme": {
      "accent": "<string>",
      "radius": 123.45
    },
    "document": null,
    "version": 1,
    "updatedAt": "<string>"
  }
}
```

**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>/pages' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>"
}'
```
