Save a new version of a page's code
Save a new version without overwriting; the page points to the latest version.
PUT/v1/apps/{appId}/pages/{pageId}/code
Include a note explaining why for the history. Send baseVersion (the page’s version when read) to receive 409 if someone has saved since, rather than burying their version.
Requires the pages:write scope. Operation pages.code.set. MCP tool pages_code_set. CLI: grid82 pages code set (npx grid82).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | string | yes | |
pageId | 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 |
|---|---|---|---|
source | string | yes | Up to 400000 characters. |
note | string | no | Up to 200 characters. |
via | “assistant” or “hand” or “api” or “restore” | no | |
baseVersion | integer | no | At least 0. |
Response
Success
dataobjectrequiredRefused
errorobjectrequired