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

# Delete Agent Group

Use this API to delete an agent group document. **The agents referenced by the group are not affected** — they remain intact in the workspace's custom agent collection.

To delete a custom agent (and have it removed from every group), use [Delete Agent](/api-reference/rest-apis/v2/agents/delete).

# Endpoint

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

# 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>
      Trimmed, non-empty. Agent group id.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Delete a group

```JSON theme={null}
{
  "data": {
    "groupId": "grp_9f3ac2"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Agent group deleted successfully",
    "data": {
      "groupId": "grp_9f3ac2"
    }
  }
}
```

| Field          | Type   | Description                 |
| -------------- | ------ | --------------------------- |
| `data.groupId` | string | The ID of the deleted group |

#### Failure Response

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

**Errors:** `NOT_FOUND` (group does not exist).

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Agent group deleted successfully",
      "data": {
        "groupId": "grp_9f3ac2"
      }
    }
  }
  ```
</ResponseExample>
