> ## Documentation Index
> Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Page

> Update an existing page

# Update Page

Updates an existing page. Only provided fields are updated.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.launchmystore.io/api/v1/pages/8f3c2a91-7d4e-4b6a-9c1f-2e5d8a0b3c7e.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "About Our Company",
      "content": "<h2>Our Updated Story</h2><p>We have grown significantly...</p>"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/pages/8f3c2a91-7d4e-4b6a-9c1f-2e5d8a0b3c7e.json', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'About Our Company',
      content: '<h2>Our Updated Story</h2><p>We have grown significantly...</p>'
    })
  });
  ```
</CodeGroup>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique page ID (`pageId`) to update
</ParamField>

## Body Parameters

All parameters are optional. Only provided fields are updated; any keys not listed below are ignored.

<ParamField body="title" type="string">
  The page title
</ParamField>

<ParamField body="handle" type="string">
  URL-safe handle
</ParamField>

<ParamField body="content" type="string">
  Page content (HTML)
</ParamField>

<ParamField body="templateSuffix" type="string">
  Custom template suffix
</ParamField>

<ParamField body="link" type="string">
  Optional external link for the page
</ParamField>

<ParamField body="showtitle" type="boolean">
  Whether to display the page title on the storefront
</ParamField>

<ParamField body="seoTitle" type="string">
  Custom page title for search engines
</ParamField>

<ParamField body="seoDesc" type="string">
  Meta description for search engines
</ParamField>

<ParamField body="seoImage" type="string">
  Open Graph / social share image URL
</ParamField>

## Response

<ResponseField name="status" type="integer">
  HTTP status code (`200` on success)
</ResponseField>

<ResponseField name="state" type="string">
  Outcome state, `success` on success
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable message, `null` on success
</ResponseField>

<ResponseField name="data" type="object">
  Wrapper containing the updated `page` object
</ResponseField>

## Example Response

```json theme={null}
{
  "status": 200,
  "state": "success",
  "message": null,
  "data": {
    "page": {
      "pageId": "8f3c2a91-7d4e-4b6a-9c1f-2e5d8a0b3c7e",
      "id": "473829",
      "title": "About Our Company",
      "handle": "about-us",
      "content": "<h2>Our Updated Story</h2><p>We have grown significantly...</p>",
      "templateSuffix": null,
      "link": null,
      "showtitle": true,
      "seoTitle": "About Us | MyStore",
      "seoDesc": "Learn about our story, mission, and commitment to quality.",
      "seoImage": null,
      "storeId": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
      "createdAt": "2024-01-01T10:00:00.000Z",
      "updatedAt": "2024-03-20T15:30:00.000Z"
    }
  },
  "pagination": null
}
```

## Error Response

When no page matches the ID for the store, the request returns a `404` envelope:

```json theme={null}
{
  "status": 404,
  "state": "error",
  "message": "Page not found",
  "data": null
}
```

## Notes

* Changing the handle will break existing links to the page.
* Navigation menu links may need to be updated if the handle changes.

## Error Codes

| Status | State   | Description                               |
| ------ | ------- | ----------------------------------------- |
| `401`  | `error` | Invalid or missing access token           |
| `403`  | `error` | App doesn't have `write_content` scope    |
| `404`  | `error` | Page with the specified ID does not exist |
