> ## Documentation Index
> Fetch the complete documentation index at: https://velt-raghul-agents-doc-latest.mintlify.site/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.
</Note>

# Endpoint

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

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="groupId" type="string" required>
      Min 1 char. Agent group id.
    </ParamField>

    <ParamField body="agentIds" type="string[]" required>
      Non-empty array of agent ids to remove. Each id must be min 1 char.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

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

# Response

#### Success Response

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

Returns the updated group document.

#### 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.

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