---
type: api
title: Remove an OpAMP collector
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-post-fleet-agents-agentid-remove-collector
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-post-fleet-agents-agentid-remove-collector
products:
  - Kibana
---

# Remove an OpAMP collector

Availability: 9.5+

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/fleet/agents/{agentId}/remove_collector`
- `POST` `/s/{space_id}/api/fleet/agents/{agentId}/remove_collector`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

#### Path Parameters

- `agentId` (string)
  The collector agent ID

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Remove a specific OpAMP collector from the Fleet agents list. Marks the collector as unenrolled. This action does not invalidate API keys, so the collector can reconnect on its own.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Responses

#### `200`

Successful response

#### `400`

Bad Request

## Code Examples

#### Console

```console
POST /api/fleet/agents/{agentId}/remove_collector
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/agents/{agentId}/remove_collector" \
  -H "kbn-xsrf: true"
```

## Response Examples

#### Post remove collector

Collector successfully removed

```json
{}
```

#### Generic error response

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

