---
title: "Update site pages"
method: PATCH
path: "/api/v1/site/pages"
tags: ["Content"]
---

# Update site pages

`PATCH /api/v1/site/pages`

## Request

- Base URL: `https://app.promptingco.com`
- URL: `https://app.promptingco.com/api/v1/site/pages`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Deprecated, will be removed in future versions. Please use PUT /api/v1/content/{id} instead.

## Request body

- union
  - object
    - `productId` string, required: Product ID. Provide exactly one of `productId` or `productSlug` in the request body (the server enforces this).
    - `productSlug` string: Product slug. Provide exactly one of `productId` or `productSlug` in the request body (the server enforces this).
    - `pages` object[], required
      - `id` string, required: The page ID to update
      - `title` string: Optional replacement page title
      - `content` string: Optional replacement markdown content
      - `description` string: Optional replacement description
      - `metaTitle` string: Optional replacement SEO meta title
      - `metaDescription` string: Optional replacement SEO meta description
      - `ogTitle` string, nullable: Open Graph title; null clears it
      - `ogDescription` string, nullable: Open Graph description; null clears it
      - `ogImage` string, nullable: Open Graph image URL; null clears it
      - `twitterTitle` string, nullable: Twitter/X title; null clears it
      - `twitterDescription` string, nullable: Twitter/X description; null clears it
      - `twitterImage` string, nullable: Twitter/X image URL; null clears it
      - `filePath` string: Optional replacement path or slug for the page
      - `status` 'draft' | 'published': Optional page status update
      - `isManual` boolean: Optional override for whether the page is manual
      - `noIndex` boolean: Optional SEO noindex flag
      - `redirectToUrl` string, nullable: Optional redirect target URL, or null to clear it
      - `redirectAudience` 'ai-referral' | 'all': Who the redirect applies to: 'ai-referral' (default) redirects only visitors arriving from AI assistants; 'all' redirects every visitor, which also stops AI assistants from reading the page.
      - `attachDomainIds` string[]: Optional custom domain IDs to attach to the page. Domains must belong to the product and be active web domains.
      - `detachDomainIds` string[]: Optional custom domain IDs to detach from the page. Detached domains can no longer be canonical.
      - `canonicalDomainId` string: Optional attached custom domain ID to mark as canonical and use for the page source URL.
  - object
    - `productId` string: Product ID. Provide exactly one of `productId` or `productSlug` in the request body (the server enforces this).
    - `productSlug` string, required: Product slug. Provide exactly one of `productId` or `productSlug` in the request body (the server enforces this).
    - `pages` object[], required
      - `id` string, required: The page ID to update
      - `title` string: Optional replacement page title
      - `content` string: Optional replacement markdown content
      - `description` string: Optional replacement description
      - `metaTitle` string: Optional replacement SEO meta title
      - `metaDescription` string: Optional replacement SEO meta description
      - `ogTitle` string, nullable: Open Graph title; null clears it
      - `ogDescription` string, nullable: Open Graph description; null clears it
      - `ogImage` string, nullable: Open Graph image URL; null clears it
      - `twitterTitle` string, nullable: Twitter/X title; null clears it
      - `twitterDescription` string, nullable: Twitter/X description; null clears it
      - `twitterImage` string, nullable: Twitter/X image URL; null clears it
      - `filePath` string: Optional replacement path or slug for the page
      - `status` 'draft' | 'published': Optional page status update
      - `isManual` boolean: Optional override for whether the page is manual
      - `noIndex` boolean: Optional SEO noindex flag
      - `redirectToUrl` string, nullable: Optional redirect target URL, or null to clear it
      - `redirectAudience` 'ai-referral' | 'all': Who the redirect applies to: 'ai-referral' (default) redirects only visitors arriving from AI assistants; 'all' redirects every visitor, which also stops AI assistants from reading the page.
      - `attachDomainIds` string[]: Optional custom domain IDs to attach to the page. Domains must belong to the product and be active web domains.
      - `detachDomainIds` string[]: Optional custom domain IDs to detach from the page. Detached domains can no longer be canonical.
      - `canonicalDomainId` string: Optional attached custom domain ID to mark as canonical and use for the page source URL.

## Response `200`

Successful response

- object
  - `ok` true, required
  - `data` object, required
    - `scope` object, required
      - `product` object, required
        - `id` string, required
        - `name` string, required
        - `slug` string, nullable, required
      - `organization` object, required
        - `id` string, required
        - `name` string, required
        - `slug` string, required
    - `updatedCount` integer, required
    - `failedCount` integer, required
    - `updated` object[], required
      - `id` string, required
      - `title` string, required
      - `filePath` string, required
      - `sourceUrl` string, nullable, required
      - `status` string, required
      - `isManual` boolean, required
      - `redirectToUrl` string, nullable, required
      - `redirectAudience` string, required
      - `domains` object[], required
        - `id` string, required
        - `domain` string, required
        - `isCanonical` boolean, required
        - `pathPrefix` string, nullable, required
    - `failed` object[], required
      - `id` string, required
      - `slug` string
      - `message` string, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Not found
- `422`: Validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api.md) - [All operations](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/llms.txt) - [OpenAPI document](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/revisions/c0451ea10e9a?raw)
