# Update prompt

```http
PUT /projects/{project_reference}/prompts/{prompt_id}
```

Replace the content and description of a structured prompt, where REST and GraphQL clear an omitted description and the MCP tool keeps it; returns the updated prompt source document. Requires project.agents.write.

## Parameters

| Name                 | In    | Required | Description                                                                                          |
| -------------------- | ----- | -------- | ---------------------------------------------------------------------------------------------------- |
| `project_reference`  | path  | Yes      | Project slug, UUID, or domain that identifies the project.                                           |
| `prompt_id`          | path  | Yes      |                                                                                                      |
| `source_target_kind` | query |          | Where to write the prompt file: project (the default) or preview\_branch. Other values are rejected. |
| `target_branch_id`   | query |          | Preview branch to use. Required for the preview\_branch target; rejected for any other target.       |

## Request body

| Field         | Type        | Required | Description                                                                                                         |
| ------------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| `description` | string,null |          | Prompt description. Null clears it. When omitted, REST and GraphQL clear it and the MCP tool keeps the current one. |
| `content`     | string      | Yes      | Prompt text.                                                                                                        |

## Responses

| Status | Description             |
| ------ | ----------------------- |
| 200    | Updated prompt document |
| 400    | Bad request             |
| 401    | Unauthorized            |
| 403    | Forbidden               |
| 404    | Not found               |
| 409    | Conflict                |
