# Create a page

Source: https://developers.swell.is/backend-api/pages/create-a-page

Create a new content page.

## Arguments

- `id` (objectId, required): Unique identifier for the page.
- `slug` (string, auto): Slug identifier of the page. Defaults to a slug-formatted version of the `title`.
- `title` (string, required): Title of the page.
- `content` (string): HTML or text content of the page.
- `published` (boolean): Indicates whether the page is published and should be displayed in the storefront.
- `date_published` (date): Date the page was published. May be used to indicate the publish date in the storefront, or to delay publishing until a future date.
- `meta_title` (string): Title used for SEO purposes, if different than the page `title`.
- `meta_description` (string): Description used for SEO purposes. Typically the storefront will use a number of characters from the page's `content` if this is not defined.
- `meta_keywords` (string): Keywords used for SEO purposes.
- `theme_template` (string): Template used to render this page in a storefront theme, if applicable.

## Example request

`POST /content/pages`

**cURL**

```bash
$ curl https://api.swell.store/content/pages \
  -u store-id:secret-key \
  -d title="Example page"
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.post('/content/pages', {
  title: 'Example page'
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->post('/content/pages', [
  'title' => 'Example page'
]);
```

## Example response

```json
{
  "id": "60f199509111e70000000022",
  "title": "Example page",
  "slug": "example-page",
  "content": null,
  "published": true,
  "date_published": "2021-07-16T14:36:00.142Z",
  "meta_title": null,
  "meta_description": null,
  "date_created": "2021-07-16T14:36:00.142Z",
  "date_updated": "2021-07-16T14:36:00.142Z"
}
```
