> ## 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 Hub Drafts



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/drafts/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}/drafts/discard:
    post:
      tags:
        - hubs-admin
      summary: Discard Hub Drafts
      operationId: >-
        hubs_admin.post_hubs_admin_post_teams_by_team_id_hubs_by_hub_id_drafts_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: header
          name: If-Match
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: If-Match
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/HubDraftDiscardEnvelope'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HubDraftDiscardResponse'
          description: Successful Response
          headers:
            ETag:
              description: >-
                New pending-ops queue version (quoted). Send as If-Match on the
                next queue write.
              schema:
                type: string
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    HubDraftDiscardEnvelope:
      additionalProperties: false
      description: |-
        Body of ``POST …/hubs/{hub_id}/drafts/discard``. An empty ``pages`` list
        is valid: it discards hub-level changes only (queue replace).
      properties:
        data:
          $ref: '#/components/schemas/HubDraftDiscardResource'
      required:
        - data
      title: HubDraftDiscardEnvelope
      type: object
    HubDraftDiscardResponse:
      properties:
        data:
          $ref: '#/components/schemas/HubDraftDiscardResultResource'
      required:
        - data
      title: HubDraftDiscardResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    HubDraftDiscardResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/HubDraftDiscardAttributes'
        type:
          const: hub_draft_discards
          title: Type
          type: string
      required:
        - type
        - attributes
      title: HubDraftDiscardResource
      type: object
    HubDraftDiscardResultResource:
      properties:
        attributes:
          $ref: '#/components/schemas/HubDraftDiscardResultAttributes'
        id:
          description: The hub id — a discard is not persisted as a record.
          title: Id
          type: string
        type:
          const: hub_draft_discards
          default: hub_draft_discards
          title: Type
          type: string
      required:
        - id
        - attributes
      title: HubDraftDiscardResultResource
      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
    HubDraftDiscardAttributes:
      additionalProperties: false
      properties:
        pages:
          items:
            $ref: '#/components/schemas/HubPublishPageItem'
          title: Pages
          type: array
        pending_ops_remaining:
          items: {}
          title: Pending Ops Remaining
          type: array
      title: HubDraftDiscardAttributes
      type: object
    HubDraftDiscardResultAttributes:
      properties:
        pages:
          items:
            $ref: '#/components/schemas/HubDraftDiscardPageResult'
          title: Pages
          type: array
        pending_ops_version:
          title: Pending Ops Version
          type: integer
        removed_page_ids:
          items:
            type: string
          title: Removed Page Ids
          type: array
        skipped_page_ids:
          items:
            type: string
          title: Skipped Page Ids
          type: array
      required:
        - pages
        - skipped_page_ids
        - pending_ops_version
      title: HubDraftDiscardResultAttributes
      type: object
    HubPublishPageItem:
      additionalProperties: false
      description: One page to publish / discard, with the draft version the client saw.
      properties:
        expected_draft_version:
          maximum: 2147483646
          minimum: 0
          title: Expected Draft Version
          type: integer
        page_id:
          maxLength: 64
          minLength: 1
          title: Page Id
          type: string
      required:
        - page_id
        - expected_draft_version
      title: HubPublishPageItem
      type: object
    HubDraftDiscardPageResult:
      properties:
        draft_version:
          title: Draft Version
          type: integer
        page_id:
          title: Page Id
          type: string
        published_revision:
          title: Published Revision
          type: integer
      required:
        - page_id
        - draft_version
        - published_revision
      title: HubDraftDiscardPageResult
      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.