# MD_LIST_FLIGHT_GRANTEES
> List the users, roles, and organization that can run a Flight, as a table function.
Returns who has `run` access to a [Flight](/concepts/flights) you own. Organization Admins can list the grants on any Flight in the organization. It returns the same rows as [`SHOW GRANTS ON FLIGHT`](../grant-run-on-flight), as a table function you can filter, join, and use in subqueries.

## Syntax

```sql
SELECT * FROM MD_LIST_FLIGHT_GRANTEES('<flight_id>'::UUID);
```

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `flight_id` | `UUID` | Yes | Identifier of the Flight, passed positionally. Cast a string literal with `::UUID`; a plain string fails with `No function matches`. |

## Return columns

| Column | Type | Description |
|---|---|---|
| `grantee_name` | `VARCHAR` | The username or role name. For an organization grant, the organization's name. |
| `grantee_type` | `VARCHAR` | `user`, `role`, or `organization`. |
| `privilege` | `VARCHAR` | `run`. |

## Examples

List who can run a Flight:

```sql
SELECT grantee_name, grantee_type
FROM MD_LIST_FLIGHT_GRANTEES('7b1e2c3d-0000-4000-8000-000000000001'::UUID)
ORDER BY grantee_type, grantee_name;
```

Check whether a Flight is open to the whole organization:

```sql
SELECT count(*) > 0 AS org_wide
FROM MD_LIST_FLIGHT_GRANTEES('7b1e2c3d-0000-4000-8000-000000000001'::UUID)
WHERE grantee_type = 'organization';
```

## Related

- [`GRANT RUN ON FLIGHT`](../grant-run-on-flight) — grant, revoke, and show `run` access.
- [Add write-back to a Dive](/key-tasks/dives/run-flights-from-dives)


---

## 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%2Fmotherduck-sql-reference%2Fflights%2Fmd-list-flight-grantees%2F&page_title=MD_LIST_FLIGHT_GRANTEES&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.
