Update prompt

updatePrompt(projectReference: String!, id: String!, input: UpdatePromptInput!): PromptSource!

Requires project.agents.write.

Arguments

ArgumentTypeRequiredDescription
projectReferenceString!Yes
idString!YesThe id of the definition, from its list.
inputUpdatePromptInput!Yes

Input fields

input

UpdatePromptInput

FieldTypeRequiredDescription
descriptionStringNoReplaces the description; omit it or send null to clear it.
contentString!Yes
sourceTargetKindWriteTargetKindNoThe source to write; default project.
targetBranchIdIDNoRequired with the kind preview_branch.

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
mutation UpdatePrompt($projectReference: String!, $id: String!, $input: UpdatePromptInput!) {
  updatePrompt(projectReference: $projectReference, id: $id, input: $input) {
    id
    name
    content
    description
    editMode
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "id": "example",
  "input": {
    "content": "example"
  }
}