> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove Agents from Group

Use this API to remove one or more agents from a group.

> [!NOTE]
>
> This operation is **idempotent**: removing an agent that is not a member is a silent success. Removal uses `arrayRemove`, so it never throws for absent ids. The agents themselves are not deleted; only their membership in this group is removed.

# Endpoint

`POST https://api.velt.dev/v2/agents/groups/remove-agents`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**groupId** `string` *required*

Min 1 char. Agent group id.

**agentIds** `string[]` *required*

Non-empty array of agent ids to remove. Each id must be min 1 char.

## **Example Requests**

```JSON theme={null}
{
  "data": {
    "groupId": "K3mR7pQxN2vB9wLdT4sY",
    "agentIds": ["spell-check"]
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Agents removed from group successfully",
    "data": {
      "group": {
        "id": "K3mR7pQxN2vB9wLdT4sY",
        "name": "Brand QA",
        "agentIds": ["abc123def456"],
        "metadata": { "apiKey": "ak_xxx" },
        "createdAt": 1711900000000,
        "updatedAt": 1711950000000
      }
    }
  }
}
```

Returns the updated group document, the same shape as [Get Group](https://velt.dev/docs/api-reference/rest-apis/v2/agents/groups/get.md). System groups carry `system: true`; groups you created omit the field.

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "NOT_FOUND"
  }
}
```

**Errors:**

* `NOT_FOUND`: the group does not exist.
* `INVALID_ARGUMENT`: empty `agentIds` array or empty id values.

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Agents removed from group successfully",
    "data": {
      "group": {
        "id": "K3mR7pQxN2vB9wLdT4sY",
        "name": "Brand QA",
        "agentIds": ["abc123def456"],
        "metadata": { "apiKey": "ak_xxx" },
        "createdAt": 1711900000000,
        "updatedAt": 1711950000000
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.