> ## 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 List Space Grants



## OpenAPI

````yaml /openapi/mio-openapi.json get /api/v1/admin/teams/{team_id}/hubs/{hub_id}/spaces/{space_id}/grants
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/{space_id}/grants:
    get:
      tags:
        - community-spaces-admin
      summary: Admin List Space Grants
      operationId: >-
        community_spaces_admin.get_community_spaces_admin_get_admin_teams_by_team_id_hubs_by_hub_id_spaces_by_space_id_grants
      parameters:
        - in: path
          name: space_id
          required: true
          schema:
            maxLength: 36
            title: Space Id
            type: string
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            maxLength: 36
            title: Hub Id
            type: string
        - description: Also list revoked grants (the history), each with its revoke_reason.
          in: query
          name: include_revoked
          required: false
          schema:
            default: false
            description: >-
              Also list revoked grants (the history), each with its
              revoke_reason.
            title: Include Revoked
            type: boolean
        - in: query
          name: filter[contact_id]
          required: false
          schema:
            anyOf:
              - maxLength: 36
                minLength: 1
                type: string
              - type: 'null'
            title: Filter[Contact Id]
        - description: Cursor — ID of the last item on the previous page.
          in: query
          name: page[after]
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Cursor — ID of the last item on the previous page.
            title: Page[After]
        - in: query
          name: page[size]
          required: false
          schema:
            default: 20
            maximum: 100
            minimum: 1
            title: Page[Size]
            type: integer
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/SpaceAccessGrantListResponse'
          description: Successful Response
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: >-
            `errors[0].code` is `space_not_found` when no live space has this id
            in the resolved hub. Separately, an error with no `code` (detail
            `Hub not found`) means the hub path value is not the exact id of a
            hub of this team (a slug or legacy hash is not accepted on these
            routes).
          x-error-codes:
            - space_not_found
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    SpaceAccessGrantListResponse:
      description: >-
        Keyset page of a space's grants (active only unless
        ``include_revoked=true``).
      properties:
        data:
          items:
            $ref: '#/components/schemas/JsonApiResource_SpaceAccessGrantAttributes_'
          title: Data
          type: array
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiPaginationLinks'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/SpaceAccessGrantListMeta'
            - type: 'null'
      required:
        - data
      title: SpaceAccessGrantListResponse
      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
    JsonApiResource_SpaceAccessGrantAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/SpaceAccessGrantAttributes'
        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[SpaceAccessGrantAttributes]
      type: object
    JsonApiPaginationLinks:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiPaginationLinks
      type: object
    SpaceAccessGrantListMeta:
      properties:
        page:
          $ref: '#/components/schemas/SpaceAccessGrantListPageMeta'
      required:
        - page
      title: SpaceAccessGrantListMeta
      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
    SpaceAccessGrantAttributes:
      description: >-
        One grant row: active while ``revoked_at`` is null, kept as history once
        revoked.


        ``revoke_reason`` is one of seven values: ``admin_revoke`` (an admin
        revoked it),

        ``hub_ban`` / ``hub_soft_ban`` (the member was banned or soft-banned),

        ``hub_member_removed`` (the member left, was removed, or their team
        contact was

        removed), ``space_made_public`` (the space stopped being restricted),

        ``hub_deleted`` (the hub was deleted) and ``contact_erased`` (a
        GDPR/CCPA erasure).


        One revoked row becomes active again: a grant closed with
        ``hub_member_removed`` when a

        refund, or a cancelled, unpaid or paused subscription, removed the
        member, once the

        subscription recovers or the member buys again or starts a trial, unless
        they left, were

        removed, or deleted their account in between. The same row comes back
        (same id,

        ``revoked_at`` and ``revoke_reason`` cleared). An admin's revoke never
        comes back.
      properties:
        contact_id:
          title: Contact Id
          type: string
        granted_at:
          title: Granted At
          type: string
        granted_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Granted By User Id
        revoke_reason:
          anyOf:
            - enum:
                - admin_revoke
                - hub_ban
                - hub_soft_ban
                - hub_member_removed
                - space_made_public
                - hub_deleted
                - contact_erased
              type: string
            - type: 'null'
          title: Revoke Reason
        revoked_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Revoked At
        revoked_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Revoked By User Id
      required:
        - contact_id
        - granted_at
      title: SpaceAccessGrantAttributes
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    SpaceAccessGrantListPageMeta:
      description: Mirrors build_page_meta()'s meta["page"] block exactly.
      properties:
        has_more:
          title: Has More
          type: boolean
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        size:
          title: Size
          type: integer
      required:
        - size
        - has_more
      title: SpaceAccessGrantListPageMeta
      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.