Skip to main content
Prompt Hub is Arize AX’s version-controlled store for prompt templates, shared across the playground, tasks, and experiments. The GraphQL API lets you manage that same store from code: create prompts, add versions as you iterate, and move labels like 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 from viewer to find your space.
Once you have a prompt or version ID, fetch it directly with the 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

The Space.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.
Reference: createPrompt.

Add a new version to an existing prompt

Use createPromptVersion 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.
Reference: createPromptVersion.

Promote a version with a label, then roll it back

Labels like production 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.
Reference: 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.
Reference: deletePrompt.

Gotchas and behavior notes

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.
CreatePromptMutationInput.tags is marked deprecated in the schema in favor of creating tags explicitly and attaching them with a separate addTagsToPrompt mutation (not covered in this guide). Avoid relying on tags for new integrations.
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.