# updateSpacePage

Save a page's next version (`html`), rename it (`title`), or both. Pass `baseVersionId` to refuse a save over a newer one. `actorGrn` (required): the dev session.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "updateSpacePage", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `input`: `UpdateSpacePageInput!` (required)
  - `itemId`: `ID!` (required)
  - `html`: `String`. New HTML as the page's next version; omitted, only the title changes.
  - `title`: `String`
  - `baseVersionId`: `ID`. The version the HTML was based on: refused (CONFLICT) when someone saved after it.
  - `actorGrn`: `String!` (required). Who is changing it: `DevSession_<sessionId>`, a dev session working for the key's owner.

## Response (data, an example)

```json
{
  "spacesMutation": {
    "updatePage": {
      "id": "<ID>",
      "spaceId": "<ID>",
      "parentId": "<ID>",
      "name": "…",
      "fileType": "…",
      "sizeBytes": 0,
      "currentVersion": {
        "id": "<ID>",
        "versionNumber": 0
      }
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "updateSpacePage",
    "variables": {
      "input": {
        "itemId": "<itemId>",
        "actorGrn": "<String>"
      }
    }
  }'
```
