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

# Delete a Permission Group

> Remove a group and every grant that reached people through it.

<Warning>
  Deleting a group takes away the access it was giving. Everybody in it loses every grant they held **through** the group, on all three permission axes, immediately. Grants they hold in their own right are untouched. This cannot be undone — recreating the group means granting it again from nothing.
</Warning>

```bash theme={null}
curl --request DELETE \
  --url https://api.nekt.ai/api/v1/organization/permission-groups/GROUP_ID/ \
  --header "x-api-key: YOUR_API_KEY"
```

## Response

`204`, with no body.

## Check what you are about to remove

A group's grants are worth reading before deleting it, because the effect is spread across everybody in it.

```python theme={null}
import os

import requests

BASE_URL = "https://api.nekt.ai"
headers = {"x-api-key": os.environ["NEKT_API_KEY"]}
group_id = "GROUP_ID"

params = {"expand[]": ["users", "lakehouse_permissions", "object_permissions", "semantic_layer_permissions"]}
group = requests.get(
    f"{BASE_URL}/api/v1/organization/permission-groups/{group_id}/",
    headers=headers,
    params=params,
).json()

print(f"{group['name']} — {len(group['users'])} member(s) would lose:")
for axis in ("lakehouse_permissions", "object_permissions", "semantic_layer_permissions"):
    print(f"  {axis}: {len(group.get(axis) or [])} grant(s)")
```

## Emptying instead of deleting

If the group might be needed again, [replacing its membership](/platform-api/permission-groups/update) with an empty list has the same effect on access and keeps the group and its grants intact.

```bash theme={null}
curl --request PATCH \
  --url https://api.nekt.ai/api/v1/organization/permission-groups/GROUP_ID/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"users": []}'
```

## Errors

| Status | When                                                 |
| ------ | ---------------------------------------------------- |
| `400`  | The group is the All group, which cannot be deleted. |
| `403`  | Your API key was created by a Member.                |
| `404`  | No group with that id in your workspace.             |

## Related

* [Update a Group](/platform-api/permission-groups/update) — emptying it instead.
* [Revoke Permission](/platform-api/permissions/catalog/revoke) — removing one grant rather than the group.


## OpenAPI

````yaml DELETE /api/v1/organization/permission-groups/{id}/
openapi: 3.0.3
info:
  title: Nekt API
  version: v1
  description: Nekt API Documentation
  contact:
    email: support@nekt.ai
servers:
  - url: https://api.nekt.ai
security: []
paths:
  /api/v1/organization/permission-groups/{id}/:
    delete:
      tags:
        - v1
      summary: Delete a permission group
      operationId: v1_organization_permission_groups_destroy
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: The permission group's id.
          required: true
      responses:
        '204':
          description: No response body
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Format: ''x-api-key: api_key'''

````