> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/crowdstrike/remove-from-host-group.md).

# Remove from Host Group

Removes every CrowdStrike host in the devices the workflow collected from the host group you name. It is the counterpart of [Add to Host Group](broken://pages/ded4f8631785099877a142f21fd7d0f8435b84da).

### Before you begin

* The CrowdStrike adapter connected and discovered, so devices carry a CrowdStrike device ID.
* A CrowdStrike OAuth2 API client (Client ID and Client Secret) with the write scopes this action needs, and the API domain of your Falcon region. Enter them in the job, or save them once as defaults (see [Action Center Settings](broken://pages/d0ff1959f47130cb606334754624d02547cf56ba)).
* Asset type: `device` only.
* Required column: `Specifics.falcon-crowdstrike.device_id`. Devices without a CrowdStrike device ID are left out.
* A condition node before the job, so that devices are collected for it to act on.
* The ID of an existing CrowdStrike host group.

### Settings

| Setting                | Type          | Required | Default                       | Description                                                                                                            |
| ---------------------- | ------------- | -------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| CrowdStrike API Domain | Text          | No       | `https://api.crowdstrike.com` | CrowdStrike API base URL, including `https://`. It is region specific, for example `https://api.us-2.crowdstrike.com`. |
| Client ID              | Text          | Yes      | None                          | CrowdStrike OAuth2 API client ID with the required write scopes.                                                       |
| Client Secret          | Text (masked) | Yes      | None                          | CrowdStrike OAuth2 API client secret. Sensitive: shown as ten asterisks after saving.                                  |
| Request Timeout        | Number        | No       | 30                            | Timeout in seconds for API requests.                                                                                   |
| Host Group ID          | Text          | Yes      | None                          | CrowdStrike host group ID to add the assets to or remove them from.                                                    |

### How it works

The job collects the CrowdStrike device ID of each device and sends them in batches of 100. For each batch it sends one `POST` to `<domain>/devices/entities/host-group-actions/v1` with the query parameter `action_name=remove-hosts`. The body carries the Host Group ID in `ids` and a filter of the form `(device_id:['id1','id2',...])` in `action_parameters`. So the number of requests is the number of devices divided by 100, rounded up.

At the start of every run the job requests an OAuth2 access token from `<domain>/oauth2/token` with the Client ID and Client Secret. If no token is returned, the job logs an error, sends nothing and ends without failing the workflow.

The job does not check the response status of the action requests. If CrowdStrike rejects a request (for example because of missing scopes or an unknown ID), nothing is raised. Only a failure to send a request is logged, and the job continues with the next batch.

When it finishes, the job passes the assets it received on to the next node unchanged.

### Example

```
CrowdStrike API Domain: https://api.us-2.crowdstrike.com
Client ID:              YOUR_CLIENT_ID
Client Secret:          YOUR_CLIENT_SECRET
Request Timeout:        30
Host Group ID:          YOUR_HOST_GROUP_ID
```

Use the same Host Group ID that the matching add job uses.

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/9eb77624c69a4a5d5f928343d35d5ad14af10164">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save default values and SSH connections for jobs.</td><td><a href="broken://pages/d0ff1959f47130cb606334754624d02547cf56ba">Broken link</a></td></tr><tr><td><strong>Add to Host Group</strong></td><td>Add hosts to a group.</td><td><a href="broken://pages/ded4f8631785099877a142f21fd7d0f8435b84da">Broken link</a></td></tr><tr><td><strong>Contain Host</strong></td><td>Isolate hosts.</td><td><a href="broken://pages/0948ccc397afc5c5802e6601582c29b87e6b5b98">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.6.1.
{% endhint %}
