---
type: api
title: Terminate a process
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-endpointkillprocessaction
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-endpointkillprocessaction
products:
  - Kibana
---

# Terminate a process

Authentication: required

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

## Paths

- `POST` `/api/endpoint/action/kill_process`
- `POST` `/s/{space_id}/api/endpoint/action/kill_process`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Description

Terminate a running process on an endpoint.

## Request body

`application/json`

- `agent_type` (enum) — optional
  List of agent types to retrieve. Defaults to `endpoint`.
  Values: `endpoint`, `sentinel_one`, `crowdstrike`, `microsoft_defender_endpoint`
- `alert_ids` (string[] · format: nonempty · min items: 1) — optional
  A list of alerts ids.
- `case_ids` (string[] · min items: 1) — optional
  Case IDs to be updated (cannot contain empty strings)
- `comment` (string) — optional
  Optional comment
- `endpoint_ids` (string[] · min items: 1) — required
  List of endpoint IDs (cannot contain empty strings)
- `parameters` (object) — required
  Optional parameters object

## Response

OK

`application/json`

Type: `object`

## Code examples

#### Console

```console
POST kbn:/api/endpoint/action/kill_process
{
  "comment": "terminate the process",
  "endpoint_ids": [
    "ed518850-681a-4d60-bb98-e22640cae2a8"
  ],
  "parameters": {
    "entity_id": "abc123"
  }
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/endpoint/action/kill_process" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "comment": "terminate the process",
    "endpoint_ids": [
      "ed518850-681a-4d60-bb98-e22640cae2a8"
    ],
    "parameters": {
      "entity_id": "abc123"
    }
  }'
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "data": {
    "agents": [
      "ed518850-681a-4d60-bb98-e22640cae2a8"
    ],
    "agentType": "endpoint",
    "command": "kill-process",
    "comment": "terminate the process",
    "completedAt": "2022-07-29T19:09:44.961Z",
    "createdBy": "myuser",
    "errors": [],
    "id": "233db9ea-6733-4849-9226-5a7039c7161d",
    "isCompleted": true,
    "isExpired": false,
    "outputs": {
      "ed518850-681a-4d60-bb98-e22640cae2a8": {
        "content": {
          "key": "value"
        },
        "type": "json"
      }
    },
    "parameters": {
      "entity_id": "abc123"
    },
    "startedAt": "2022-07-29T19:08:49.126Z",
    "wasSuccessful": true
  }
}
```

