# Revoke Access for a Departed User

A user has left your organization. You need to ensure they can no longer access any Aritma resources.

**Approach:** Find all their policies and delete them. If they are in any groups, remove them.

## Prerequisites

- An access token with IAM admin permissions
- The subject ID of the user whose access you want to revoke


## Step 1: Find all policies for the user

```shell curl
curl -i -X GET \
  https://api.aritma.io/core/iam/v1/policies \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

Filter by `subject` using the user's subject ID. Repeat with pagination if the response includes a `cursor`.

## Step 2: Delete each policy

```shell curl
curl -i -X DELETE \
  https://api.aritma.io/core/iam/v1/policies \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "subject": "user-00000000-0000-0000-0000-000000000000",
    "scope": "/subscriptions/123",
    "action": "iam.policy.read"
  }'
```

Repeat for each policy returned in step 1.

## Step 3: Check group memberships

```shell curl
curl -i -X GET \
  'https://api.aritma.io/core/iam/v1/subjects/{subject}/memberships' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

This returns all groups the user currently belongs to. Group membership may grant additional permissions through group-level policies.

## Step 4: Remove from each group

```shell curl
curl -i -X DELETE \
  'https://api.aritma.io/core/iam/v1/subjects/groups/{groupSubjectId}/members' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "subjectIds": [
      "string"
    ]
  }'
```

Repeat for each group returned in step 3.

Access is revoked immediately — there is no delay or cache TTL to wait for.

## Next steps

- To delete the user subject entirely, see [User Management](/apis/platform/iam/guides/user-management#delete-a-user)
- To manage groups and their members, see [Groups](/apis/platform/iam/guides/groups)
- To review remaining policies across your tenant, see [Policies](/apis/platform/iam/guides/policies)