---
title: "Remove Agent From Group"
method: DELETE
path: "/agents/{id}/groups/{groupId}"
tags: ["agents"]
---

# Remove Agent From Group

`DELETE /agents/{id}/groups/{groupId}`

## Request

- Base URL: `https://api.instruxi.dev/api/v1/enforcer`
- URL: `https://api.instruxi.dev/api/v1/enforcer/agents/{id}/groups/{groupId}`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `X-API-Key`

Removes the agent's service account from a group. The agent's manager, or the group's creator, may do it.

## Path parameters

- `id` string, required
- `groupId` string, required

## Response `200`

OK

- InternalDeliveryHttpHandlerAgentGroupMembershipResponse
  - `data` InternalDeliveryHttpHandlerAgentGroupMembershipData
    - `added` boolean: Added is true on a join that changed membership; Removed on a leave.
    - `group_id` string
    - `removed` boolean
  - `success` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/instruxi/apis/enforcer-api.md) · [All operations](https://skmtc.dev/instruxi/apis/enforcer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/instruxi/apis/enforcer-api/revisions/fa82bc1becc0?raw)
