---
title: "Remove a member"
---

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

# Remove a member

Path: CloudRaker Workspace API › Organization Settings

`DELETE /users/memberships/{membershipId}`

Removes a membership by `:membershipId` after confirming it belongs to the caller's organization. Authorization: organization administrators only. Returns 204 on success; 404 if it does not exist or is not in this org; 409 when refused — removing yourself (`cannot_remove_self`), the last remaining member (`last_member`), a directory-managed membership (`directory_managed`), or the organization's last owner (`last_owner`).

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `membershipId` (`removeMember.path.membershipId`; string, required)

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.cloudraker.com/users/memberships/<membershipId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/users/memberships/<membershipId>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/users/memberships/<membershipId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 204

Member removed (empty body).


Source: https://docs.cloudraker.com/workspace/api/organization-settings/remove-member/index.md
