# Update a page

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

Update an existing page using the ID that was returned when created.

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

`PUT /content/pages/:id`

**cURL**

```sh
$ curl https://api.swell.store/content/pages/60f199509111e70000000022 \
  -u store-id:secret-key \
  -d title="Updated page" \
  -X PUT
```

**Node**

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

await swell.put('/content/pages/{id}', {
  id: '60f199509111e70000000022',
  title: 'Updated page'
});
```

**PHP**

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

$swell->put('/content/pages/{id}', [
  'id' => '60f199509111e70000000022',
  'title' => 'Updated page'
]);
```

## Example response

```json
{
  "id": "60f199509111e70000000022",
  "title": "Updated page",
  "slug": "example-page",
  "content": "<p>Welcome to our store.</p>",
  "published": true,
  "date_published": "2021-07-16T14:36:00.142Z",
  "meta_title": "Example page",
  "meta_description": null,
  "date_created": "2021-07-16T14:36:00.142Z",
  "date_updated": "2021-07-18T09:12:04.481Z"
}
```
