> ## 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.

# Create Page

> Create a new page

# Create Page

Creates a new page in the store.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.launchmystore.io/api/v1/pages.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Shipping Policy",
      "content": "<h2>Shipping Information</h2><p>We ship worldwide...</p>"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/pages.json', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'Shipping Policy',
      content: '<h2>Shipping Information</h2><p>We ship worldwide...</p>'
    })
  });
  ```
</CodeGroup>

## Body Parameters

Only the fields listed below are persisted. Any other keys in the body are ignored.

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

<ParamField body="handle" type="string">
  URL-safe handle. Auto-generated from the title if not provided.
</ParamField>

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

<ParamField body="templateSuffix" type="string">
  Custom template suffix (e.g., `contact` for `page.contact.liquid`)
</ParamField>

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

<ParamField body="showtitle" type="boolean" default="true">
  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 (`201` 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 created `page` object
</ResponseField>

## Example Response

```json theme={null}
{
  "status": 201,
  "state": "success",
  "message": null,
  "data": {
    "page": {
      "pageId": "8f3c2a91-7d4e-4b6a-9c1f-2e5d8a0b3c7e",
      "id": "473829",
      "title": "Shipping Policy",
      "handle": "shipping-policy",
      "templateSuffix": null,
      "link": null,
      "content": "<h2>Shipping Information</h2><p>We ship worldwide...</p>",
      "seoTitle": null,
      "seoDesc": null,
      "seoImage": null,
      "showtitle": true,
      "storeId": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
      "createdAt": "2024-03-20T10:00:00.000Z",
      "updatedAt": "2024-03-20T10:00:00.000Z"
    }
  },
  "pagination": null
}
```

## Error Response

When `title` is missing or blank, the request returns a `400` envelope:

```json theme={null}
{
  "status": 400,
  "state": "error",
  "message": "Missing required field: title",
  "data": null
}
```

## Error Codes

| Status | State   | Description                            |
| ------ | ------- | -------------------------------------- |
| `401`  | `error` | Invalid or missing access token        |
| `403`  | `error` | App doesn't have `write_content` scope |
| `400`  | `error` | Missing required field (e.g. `title`)  |
