> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router v7: import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Define component schemas with `createSchema()` from `@weaverse/hydrogen` (React Router themes) or `@weaverse/next` (Next.js themes).
> These docs cover @weaverse/hydrogen, @weaverse/react and @weaverse/core 5.x, and @weaverse/next 1.x. Do not use APIs from other major versions.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://docs.weaverse.io/developer-tools/weaverse-mcp

# Bulk delete pages

> Deletes page assignments in a project and soft-deletes each underlying page once it has no remaining live assignments; assignments for other locales or resources keep a shared page live. Only assignments in the project named in the URL are touched.

Identify up to 500 targets with one selector per request:

- `pageIds`: page ids, scoped to this project.
- `handles` + `type`: handles of one page type, with an optional `locale`. When `locale` is omitted the legacy `en-us` locale is used; an empty string is rejected. For custom pages, pass the exact handle from the pages list, including any `/`.

If both `pageIds` and `handles` are present and `pageIds` is an array, `pageIds` wins and `handles` is ignored.

A `handles` request naming an internal template-marker handle (`isTemplateMarker: true` on the pages list) is rejected with `400` and deletes nothing, so a bulk delete can never half-apply and strip a custom template's wiring. Delete such a template by its `pageIds` instead.

Deletion is consequential: resolve targets with the pages list first and, when acting through an agent, confirm them with the user. Use the response counts and handle lists to find misses (`notFound`) or per-page failures (`failed`).

Clients or CDNs that strip `DELETE` bodies may send `POST` to the same URL with the same body.

Required scope: `content:write` and `content:delete`. A credential with a stored scope list (any delegated grant or a shop API key minted with scopes) without `content:delete` gets `403 INSUFFICIENT_SCOPE` and nothing is deleted. Only shop API keys minted before scopes existed keep this endpoint's historical delete access.



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json delete /projects/{projectId}/pages
openapi: 3.1.0
info:
  title: Weaverse Content API
  version: 1.0.0
  description: >-
    Authenticated REST API for querying Weaverse-managed content (projects,
    pages, theme settings, languages) and for reading and writing per-locale
    translations.
servers:
  - url: https://studio.weaverse.io/api/v1/content
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: List, read, rename, create, copy and delete projects.
  - name: Pages
    description: List, read, create, update and delete the pages of a project.
  - name: Drafts and publishing
    description: >-
      Edit page drafts, then publish, schedule, restore and manage page
      versions.
  - name: Global sections
    description: Read, edit and publish sections shared across pages.
  - name: Page settings
    description: Read and edit page-level settings such as SEO metadata.
  - name: Assignments
    description: Map Shopify resources and routes to Weaverse pages and templates.
  - name: Theme settings
    description: Read and update a project's theme settings.
  - name: Languages and localization
    description: List project languages and manage locales, static text and glossary.
  - name: Translations
    description: >-
      Read and write per-locale translations, built for external translation
      agents.
  - name: Project structure
    description: Manage project variants and the project hierarchy.
  - name: Backups and portability
    description: Back up, restore, export and import project content.
  - name: Previews and hostnames
    description: Create preview links and manage the hostnames a project accepts.
  - name: Specification
    description: This OpenAPI document.
