# Page Model

## Page model

### Example

```json
{
  "page": {
    "id": 22,
    "customer_ids": [447],
    "locales": ["en", "pl"],
    "products": ["default"],
    "status": "published",
    "visible_since": "2022-04-05T10:01:38.071142Z",
    "visible_until": "2022-04-19T10:01:38.071208Z",
    "sorting_priority": 1,
    "service": "store_page",
    "url": "/stores/{id}-{slug}",
    "title": { "en": "Title", "pl": "Tytuł" },
    "slug": { "en": "title", "pl": "tytul" },
    "created_at": "2022-04-12T10:01:38.071466Z",
    "updated_at": "2022-04-12T14:50:59.475870Z",
    "archived_at": null,
    "publication_status": "published",
    "components": [
      {
        "type": "html_block",
        "title": { "en": "Hi there!", "pl": "Cześć!" },
        "body": { "en": "<p>What's up?</p>", "pl": "<p>Jak leci?</p>" }
      },
      {
        "type": "carousel",
        "title": { "en": "Carousel", "pl": "Karuzela" },
        "slides": [
          {
            "layout": "full",
            "title": { 
              "text": { "en": "Title", "pl": "Tytuł" }, "color": "#ffffff"
            },
            "subtitle": { 
              "text": { "en": "Subtitle", "pl": "Subtytuł" }, "color": "#000fff"
            },
            "link": {
              "text": { "en": "Link", "pl": "Odnośnik" }, "url": "https://example.com/", "link_opens_new_tab": true
            },
            "image": { "url": "https://cdn-files.dev.placewise.com/files/J9xAojek7mlYY1oxcmlPaHpvTA" }
          }
        ]
      }
    ]
  }
}
```

### Definition

| Key              | Type                                                                              | Optional | Read-only | Description                                                                                                  |
|------------------|-----------------------------------------------------------------------------------|----------|-----------|--------------------------------------------------------------------------------------------------------------|
| id               | integer                                                                           | no       | yes       |                                                                                                              |
| customer_ids     | integer[]                                                                         | no       | no        | Customers the record is assigned to                                                                          |
| locales          | [ISO 639-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)[] | yes      | no        | [Locales](doc-341635#x-locale-header) the record is be available to in [Locales](doc-341635#x-locale-header)   |
| products         | string[]                                                                          | yes      | no        | [Products](doc-341635#x-product-name-header) the content is available for in [Products](doc-341635#x-product-name-header)                    |
| status           | enum: `['draft', 'published', 'unpublished']`                                     | no       | no        | When 'published', the record is available in [CMS Public API](doc-341653)                                   |
| visible_since    | datetime                                                                          | yes      | no        | Date since the record is visible in [CMS Public API](doc-341653)                                            |
| visible_until    | datetime                                                                          | yes      | no        | Date until the record is visible in [CMS Public API](doc-341653)                                            |
| sorting_priority | integer                                                                           | no       | no        | Priority of the record during sorting in [CMS Public API](doc-341653)                                       |
| service          | string                                                                            | yes      | yes        | See [Service Pages](doc-341710#service-pages) 
| url              | string                                                                            | no       | no        | See [URL](doc-341710#url)                                                                               |
| title            | [LocalizedContent](doc-341959#localizedcontent-json-model)                                      | yes      | no        |                                                                                                              |
| created_at       | datetime                                                                          | no       | yes       | Time of record creation                                                                                      |
| updated_at       | datetime                                                                          | no       | yes       | Time of record last update                                                                                   |
| archived_at      | datetime                                                                          | no       | yes       | Time of record archivization                                                                                 |
| publication_status| enum: `['published', 'draft', 'exipred', 'scheduled']`                            | no       | yes       | Visibility status of the record in [CMS Public API](doc-341653)   |
| components       | object[]                                                                          | yes      | yes       | List of components[^1] the Page is built of - see: [ComponentsSchema](doc-341711#componentsschema-model) |

<FootNote id="1">Only components with "general" or "page" purpose are allowed.</FootNote>

### URL

The `url` attribute specifies address of Page within the Website - it is used to [route](api-3510901) the URL to the Page.

The URL is a relative [URI Template](https://en.wikipedia.org/wiki/URI_Template), but for regular (not tied to [Service](doc-341710#service-pages)) Pages, this comes to just a plain string.    

### Service Pages

Page that have special meaning for the website may be flagged with `service` attribute. Always single one exists for given service. They're preseeded by the system and are not destroyable.

Most of them have standard URL parameters and/or must have specific [Component](doc-341711#components) attached.

<FootNote id="1">Required</FootNote>