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

# Admin Duplicate Page

> Duplicate a page into a new, unpublished page in the same hub.

The copy gets the title with " copy" appended, the same type, privacy,
settings, icon and position, and the source's content tree (its draft if
it has one, else its published tree) as its draft. It is never the
homepage and has never been published. Its slug is `<slug>-copy`, or
`<slug>-copy-2`, `-copy-3` and so on when that is taken.

Access gates are cloned, not shared: each gated node in the copy gets a
new node id and its own new access rule with the same operator and
conditions, so editing a gate on one page never changes the other.
Content and media the tree references are shared, not copied.

No request body. Returns 201 with the new page and a `Location` header.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/duplicate:
    post:
      tags:
        - pages-admin
      summary: Admin Duplicate Page
      description: |-
        Duplicate a page into a new, unpublished page in the same hub.

        The copy gets the title with " copy" appended, the same type, privacy,
        settings, icon and position, and the source's content tree (its draft if
        it has one, else its published tree) as its draft. It is never the
        homepage and has never been published. Its slug is `<slug>-copy`, or
        `<slug>-copy-2`, `-copy-3` and so on when that is taken.

        Access gates are cloned, not shared: each gated node in the copy gets a
        new node id and its own new access rule with the same operator and
        conditions, so editing a gate on one page never changes the other.
        Content and media the tree references are shared, not copied.

        No request body. Returns 201 with the new page and a `Location` header.
      operationId: >-
        pages_admin.post_pages_admin_post_teams_by_team_id_hubs_by_hub_id_pages_by_page_id_duplicate
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
        - in: path
          name: page_id
          required: true
          schema:
            title: Page Id
            type: string
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/AdminPageResponse'
          description: Successful Response
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: >-
            The hub is not in this team, or the page does not exist, is deleted,
            or belongs to another hub.
        '409':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: >-
            Possible `errors[0].code` values: `system_page_not_duplicable` when
            the page is a login, register, payments or content page (one per
            hub); `legacy_page_not_duplicable` when the page has no page tree
            and its content lives in legacy sections; `page_gate_unresolvable`
            when a gated node's access rule cannot be cloned (missing, not that
            node's rule, or a condition that no longer validates);
            `page_slug_conflict` when no free `<slug>-copy` slug is left.
            Nothing is created.
          x-error-codes:
            - system_page_not_duplicable
            - legacy_page_not_duplicable
            - page_gate_unresolvable
            - page_slug_conflict
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    AdminPageResponse:
      additionalProperties: false
      description: Single-resource JSON:API response for admin page reads.
      properties:
        data:
          $ref: '#/components/schemas/AdminPageResource'
      required:
        - data
      title: AdminPageResponse
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AdminPageResource:
      additionalProperties: false
      description: JSON:API resource object for admin page reads (includes draft_version).
      properties:
        attributes:
          $ref: '#/components/schemas/AdminPageAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        type:
          const: pages
          default: pages
          title: Type
          type: string
      required:
        - id
        - attributes
      title: AdminPageResource
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AdminPageAttributes:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        deleted_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Deleted At
        draft_version:
          title: Draft Version
          type: integer
        hub_id:
          title: Hub Id
          type: string
        icon:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon
        is_homepage:
          title: Is Homepage
          type: boolean
        last_published_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When this page was last published, by a single-page publish or a
            hub-wide publish. Discarding a draft does not change it. Null when
            the page has never been published, or was published before this
            field existed and no record of that publish's time is kept.
            Read-only: create and update requests that send it are rejected with
            422.
          title: Last Published At
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        parent_page_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Id of the page this one hangs under, or null. A live page of the
            same hub; cleared when the parent is deleted.
          title: Parent Page Id
        position:
          title: Position
          type: integer
        privacy:
          title: Privacy
          type: string
        purge_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When a deleted page becomes eligible for permanent deletion:
            `deleted_at` plus the 30-day trash retention. Until then it can be
            restored with POST .../pages/{page_id}/restore. Null for a live
            page. Read-only.
          title: Purge At
        settings:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Settings
        slug:
          title: Slug
          type: string
        title:
          title: Title
          type: string
        type:
          title: Type
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - hub_id
        - title
        - slug
        - type
        - privacy
        - is_homepage
        - position
        - settings
        - meta
        - parent_page_id
        - created_at
        - updated_at
        - deleted_at
        - draft_version
        - last_published_at
        - icon
        - purge_at
      title: AdminPageAttributes
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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