Read prompt source

promptSource(projectReference: String!, id: String!, sourceTargetKind: SourceReadTargetKind, runtimeTargetKind: RuntimeTargetKind, targetBranchId: ID, targetEnvironmentId: ID): PromptSource!

Requires project.agents.read.

Arguments

ArgumentTypeRequiredDescription
projectReferenceString!Yes
idString!YesThe id of the definition, from its list.
sourceTargetKindSourceReadTargetKindNoThe source to read; default runtimeTargetKind, else project. main_branch reads the project source.
runtimeTargetKindRuntimeTargetKindNoUsed as the source to read when sourceTargetKind is omitted.
targetBranchIdIDNoRequired with the kind preview_branch.
targetEnvironmentIdIDNoNot supported for source reads; a non-null value is refused as invalid_input.

Response

Returns PromptSource!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
nameString!
descriptionString
contentStringThe prompt text, when the source declares it statically.
sourcePathString!
sourceString!The source text of the prompt file.
editModeSourceEditMode!
sourceOnlyReasons[String!]!Why the prompt can only be edited as source; empty for a structured prompt.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
query PromptSource($projectReference: String!, $id: String!, $sourceTargetKind: SourceReadTargetKind, $runtimeTargetKind: RuntimeTargetKind, $targetBranchId: ID, $targetEnvironmentId: ID) {
  promptSource(projectReference: $projectReference, id: $id, sourceTargetKind: $sourceTargetKind, runtimeTargetKind: $runtimeTargetKind, targetBranchId: $targetBranchId, targetEnvironmentId: $targetEnvironmentId) {
    id
    name
    content
    description
    editMode
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "id": "example"
}