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

NameInRequiredDescription
project_referencepathYesProject slug, UUID, or domain that identifies the project.
prompt_idpathYes
source_target_kindquerySource to read the prompt file from: project or preview_branch. Falls back to runtime_target_kind when omitted.
runtime_target_kindqueryUsed as the source target kind when source_target_kind is omitted.
target_environment_idqueryNot supported for source reads; a non-null value is rejected.
target_branch_idqueryPreview branch to use. Required for the preview_branch target; rejected for any other target.

Responses

StatusDescription
200Prompt document
400Bad request
401Unauthorized
403Forbidden
404Not found