---
title: "Revoke a user's access to a mind"
description: "Withdraw access. An admin may revoke a viewer but not another admin;\nonly the owner can do that."
---

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

Path: AI Gateway API › Minds

`DELETE /minds/{mind_id}/grants/{user_id}`

Withdraw access. An admin may revoke a viewer but not another admin;
only the owner can do that.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `mind_id` (`revoke_mind_access.path.mind_id`; string, required)
  - format `uuid`
- `user_id` (`revoke_mind_access.path.user_id`; string, required)

## Header parameters

- `X-App-Id` (`revoke_mind_access.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`
- `X-On-Behalf-Of` (`revoke_mind_access.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`revoke_mind_access.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://truememory-api.mvstg.com/minds/<mind_id>/grants/<user_id>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/minds/<mind_id>/grants/<user_id>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/minds/<mind_id>/grants/<user_id>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 204

Successful Response

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`revoke_mind_access.response.422.detail`; array<object>, optional)
  - `loc` (`revoke_mind_access.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`revoke_mind_access.response.422.detail.msg`; string, required)
  - `type` (`revoke_mind_access.response.422.detail.type`; string, required)
  - `input` (`revoke_mind_access.response.422.detail.input`; unknown, optional)
  - `ctx` (`revoke_mind_access.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/minds/grants/delete/index.md
