# Remove Member

Remove someone from your company. The same call cancels an invite for a person who never signed up. Removing a user who is not in the company succeeds and changes nothing.

`DELETE https://connect.mindcloud.co/v2/members/:userId`

Permissions: `member:delete`.

## Parameters

### Path

- `userId` (string, required): The member's userId, from List Members.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request DELETE \
  --url 'https://connect.mindcloud.co/v2/members/user_2wXk9Lm4Pq7Rz3Ts8Vb1Nc6Hd' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): The id of the resource that was deleted.

## Example response

```json
{
  "success": true,
  "data": {
    "id": "user_2wXk9Lm4Pq7Rz3Ts8Vb1Nc6Hd"
  }
}
```

## Errors

- 400 Bad request (INVALID_QUERY, MEMBER_DELETE_LAST_OWNER_FORBIDDEN): `VALIDATION_FAILED` / `MEMBER_DELETE_LAST_OWNER_FORBIDDEN` "Cannot remove the last Owner. At least one Owner must remain in the company."
- 403 Access denied (API_KEY_PERMISSION_DENIED, MEMBER_ACTOR_NOT_RESOLVED, MEMBER_DELETE_SELF_FORBIDDEN, MEMBER_DELETE_OWNER_FORBIDDEN): `FORBIDDEN` / `MEMBER_DELETE_SELF_FORBIDDEN` "Users cannot remove themselves from the company."
