---
title: "Create site pages"
method: POST
path: "/api/v1/site/pages"
tags: ["Content"]
---

# Create site pages

`POST /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 POST /api/v1/content 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
      - `slug` string, required: Page slug or file path, for example 'blog/my-post'
      - `title` string, required: Page title
      - `content` string, required: Markdown content for the page
      - `description` string: Optional page description
      - `metaTitle` string: Optional SEO meta title
      - `metaDescription` string: Optional SEO meta description
      - `canonicalDomainId` string: Optional publishing destination: a product custom domain ID the page publishes to as canonical when approved. Omit to publish to the product's default domains.
  - 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
      - `slug` string, required: Page slug or file path, for example 'blog/my-post'
      - `title` string, required: Page title
      - `content` string, required: Markdown content for the page
      - `description` string: Optional page description
      - `metaTitle` string: Optional SEO meta title
      - `metaDescription` string: Optional SEO meta description
      - `canonicalDomainId` string: Optional publishing destination: a product custom domain ID the page publishes to as canonical when approved. Omit to publish to the product's default domains.

## 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
    - `createdCount` integer, required
    - `failedCount` integer, required
    - `created` object[], required
      - `id` string, required
      - `slug` string, required
      - `title` string, required
      - `sourceUrl` string, nullable, required
      - `status` string, required
    - `failed` object[], required
      - `id` string
      - `slug` string, required
      - `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)
