> ## 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 Revoke Space Access

> Revoke the contact's active grant on the space.

Idempotent: no active grant is still a 204, and emits nothing. A revoked grant stays
listed under ``include_revoked=true`` with ``revoke_reason`` ``admin_revoke``. Emits
``community.space.grant_revoked``.

With no active grant, when the contact's latest grant on the space was closed by their
removal from the hub (``revoke_reason`` ``hub_member_removed``, no ``revoked_by_user_id``),
it becomes this admin's revoke (``admin_revoke``, ``revoked_at`` kept), still with no
event, so it is not restored if a subscription recovery reinstates the member or the
member buys access again.



## OpenAPI

````yaml /openapi/mio-openapi.json delete /api/v1/admin/teams/{team_id}/hubs/{hub_id}/spaces/{space_id}/grants/{contact_id}
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/{contact_id}:
    delete:
      tags:
        - community-spaces-admin
      summary: Admin Revoke Space Access
      description: >-
        Revoke the contact's active grant on the space.


        Idempotent: no active grant is still a 204, and emits nothing. A revoked
        grant stays

        listed under ``include_revoked=true`` with ``revoke_reason``
        ``admin_revoke``. Emits

        ``community.space.grant_revoked``.


        With no active grant, when the contact's latest grant on the space was
        closed by their

        removal from the hub (``revoke_reason`` ``hub_member_removed``, no
        ``revoked_by_user_id``),

        it becomes this admin's revoke (``admin_revoke``, ``revoked_at`` kept),
        still with no

        event, so it is not restored if a subscription recovery reinstates the
        member or the

        member buys access again.
      operationId: >-
        community_spaces_admin.delete_community_spaces_admin_delete_admin_teams_by_team_id_hubs_by_hub_id_spaces_by_space_id_grants_by_contact_id
      parameters:
        - in: path
          name: space_id
          required: true
          schema:
            maxLength: 36
            title: Space Id
            type: string
        - in: path
          name: contact_id
          required: true
          schema:
            maxLength: 36
            title: Contact 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
      responses:
        '204':
          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:
    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
    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
  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.