# MD_UPDATE_DIVE_STATUS
> Set a Dive's governance status (draft, ready, endorsed, or archived).
Sets the [status](/key-tasks/ai-and-motherduck/dives/dive-statuses) of an existing [Dive](/key-tasks/ai-and-motherduck/dives). The status is recorded against a specific version of the Dive; later content updates don't change it.

## Syntax

```sql
SELECT * FROM MD_UPDATE_DIVE_STATUS(
  id ='your-dive-uuid'::UUID,
  status ='ready'
);
```

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | `UUID` | Yes | The unique identifier of the Dive |
| `status` | `VARCHAR` | Yes | One of `draft`, `ready`, `endorsed`, or `archived` |
| `version` | `UINTEGER` | No | The reviewed version the status applies to. Defaults to the Dive's current version. |

## Permissions

Owners can set `draft`, `ready`, or `archived` on their own Dives. Organization admins can set any status on any Dive in the organization, and only admins can set `endorsed`.

## Return columns

Returns the updated Dive summary.

| Column | Type | Description |
|--------|------|-------------|
| `id` | `UUID` | Unique identifier of the Dive |
| `title` | `VARCHAR` | Dive title |
| `description` | `VARCHAR` | Dive description |
| `owner_id` | `UUID` | UUID of the Dive owner |
| `current_version` | `INTEGER` | Latest version number (1-based) |
| `created_at` | `TIMESTAMP WITH TIME ZONE` | When the Dive was created |
| `updated_at` | `TIMESTAMP WITH TIME ZONE` | When the Dive was last updated |
| `owner_name` | `VARCHAR` | Name of the Dive owner |
| `status` | `VARCHAR` | The Dive's status |
| `status_changed_at` | `TIMESTAMP WITH TIME ZONE` | When the status was last set |
| `status_set_by` | `UUID` | UUID of the user who set the status |
| `status_applies_to_version` | `UINTEGER` | The version the status was set against |

## Examples

Mark a Dive as ready for others to use:

```sql
SELECT id, title, status, status_applies_to_version
FROM MD_UPDATE_DIVE_STATUS(
  id ='a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID,
  status ='ready'
);
```

Endorse a specific reviewed version (requires an organization admin):

```sql
SELECT *
FROM MD_UPDATE_DIVE_STATUS(
  id ='a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID,
  status ='endorsed',
  version =3
);
```

## Errors

- Returns an error if the Dive does not exist or you don't own it (and aren't an admin).
- Returns an error if `status` isn't one of the four valid values.
- Returns an authorization error if a non-admin sets `endorsed`.
- Returns an error if `version` doesn't exist for the Dive.

## Related

- [Dive statuses](/key-tasks/ai-and-motherduck/dives/dive-statuses) — What each status means and where it appears
- [`MD_LIST_DIVES`](../md-list-dives) — List Dives, including their statuses
- [`MD_GET_DIVE`](../md-get-dive) — Read a Dive, including its status


---

## 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%2Fai-functions%2Fdives%2Fmd-update-dive-status%2F&page_title=MD_UPDATE_DIVE_STATUS&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.
