> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.flare.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Tenant Membership

> Remove the membership of a user in a tenant. The response body is empty. The removal is refused when it leaves the caller without any tenant. Use the sibling `POST /tenants/{tenant_id}/users` operation to add the user back. Requires write permission on the members of the tenant.

&#x20;Required API key permission: **Write Tenant Admin**


## OpenAPI

````yaml firework-v2-openapi delete /firework/v2/tenants/{tenant_id}/users/{user_id}
openapi: 3.0.1
info:
  description: >

    Manage and access Firework resources.


    Requests are authenticated with API tokens, which are obtained using an API
    key:


    1. Generate an API key from the [Profile
    page](https://app.flare.io/#/profile).

    2. Send a `POST` request to `https://api.flare.io/tokens/generate` with the
    `Authorization: <api-key>` header to get an API token. API tokens expire
    after 1 hour.

    3. Call the API endpoints with the `Authorization: Bearer <api-token>`
    header.


    See [Authentication](https://api.docs.flare.io/concepts/authentication) for
    details.
  title: Firework API
  version: v2
servers:
  - url: https://api.flare.io/
security:
  - BearerAuth: []
tags:
  - description: >-
      The authenticated user, its API keys, organizations, tenants, onboarding
      and usage.
    name: Account
  - description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
    name: Events
  - description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
    name: Identifiers
  - description: Report groups, reports, their sections, schedules and delivery channels.
    name: Reports
paths:
  /firework/v2/tenants/{tenant_id}/users/{user_id}:
    delete:
      tags:
        - Account
      summary: Remove a user from a tenant
      description: >-
        Remove the membership of a user in a tenant. The response body is empty.
        The removal is refused when it leaves the caller without any tenant. Use
        the sibling `POST /tenants/{tenant_id}/users` operation to add the user
        back. Requires write permission on the members of the tenant.
      operationId: delete_tenant_users_access_api
      parameters:
        - description: ID of the tenant.
          in: path
          name: tenant_id
          required: true
          schema:
            type: integer
        - description: ID of the user to remove from the tenant.
          in: path
          name: user_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          content: {}
          description: User was successfully removed from the tenant.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The caller would be left without any tenant (code
            `CANNOT_REMOVE_LAST_TENANT`).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The caller cannot manage the members of this tenant (code
            `FORBIDDEN`).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The user or the tenant does not exist, or the members of the tenant
            are not visible to the caller (code `NOT_FOUND`).
components:
  schemas:
    HttpError:
      properties:
        message:
          description: Human-readable description of the error.
          type: string
        code:
          description: Machine-readable error code.
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.