# Remove a participant

> Removes a participant from a conversation. Parameters, responses, and code examples in cURL, JavaScript, Python, Go, and Ruby.

Source: https://www.bloomtext.com/developers/api/reference/remove-participant/

`DELETE /conversations/{conversationId}/participants/{userId}`

Removes a participant from a conversation.

**Scope** `participants:write`

### Path parameters

- `conversationId` (UUID, required): ID of the conversation.

- `userId` (UUID, required): ID of the 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. |
| 401 | `unauthorized` | The API key is missing, revoked, or invalid. |
| 403 | `insufficient_scope` | The key lacks the required scope. |
| 403 | `conversation_membership_required` | Your app user is not a participant in this conversation. |
| 404 | `not_found` | The resource doesn’t exist or isn’t visible to this key. |
| 429 | `rate_limited` | Too many requests. Retry after `Retry-After` seconds. |

```bash filename="Request"
curl -X DELETE "https://api.bloomtext.com/v1/conversations/e5c3b7b8-8f08-4d5a-9af1-0d11b0f4b7a0/participants/8b9c2d2f-6b1a-44f4-a7b1-0d6d3f2d6f55" \
  -H "Authorization: Bearer $BLOOMTEXT_API_KEY"
```

```js filename="Request"
const response = await fetch('https://api.bloomtext.com/v1/conversations/e5c3b7b8-8f08-4d5a-9af1-0d11b0f4b7a0/participants/8b9c2d2f-6b1a-44f4-a7b1-0d6d3f2d6f55', {
  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/conversations/e5c3b7b8-8f08-4d5a-9af1-0d11b0f4b7a0/participants/8b9c2d2f-6b1a-44f4-a7b1-0d6d3f2d6f55",
    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/conversations/e5c3b7b8-8f08-4d5a-9af1-0d11b0f4b7a0/participants/8b9c2d2f-6b1a-44f4-a7b1-0d6d3f2d6f55", 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/conversations/e5c3b7b8-8f08-4d5a-9af1-0d11b0f4b7a0/participants/8b9c2d2f-6b1a-44f4-a7b1-0d6d3f2d6f55")
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
```
