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

# Discard a page's unpublished draft changes



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/pages/{page_id}/tree/discard
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}/tree/discard:
    post:
      tags:
        - pages-admin
      summary: Discard a page's unpublished draft changes
      operationId: >-
        pages_admin.post_pages_admin_post_teams_by_team_id_hubs_by_hub_id_pages_by_page_id_tree_discard
      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
        - in: header
          name: If-Match
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: If-Match
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/DraftTreeResponse'
          description: >-
            The draft was reset. The body is the same `page_draft_trees`
            envelope `PUT .../tree` returns, carrying the new draft_version and
            either the restored tree, or `tree: null` when the page has never
            been published and its type is not editor-owned — see the operation
            description.
          headers:
            ETag:
              description: >-
                New draft_version (quoted). Send back as If-Match on the next
                tree write, discard, or publish.
              schema:
                type: string
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: '`invalid_if_match`.'
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: '`page_not_found`.'
        '409':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: '`no_published_tree` or `stale_draft`.'
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '428':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: '`precondition_required`.'
      security:
        - HTTPBearer: []
components:
  schemas:
    DraftTreeResponse:
      additionalProperties: false
      description: Top-level JSON:API response envelope for PUT .../pages/{id}/tree.
      properties:
        data:
          $ref: '#/components/schemas/DraftTreeResource'
      required:
        - data
      title: DraftTreeResponse
      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
    DraftTreeResource:
      additionalProperties: false
      description: JSON:API resource object for a page draft tree (write response).
      properties:
        attributes:
          $ref: '#/components/schemas/DraftTreeReadAttributes'
        id:
          title: Id
          type: string
        type:
          const: page_draft_trees
          default: page_draft_trees
          title: Type
          type: string
      required:
        - id
        - attributes
      title: DraftTreeResource
      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
    DraftTreeReadAttributes:
      additionalProperties: false
      properties:
        draft_version:
          title: Draft Version
          type: integer
        tree:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tree
      required:
        - draft_version
        - tree
      title: DraftTreeReadAttributes
      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.