production or staging between versions without touching the UI. This guide assumes you already know how to form a GraphQL call with an x-api-key header against https://app.arize.com/graphql.
Find the IDs you need
Every prompt mutation needs a space ID, and most need a prompt or prompt version ID. Start fromviewer to find your space.
node root field, for example node(id: "<PROMPT_ID>") { ... on Prompt { name } }. See Using global node IDs for how these opaque IDs work.
List prompts and their versions in a space
TheSpace.prompts connection returns every prompt in a space. Each prompt’s versionHistory connection returns its versions, including the labels attached to each one, so you can see what is currently labeled production without a separate call.
Create a prompt with a first version
createPrompt creates the prompt and its first version in one call: the messages, model, provider, and invocation parameters all live on the input, not on a separate version mutation. inputVariableFormat tells the parser how {variable} placeholders in your messages are written.
createPrompt.
Add a new version to an existing prompt
UsecreatePromptVersion once you want to change the messages, model, or parameters without losing history. Each version keeps its own commitMessage, so treat it like a commit log entry describing what changed.
createPromptVersion.
Promote a version with a label, then roll it back
Labels likeproduction or staging point at a specific version, and moving a label is how you deploy a new version without changing the prompt ID your application references. updatePromptVersionLabel moves (or creates) a label on the version you pass in; if another version already holds that label, Prompt Hub moves it off that version. removePromptVersionLabel takes the label off entirely, for example to roll back a bad promotion. Note the version field name differs between the two: versionId on one, promptVersionId on the other.
updatePromptVersionLabel, removePromptVersionLabel.
Delete a prompt
Deleting a prompt removes every version under it. There is no separate “delete version” mutation in this domain, so retire a single bad version by removing its labels rather than deleting the whole prompt.deletePrompt.
Gotchas and behavior notes
updatePromptVersionLabelMutationInput is lowercase, and the version field name changes
updatePromptVersionLabelMutationInput is lowercase, and the version field name changes
Unlike every other input type in this domain, the schema spells this one
updatePromptVersionLabelMutationInput and updatePromptVersionLabelMutationPayload with a lowercase first letter; use the exact casing or the request fails to parse. It also takes versionId for the version, while removePromptVersionLabel takes promptVersionId for the same concept. Double-check which name applies when you switch between the two.Input and output provider enums do not match, and messages read back as JSON
Input and output provider enums do not match, and messages read back as JSON
createPrompt and createPromptVersion accept provider: ExternalLLMProvider, which excludes cursor and typeSafeAi. But Prompt.provider and PromptVersion.provider are typed as the broader LLMIntegrationProvider, which includes them, so a prompt saved through one of those integrations can return a value you cannot pass back in. Separately, Prompt.messages and PromptVersion.messages are typed [JSON!]! on read even though the write side takes a strongly typed [LLMMessageInput!]!, so reusing a fetched prompt’s messages in a new version means reshaping the JSON back into the role/content input shape yourself.Prompt mutations reference
Full argument and field listing for all six prompt mutations.
All GraphQL mutations
Browse mutations for every other domain.
API explorer
Try queries and mutations interactively with autocomplete.