# revoke_access
> Remove users', roles', or your organization's access to a Dive or a Flight, through the MCP server.
Remove users', roles', or your whole organization's access to a [Dive](/key-tasks/dives/) or a [Flight](/concepts/compute/flights):

- **Dive:** removes `read` access. The Dive's owner and organization Admins can revoke it. The SQL equivalent is [`REVOKE READ ON DIVE`](/sql-reference/motherduck-sql-reference/dives/grant-read-on-dive).
- **Flight:** removes `run` access. The Flight's owner and organization Admins can revoke it, including Admins who don't own the Flight. The SQL equivalent is [`REVOKE RUN ON FLIGHT`](/sql-reference/motherduck-sql-reference/flights/grant-run-on-flight).

## Description

Revoking a grant that doesn't exist succeeds and changes nothing. Other grants on the object stay in place.

An object you can't change is reported as not found, so `Could not find Dive` or `Could not find Flight` can mean you lack permission rather than that the ID is wrong.

## Input parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `resource_type` | string | Yes | `"dive"` or `"flight"`. |
| `id` | string (UUID) | Yes | The Dive or Flight UUID. |
| `grantees` | object[] | Yes | 1 to 100 grantees, each `{ "type": "user" \| "role" \| "organization", "name": string }`. Omit `name` for the organization, or pass `null`; any other name for an organization grantee is an error. An unknown name fails the whole call. |
| `permission` | string | No | `"read"` for a Dive or `"run"` for a Flight. Each object supports only its own permission, which is the default. |

## Output schema

On success:

```json
{
  "success": true,
  "resource_type": string,
  "id": string,
  "permission": string,
  "grantees": [{ "type": string, "name": string }]
}
```

`grantees` echoes the grantees you passed. An organization grantee has no `name`.

On failure, only the error:

```json
{
  "success": false,
  "error": string
}
```

## Example usage

Make a Dive private to its owner by removing the organization's access:

```json
{
  "resource_type": "dive",
  "id": "80000000-0000-4000-8000-000000000001",
  "grantees": [{ "type": "organization" }]
}
```

Stop everyone in the organization from running a Flight:

```json
{
  "resource_type": "flight",
  "id": "7b1e2c3d-0000-4000-8000-000000000001",
  "grantees": [{ "type": "organization" }]
}
```

## Related

- [`grant_access`](../grant-access) — Give access.
- [`REVOKE READ ON DIVE`](/sql-reference/motherduck-sql-reference/dives/grant-read-on-dive) — SQL equivalent for Dives.
- [`REVOKE RUN ON FLIGHT`](/sql-reference/motherduck-sql-reference/flights/grant-run-on-flight) — SQL equivalent for Flights.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmcp%2Fflights%2Frevoke-access%2F&page_title=revoke_access&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
