# Remove a member

> Removes a membership the API manages. When it's the person's only organization and your account owns their user, removing them deletes the user, so the call must add confirm_delete_user=true (it then answers 204 as for any removal); without it the call answers 409 confirmation_required with reason: would_delete_user and changes nothing.

Source: https://www.bloomtext.com/developers/api/reference/delete-member/

`DELETE /members/{memberId}`

Removes a membership the API manages. When it's the person's only organization and your account owns their user, removing them deletes the user, so the call must add `confirm_delete_user=true` (it then answers `204` as for any removal); without it the call answers 409 `confirmation_required` with `reason: would_delete_user` and changes nothing.

**Credentials:** [API key](https://www.bloomtext.com/developers/api/api-keys/) with member scopes · **Scope:** `members.write`

[Run in Postman](https://www.bloomtext.com/developers/api/postman/bloomtext-api.postman_collection.json): import the collection and set `api_key`.

### Path parameters

- `memberId` (UUID, required): The member's ID.

### Query parameters

- `org_id` (UUID): The organization the call acts on, from List organizations. Required when an account API key reaches more than one organization; an organization key or a key limited to one organization can leave it out.

- `confirm_delete_user` (boolean): `true` to remove someone from their only organization when that deletes their BloomText user.

### Returns

Returns `204 No Content` with an empty body.

### Errors

Failed requests return `application/problem+json` [problem details](https://www.bloomtext.com/developers/api/errors/). The errors specific to this endpoint:

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `invalid_request` | The request is malformed, such as invalid JSON. |
| 400 | `org_id_required` | The key reaches more than one organization: pass `org_id`. |
| 401 | `invalid_token` | The API key is missing or malformed, or isn’t a BloomText key. |
| 401 | `key_revoked` | The API key was revoked. |
| 401 | `key_expired` | The API key’s expiry has passed. |
| 403 | `insufficient_scope` | The key doesn’t have the scope this endpoint needs. |
| 403 | `org_not_reachable` | The key can't reach the organization in `org_id`. |
| 403 | `accounts_not_enabled` | The account layer isn't turned on for this account yet. |
| 404 | `not_found` | The resource doesn’t exist, or isn’t visible to this credential. |
| 409 | `managed_by_admin` | People in BloomText manage this membership. |
| 409 | `managed_by_account` | This is an Owner or IT person's membership. |
| 409 | `confirmation_required` | Removing them deletes their user: add `confirm_delete_user=true`. |
| 429 | `rate_limited` | Too many requests. Retry after `Retry-After` seconds. |

```bash filename="Request"
curl -X DELETE "https://api.bloomtext.com/v1/members/memberId" \
  -H "Authorization: Bearer $BLOOMTEXT_API_KEY"
```

```js filename="Request"
const response = await fetch('https://api.bloomtext.com/v1/members/memberId', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.BLOOMTEXT_API_KEY}`,
  },
})

if (!response.ok) throw new Error(`BloomText API error: ${response.status}`)
```

```python filename="Request"
import os

import requests

response = requests.delete(
    "https://api.bloomtext.com/v1/members/memberId",
    headers={
        "Authorization": f"Bearer {os.environ['BLOOMTEXT_API_KEY']}",
    },
)
response.raise_for_status()
```

```go filename="Request"
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest("DELETE", "https://api.bloomtext.com/v1/members/memberId", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("BLOOMTEXT_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.Status, string(out))
}
```

```ruby filename="Request"
require "net/http"
require "json"

uri = URI("https://api.bloomtext.com/v1/members/memberId")
request = Net::HTTP::Delete.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("BLOOMTEXT_API_KEY")}"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end
puts response.code
```

```text filename="Response"
HTTP/1.1 204 No Content
```
