# Pages

The Pages API lets you create new pages, add new language versions or components to a page, search for pages on a site, set the component datasource on a page, retrieve page components, paths, HTML, preview URL, screenshots, templates, details, and allowed components.

 - [POST /api/v1/pages/create](https://api-docs.sitecore.com/sai/agent-api/pages/pages-create_page.md): Creates a new page using the specified template under the parent page. You can set field values and the language for the new page.
 - [POST /api/v1/pages/{pageId}/add-language](https://api-docs.sitecore.com/sai/agent-api/pages/pages-add_language_to_page.md): Adds a new language version for an existing page. This allows you to have the same page content available in multiple languages.
 - [POST /api/v1/pages/{pageId}/components](https://api-docs.sitecore.com/sai/agent-api/pages/pages-add_component_on_page.md): Adds a component to a specific placeholder on a page. You can specify the component type, placeholder location, and configure its initial settings. Optionally, you can specify its position relative to
 - [GET /api/v1/pages/{pageId}/components](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_components_on_page.md): Retrieves the components on a page.
 - [POST /api/v1/pages/{pageId}/components/{componentId}/datasource](https://api-docs.sitecore.com/sai/agent-api/pages/pages-set_component_datasource.md): Sets the datasource for a specific component on a page. You can specify a new data source item or clear the existing one.
 - [GET /api/v1/pages/search](https://api-docs.sitecore.com/sai/agent-api/pages/pages-search_site.md): Searches for all pages in a specific site using a search term that matches page titles and content. The response returns the matching pages with their details including the page ID, path, and name.
 - [GET /api/v1/pages/path-by-url](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_page_path_by_live_url.md): Resolves a public live URL to its corresponding page in Sitecore. Use this endpoint when you know the URL of a published page and need to identify the page behind it.
 - [GET /api/v1/pages/{pageId}/screenshot](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_page_screenshot.md): Captures and returns a base64-encoded screenshot of a page.
 - [GET /api/v1/pages/{pageId}/html](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_page_html.md): Retrieves the HTML for a specific page. This endpoint returns the raw HTML of the page as it would appear in the browser.
 - [GET /api/v1/pages/{pageId}/preview-url](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_page_preview_url.md): Retrieves the preview URL for a specific page.
 - [GET /api/v1/pages/template-by-id](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_page_template_by_id.md): Retrieves the details of a specific page template, including its fields and settings. Use this endpoint to understand the structure and available fields of a template before creating a page.
 - [GET /api/v1/pages/{pageId}](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_page.md): Retrieves the details about a page including its ID, name, and path location. This endpoint provides the information you need to understand and modify the page's structure.
 - [GET /api/v1/pages/{pageId}/placeholders/{placeholderName}/allowed-components](https://api-docs.sitecore.com/sai/agent-api/pages/pages-get_allowed_components_by_placeholder.md): Retrieves the list of components that can be added to a placeholder on a page. This helps ensure that only compatible components are used in each placeholder.
