# Read prompt source

```http
GET /projects/{project_reference}/prompts/{prompt_id}/source
```

Read the editable source behind one prompt before changing it; returns the prompt with its content, source text, edit mode and the reasons it can only be edited as source. Requires project.agents.read.

## 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 |          | Source to read the prompt file from: project or preview\_branch. Falls back to runtime\_target\_kind when omitted. |
| `runtime_target_kind`   | query |          | Used as the source target kind when source\_target\_kind is omitted.                                               |
| `target_environment_id` | query |          | Not supported for source reads; a non-null value is rejected.                                                      |
| `target_branch_id`      | query |          | Preview branch to use. Required for the preview\_branch target; rejected for any other target.                     |

## Responses

| Status | Description     |
| ------ | --------------- |
| 200    | Prompt document |
| 400    | Bad request     |
| 401    | Unauthorized    |
| 403    | Forbidden       |
| 404    | Not found       |
