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

# Remove Team Member

## Overview

Remove a user from a tenant. This only removes the user's association with the tenant - the user account itself is not deleted and they can still be members of other tenants.

## Authorization

* User must be authenticated with a valid Bearer token
* User must have ADMIN role in the specified tenant

## Behavior

* Removes the user-tenant relationship (deletes the pivot record)
* User account remains active in the system
* User can still access other tenants they belong to
* Does not affect the user's data in other tenants

## Example Usage

```bash theme={null}
curl -X DELETE \
  https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/1/5 \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

```javascript theme={null}
await axios.delete(
  `/api/v2/admin/team-members/${tenantId}/${userId}`,
  {
    headers: { Authorization: `Bearer ${token}` }
  }
);
```

## Error Responses

### User Not Found (404)

```json theme={null}
{
  "error": "User not found"
}
```

### Not a Member (400)

```json theme={null}
{
  "error": "User is not a member of this Organization"
}
```

## Important Notes

* Removing a user does not delete their account
* The user can be re-added to the tenant later
* Consider implementing a "leave tenant" endpoint for self-service removal


## OpenAPI

````yaml DELETE /api/v2/admin/team-members/{tenantId}/{userId}
openapi: 3.1.0
info:
  title: Urban Things API
  description: Multi-tenant e-commerce platform API
  version: 2.0.0
  contact:
    email: info@faisalkc.com
servers:
  - url: https://faisalshop.mvp-apps.ae
    description: Production server
  - url: http://localhost:3000
    description: Development server
security:
  - bearerAuth: []
paths:
  /api/v2/admin/team-members/{tenantId}/{userId}:
    delete:
      tags:
        - Team Members
      summary: Remove team member
      parameters:
        - $ref: '#/components/parameters/TenantIdPath'
        - name: userId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Member removed
components:
  parameters:
    TenantIdPath:
      name: tenantId
      in: path
      required: true
      schema:
        type: integer
      description: Tenant ID
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````