paths:
  /projects/{projectId}/pages:
    delete:
      tags:
        - Pages
      summary: Bulk delete pages
      description: >-
        Deletes page assignments in a project and soft-deletes each underlying
        page once it has no remaining live assignments; assignments for other
        locales or resources keep a shared page live. Only assignments in the
        project named in the URL are touched.


        Identify up to 500 targets with one selector per request:


        - `pageIds`: page ids, scoped to this project.

        - `handles` + `type`: handles of one page type, with an optional
        `locale`. When `locale` is omitted the legacy `en-us` locale is used; an
        empty string is rejected. For custom pages, pass the exact handle from
        the pages list, including any `/`.


        If both `pageIds` and `handles` are present and `pageIds` is an array,
        `pageIds` wins and `handles` is ignored.


        A `handles` request naming an internal template-marker handle
        (`isTemplateMarker: true` on the pages list) is rejected with `400` and
        deletes nothing, so a bulk delete can never half-apply and strip a
        custom template's wiring. Delete such a template by its `pageIds`
        instead.


        Deletion is consequential: resolve targets with the pages list first
        and, when acting through an agent, confirm them with the user. Use the
        response counts and handle lists to find misses (`notFound`) or per-page
        failures (`failed`).


        Clients or CDNs that strip `DELETE` bodies may send `POST` to the same
        URL with the same body.


        Required scope: `content:write` and `content:delete`. A credential with
        a stored scope list (any delegated grant or a shop API key minted with
        scopes) without `content:delete` gets `403 INSUFFICIENT_SCOPE` and
        nothing is deleted. Only shop API keys minted before scopes existed keep
        this endpoint's historical delete access.
      operationId: deletePages
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - pageIds
                  properties:
                    pageIds:
                      type: array
                      items:
                        type: string
                      maxItems: 500
                - type: object
                  required:
                    - handles
                    - type
                  properties:
                    handles:
                      type: array
                      items:
                        type: string
                      maxItems: 500
                    type:
                      type: string
                    locale:
                      type: string
                      description: Optional. Defaults to the stored default locale.
            example:
              type: CUSTOM
              handles:
                - pages/old-campaign
                - pages/expired-offer
              locale: en-us
      responses:
        '200':
          description: Delete result with per-target accounting
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - page_delete
                  requested:
                    type: integer
                  deleted:
                    type: integer
                  notFound:
                    type: integer
                  failed:
                    type: integer
                  deletedHandles:
                    type: array
                    items:
                      type: string
                  notFoundHandles:
                    type: array
                    items:
                      type: string
                  failedHandles:
                    type: array
                    items:
                      type: string
              example:
                object: page_delete
                requested: 2
                deleted: 1
                notFound: 1
                failed: 0
                deletedHandles:
                  - pages/old-campaign
                notFoundHandles:
                  - pages/expired-offer
                failedHandles: []
        '400':
          description: Invalid params
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - object
        - code
        - message
        - status
      properties:
        object:
          type: string
          enum:
            - error
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - INSUFFICIENT_SCOPE
            - PROJECT_NOT_FOUND
            - PAGE_NOT_FOUND
            - STALE_PAGE
            - STALE_PROJECT
            - STALE_TRANSLATION
            - TRANSLATION_UNIT_NOT_FOUND
            - SERVICE_UNAVAILABLE
            - CONFLICT
            - PRECONDITION_REQUIRED
            - INVALID_PARAMS
            - INTERNAL_ERROR
        message:
          type: string
        status:
          type: integer
        details:
          description: >-
            Optional machine-readable context, for example the clashing handles
            of a 409 CONFLICT.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: WEAVERSE_API_KEY
      description: >-
        Bearer authentication: a shop API key (WEAVERSE_API_KEY), a scoped API
        key, a delegated MCP OAuth token, or (translation-unit routes only) a
        project-bound translation agent token. Scopes: content:read — Read
        projects, pages, theme settings, versions, drafts and translation units.
        content:write — Save drafts and make non-destructive edits (page items,
        metadata, SEO, assignments, languages, glossary). Never publishes or
        deletes. content:publish — Publish drafts, schedule/reschedule/cancel
        publications, restore versions, publish global sections. content:delete
        — Delete pages, global sections, languages, static keys, override
        reverts; required with project:manage for project deletion.
        project:manage — Create/copy/delete projects, settings, variants,
        hierarchy, backups, restore-as-new, previews, hostname policy.
        translations:read — Read translation units only (no general content
        access). translations:write — Apply translation units only; never
        mutates page content. A legacy unscoped API key keeps
        read/write/translation baseline access and every pre-scope endpoint, but
        never gains publish/delete/project-manage implicitly.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.