---
type: api
title: Assign and unassign users from detection alerts
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-setalertassignees
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-setalertassignees
products:
  - Kibana
---

# Assign and unassign users from detection alerts

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

## Paths

- `POST` `/api/detection_engine/signals/assignees`
- `POST` `/s/{space_id}/api/detection_engine/signals/assignees`

## Description

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

Assign users to detection alerts, and unassign them from alerts.
> info
> You cannot add and remove the same assignee in the same request.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Request body

`application/json`

- `assignees` (object) — required
  - `add` (string[] · format: nonempty) — required
  - `remove` (string[] · format: nonempty) — required
- `ids` (string[] · format: nonempty · min items: 1) — required
  A list of alerts ids.

## Responses

#### `200`

Indicates a successful call.

#### `400`

Invalid request.

## Code examples

#### Console

```console
POST kbn:/api/detection_engine/signals/assignees
{
  "assignees": {
    "add": [
      "string"
    ],
    "remove": [
      "string"
    ]
  },
  "ids": [
    "string"
  ]
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/detection_engine/signals/assignees" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "assignees": {
      "add": [
        "string"
      ],
      "remove": [
        "string"
      ]
    },
    "ids": [
      "string"
    ]
  }'
```

