---
title: "Create a Page"
method: POST
path: "/pages"
tags: ["Pages"]
---

# Create a Page

`POST /pages`

Create a new Page in a provided Project

## Request body

- Page
  - `activation_code` string — Stringified Javascript function that determines when the Page is activated. Only required when activation_type is 'polling' or 'callback'.
  - `activation_type` 'immediate' | 'manual' | 'polling' | 'callback' | 'dom_changed' | 'url_changed' — Page activation type is a trigger that determines when the page is activated. Triggers tell Optimizely when to start checking whether certain conditions are true 'Immediate' activation mode activates the page as soon as the snippet loads. 'Polling' activation mode polls every 50ms until 'activation_code' evaluates to True, then activates the page. 'Callback' activation mode activates the page when the event defined by 'activation_code' is triggered. 'Manual' activation mode requires code within the subject app to explicitly trigger page activation. 'DOM Changed' sets the page to trigger when the DOM changes [Learn more](https://help.optimizely.com/Build_Campaigns_and_Experiments/Support_for_dynamic_websites%3A_Use_Optimizely_on_single_page_applications#Triggers). 'URL Changed' sets the page to trigger when the URL changes [Learn more](https://help.optimizely.com/Build_Campaigns_and_Experiments/Support_for_dynamic_websites%3A_Use_Optimizely_on_single_page_applications#Triggers).
  - `archived` boolean — Whether the Page has been archived
  - `category` 'article' | 'cart' | 'category' | 'checkout' | 'home' | 'landing_page' | 'pricing' | 'product_detail' | 'search_results' | 'other' — The category this Page is grouped under
  - `conditions` string — Stringified array of the conditions that activate the Page. The array contains Page Condition JSON dicts joined by "and" and "or". Each individual Page Condition dict has format {"type": "url", "match_type": <match_type>, "value": <value>} where match_types are: "simple" match type will match if "value" matches the hostname and path of the Page URL. "exact" match type will match only an exact string match between "value" and the Page URL. "substring" match type will match if "value" is a substring of the Page URL. "regex" match type will match if "value" is a regular expression match for the Page URL.
  - `created` string, date-time — Date created
  - `edit_url` string, required — URL of the Page
  - `experiment_count` integer — Number of experiments that reference this Page across all statuses (running, paused, draft, archived). Computed by the upstream service.
  - `id` integer — The unique identifier of the Page
  - `key` string — Unique string identifier for this Page within the Project
  - `last_modified` string, date-time — Date last modified
  - `name` string, required — Name of the Page
  - `page_type` 'single_url' | 'url_set' | 'global' — Type of Page
  - `project_id` integer, required — ID of the Page's Project
  - `single_use` boolean — Whether the Page is a single-use page created for URL targeting

## Response `201`

Return the created Page

- Page
  - `activation_code` string — Stringified Javascript function that determines when the Page is activated. Only required when activation_type is 'polling' or 'callback'.
  - `activation_type` 'immediate' | 'manual' | 'polling' | 'callback' | 'dom_changed' | 'url_changed' — Page activation type is a trigger that determines when the page is activated. Triggers tell Optimizely when to start checking whether certain conditions are true 'Immediate' activation mode activates the page as soon as the snippet loads. 'Polling' activation mode polls every 50ms until 'activation_code' evaluates to True, then activates the page. 'Callback' activation mode activates the page when the event defined by 'activation_code' is triggered. 'Manual' activation mode requires code within the subject app to explicitly trigger page activation. 'DOM Changed' sets the page to trigger when the DOM changes [Learn more](https://help.optimizely.com/Build_Campaigns_and_Experiments/Support_for_dynamic_websites%3A_Use_Optimizely_on_single_page_applications#Triggers). 'URL Changed' sets the page to trigger when the URL changes [Learn more](https://help.optimizely.com/Build_Campaigns_and_Experiments/Support_for_dynamic_websites%3A_Use_Optimizely_on_single_page_applications#Triggers).
  - `archived` boolean — Whether the Page has been archived
  - `category` 'article' | 'cart' | 'category' | 'checkout' | 'home' | 'landing_page' | 'pricing' | 'product_detail' | 'search_results' | 'other' — The category this Page is grouped under
  - `conditions` string — Stringified array of the conditions that activate the Page. The array contains Page Condition JSON dicts joined by "and" and "or". Each individual Page Condition dict has format {"type": "url", "match_type": <match_type>, "value": <value>} where match_types are: "simple" match type will match if "value" matches the hostname and path of the Page URL. "exact" match type will match only an exact string match between "value" and the Page URL. "substring" match type will match if "value" is a substring of the Page URL. "regex" match type will match if "value" is a regular expression match for the Page URL.
  - `created` string, date-time — Date created
  - `edit_url` string, required — URL of the Page
  - `experiment_count` integer — Number of experiments that reference this Page across all statuses (running, paused, draft, archived). Computed by the upstream service.
  - `id` integer — The unique identifier of the Page
  - `key` string — Unique string identifier for this Page within the Project
  - `last_modified` string, date-time — Date last modified
  - `name` string, required — Name of the Page
  - `page_type` 'single_url' | 'url_set' | 'global' — Type of Page
  - `project_id` integer, required — ID of the Page's Project
  - `single_use` boolean — Whether the Page is a single-use page created for URL targeting

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.dev/optimizely/apis/optimizely-api.md) · [All operations](https://skmtc.dev/optimizely/apis/optimizely-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/optimizely/optimizely-api/revisions/5151fe6a2297/schema)
