> ## 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 Reorder Spaces

> Reorder spaces within a hub.

Accepts an ordered list of space resource identifiers. Position is set
to the index of each space_id in the list (0-based).

Returns the full updated list of spaces in the new order via
list_all_spaces_for_hub, bounded only by that module's shared 500-space
safety ceiling (logged on cap-hit) — not the 20-row page cap that
list_spaces_for_hub would otherwise impose on a reorder confirmation.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/admin/teams/{team_id}/hubs/{hub_id}/spaces/reorder
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/admin/teams/{team_id}/hubs/{hub_id}/spaces/reorder:
    post:
      tags:
        - community-spaces-admin
      summary: Admin Reorder Spaces
      description: |-
        Reorder spaces within a hub.

        Accepts an ordered list of space resource identifiers. Position is set
        to the index of each space_id in the list (0-based).

        Returns the full updated list of spaces in the new order via
        list_all_spaces_for_hub, bounded only by that module's shared 500-space
        safety ceiling (logged on cap-hit) — not the 20-row page cap that
        list_spaces_for_hub would otherwise impose on a reorder confirmation.
      operationId: >-
        community_spaces_admin.post_community_spaces_admin_post_admin_teams_by_team_id_hubs_by_hub_id_spaces_reorder
      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
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: >-
                #/components/schemas/app__community__routers__spaces_admin__ReorderEnvelope
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: >-
                  #/components/schemas/JsonApiListResponse_SpaceResponseAttributes_
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    app__community__routers__spaces_admin__ReorderEnvelope:
      description: 'JSON:API reorder envelope: {data: [{type, id}, ...]}.'
      properties:
        data:
          items:
            $ref: >-
              #/components/schemas/app__community__routers__spaces_admin__ReorderItem
          title: Data
          type: array
      required:
        - data
      title: ReorderEnvelope
      type: object
    JsonApiListResponse_SpaceResponseAttributes_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/JsonApiResource_SpaceResponseAttributes_'
          title: Data
          type: array
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiPaginationLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiListResponse[SpaceResponseAttributes]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    app__community__routers__spaces_admin__ReorderItem:
      properties:
        id:
          title: Id
          type: string
        type:
          title: Type
          type: string
      required:
        - type
        - id
      title: ReorderItem
      type: object
    JsonApiResource_SpaceResponseAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/SpaceResponseAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[SpaceResponseAttributes]
      type: object
    JsonApiPaginationLinks:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiPaginationLinks
      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
    SpaceResponseAttributes:
      description: Attributes emitted by space serializers in admin + member routers.
      properties:
        access_level:
          anyOf:
            - type: string
            - type: 'null'
          title: Access Level
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        deleted_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Deleted At
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        icon:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon
        is_default:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Default
        is_member:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Member
        is_muted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Muted
        is_pinned:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pinned
        member_avatar_preview:
          anyOf:
            - items:
                $ref: '#/components/schemas/MemberAvatarPreviewItem'
              type: array
            - type: 'null'
          title: Member Avatar Preview
        member_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Member Count
        moderator_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Moderator Count
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        online_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Online Count
        position:
          anyOf:
            - type: integer
            - type: 'null'
          title: Position
        posting_permission:
          anyOf:
            - type: string
            - type: 'null'
          title: Posting Permission
        segment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Segment Id
        slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Slug
        unread_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Unread Count
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
        viewer_can_post:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Viewer Can Post
      title: SpaceResponseAttributes
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    MemberAvatarPreviewItem:
      properties:
        contact_id:
          title: Contact Id
          type: string
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
        photo_thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo Thumbnail Url
        photo_thumbnail_url_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Photo Thumbnail Url Expires At
      required:
        - contact_id
      title: MemberAvatarPreviewItem
      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

````