# Revoke End User Role

`DELETE /end-user-role-grants/{grantId}` · Core · Members & End Users

Revokes a specific end-user role grant by its `eur_`-prefixed grant ID, setting `revoked_at` on the grant record. The end-user loses the associated role on their next token mint. This action composes with the Maker-Checker policy framework by default. Requires `PROJECT_ADMIN` authority.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `grantId` | path | yes | The id of the grant to revoke (`eurg_...`), as the grant and list calls return it. Example: `"eurg_6Ws3Pd8Kq1Zv"`. |
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | The result of the revoke. |
| `data.revoked` | boolean | yes | True when this call revoked the grant. False when there is no active grant with this id (unknown, or already revoked); the call still succeeds. |
| `data.revokedAt` | object | yes | When the grant was revoked. Null when `revoked` is false. |
| _one of_ | | |  |
| _or_ | | |  |
| `meta` | object | yes | Request metadata: cost, timing and the request and trace ids. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_SESSION_EXPIRED` | Your session has expired; sign in again to continue. |
| 403 | `K9O_ACCESS_DENIED` | You do not hold the required role to revoke end-user role grants. |
| 404 | `K9O_END_USER_NOT_FOUND` | The specified end-user does not exist in this project. |

## Code samples

### cURL

```bash
curl -X DELETE 'https://<org>.api-<region>.k9o.io/@storefront/end-user-role-grants/<grantId>' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/end-user-role-grants/<grantId>', {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o end-user role-grant revoke <grant-id>
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.endUsers.roleGrants.revoke('eurg_6Ws3Pd8Kq1Zv')
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.end_users.role_grants.revoke("eurg_6Ws3Pd8Kq1Zv")
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.EndUsers.RoleGrants.Revoke(ctx, "eurg_6Ws3Pd8Kq1Zv")
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.end_users.role_grants.revoke("eurg_6Ws3Pd8Kq1Zv").await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.endUsers().roleGrants().revoke("eurg_6Ws3Pd8Kq1Zv")
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.EndUsers.RoleGrants.RevokeAsync("eurg_6Ws3Pd8Kq1Zv")
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.end_users.role_grants.revoke("eurg_6Ws3Pd8Kq1Zv")
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->end_users->role_grants->revoke('eurg_6Ws3Pd8Kq1Zv')
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/revoke-end-user-role
