> ## 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.

# Apply a hub template's full page set

> Applies a **hubTemplate**'s complete `pages[]` manifest to this hub in one transaction — every page the template declares (homepage included), created, tree-written and published together. Takes a `hub_template_id` (e.g. `community`); the number of pages is whatever the manifest declares. Idempotent via the required `Idempotency-Key`: re-runs converge — untouched template pages no-op, interrupted ones resume, human-edited ones 409 rather than being overwritten. Attribute returned pages by `slug` (unique per manifest), never by `role` (not unique). Not to be confused with the sibling `POST .../pages/from-template`, which installs exactly ONE pageTemplate at a caller-chosen slug.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/pages/scaffold-from-template
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/scaffold-from-template:
    post:
      tags:
        - pages-admin
      summary: Apply a hub template's full page set
      description: >-
        Applies a **hubTemplate**'s complete `pages[]` manifest to this hub in
        one transaction — every page the template declares (homepage included),
        created, tree-written and published together. Takes a `hub_template_id`
        (e.g. `community`); the number of pages is whatever the manifest
        declares. Idempotent via the required `Idempotency-Key`: re-runs
        converge — untouched template pages no-op, interrupted ones resume,
        human-edited ones 409 rather than being overwritten. Attribute returned
        pages by `slug` (unique per manifest), never by `role` (not unique). Not
        to be confused with the sibling `POST .../pages/from-template`, which
        installs exactly ONE pageTemplate at a caller-chosen slug.
      operationId: >-
        pages_admin.post_pages_admin_post_teams_by_team_id_hubs_by_hub_id_pages_scaffold_from_template
      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: header
          name: Idempotency-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TemplateScaffoldEnvelope'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/TemplateScaffoldResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    TemplateScaffoldEnvelope:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/TemplateScaffoldResource'
      required:
        - data
      title: TemplateScaffoldEnvelope
      type: object
    TemplateScaffoldResponse:
      properties:
        data:
          $ref: '#/components/schemas/TemplateScaffoldResultResource'
      required:
        - data
      title: TemplateScaffoldResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    TemplateScaffoldResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/TemplateScaffoldAttributes'
        type:
          const: template_scaffolds
          title: Type
          type: string
      required:
        - type
        - attributes
      title: TemplateScaffoldResource
      type: object
    TemplateScaffoldResultResource:
      properties:
        attributes:
          $ref: '#/components/schemas/TemplateScaffoldResultAttributes'
        id:
          title: Id
          type: string
        type:
          const: template_scaffolds
          default: template_scaffolds
          title: Type
          type: string
      required:
        - id
        - attributes
      title: TemplateScaffoldResultResource
      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
    TemplateScaffoldAttributes:
      additionalProperties: false
      properties:
        catalog_digest:
          maxLength: 128
          title: Catalog Digest
          type: string
        hub_template_id:
          maxLength: 100
          pattern: ^[a-z0-9][a-z0-9-]*$
          title: Hub Template Id
          type: string
        name:
          maxLength: 255
          minLength: 1
          title: Name
          type: string
        slug:
          maxLength: 100
          pattern: ^[a-z0-9-]+$
          title: Slug
          type: string
      required:
        - hub_template_id
        - name
        - slug
        - catalog_digest
      title: TemplateScaffoldAttributes
      type: object
    TemplateScaffoldResultAttributes:
      properties:
        hub_id:
          title: Hub Id
          type: string
        pages:
          items:
            $ref: '#/components/schemas/ScaffoldPageEntry'
          title: Pages
          type: array
      required:
        - hub_id
        - pages
      title: TemplateScaffoldResultAttributes
      type: object
    ScaffoldPageEntry:
      properties:
        page_id:
          title: Page Id
          type: string
        published_revision:
          title: Published Revision
          type: integer
        role:
          title: Role
          type: string
        slug:
          title: Slug
          type: string
      required:
        - role
        - slug
        - page_id
        - published_revision
      title: ScaffoldPageEntry
      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

````