Prompt Runs
A prompt run represents a single execution of a prompt against an AI provider. Each prompt run produces an answer that may contain citations (URL references) and brand mentions.
Status lifecycle
Prompt runs progress through these statuses:
| Status | Description |
|---|---|
pending | Created and waiting to be processed |
running | Currently being processed by the AI provider |
finished | Successfully completed with results |
failed | Processing failed (see failureReason) |
List prompt runs
Retrieve prompt runs for a specific prompt with brand-specific metrics:
GetAiVisibilityPromptRunsTry in Explorer
GraphQL
query GetAiVisibilityPromptRuns(
$accountId: ObjectID!
$aiVisibilityPromptId: ObjectID!
$aiVisibilityBrandId: ObjectID!
$dateRange: AiVisibilityDateRangeInput
) {
getAiVisibilityPromptRuns(
accountId: $accountId
aiVisibilityPromptId: $aiVisibilityPromptId
aiVisibilityBrandId: $aiVisibilityBrandId
dateRange: $dateRange
first: 20
orderBy: [{ field: createdAt, direction: DESC }]
) {
nodes {
id
rawId
status
aiProviderType
brandVisible
totalBrandCitations
totalBrandMentions
bestBrandPosition
avgBrandSentiment
createdAt
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
Sorting
Prompt runs can be sorted by: createdAt, status, totalBrandCitations, totalBrandMentions, bestBrandPosition, avgBrandSentiment.
Default sort is createdAt DESC.
Computed fields
Each prompt run includes these brand-specific metrics (calculated for the brand specified by aiVisibilityBrandId, including any merged variants):
| Field | Description |
|---|---|
brandVisible | Whether the brand appeared in the response (citations or mentions) |
totalBrandCitations | Number of citations referencing the brand |
totalBrandMentions | Number of times the brand was mentioned |
bestBrandPosition | Best (lowest) citation position for the brand |
avgBrandSentiment | Average sentiment score for brand mentions |
Get prompt run details
Fetch the full details of a prompt run, including the AI response text, all citations, and all mentions:
GetAiVisibilityPromptRunDetailsTry in Explorer
GraphQL
query GetAiVisibilityPromptRunDetails(
$accountId: ObjectID!
$aiVisibilityPromptRunId: ObjectID!
$aiVisibilityBrandId: ObjectID!
) {
getAiVisibilityPromptRunDetails(
accountId: $accountId
aiVisibilityPromptRunId: $aiVisibilityPromptRunId
aiVisibilityBrandId: $aiVisibilityBrandId
) {
aiProviderType
promptText
topicName
fullAnswerText
brandVisible
totalBrandCitations
totalBrandMentions
bestBrandPosition
avgBrandSentiment
visibilityScore
brandCitations {
url
position
citationQualityScore
}
brandMentions {
brandName
brandType
brandMentionQualityScore
sentiment
sentimentJustification
}
otherBrandCitations {
url
position
brandName
brandType
}
createdAt
}
}
The response includes:
fullAnswerText-- The complete AI-generated responsepromptText-- The original prompt textbrandCitations-- Citations attributed to the specified brandbrandMentions-- Mentions of the specified brandotherBrandCitations-- Citations attributed to other brands
Schema reference
AiVisibilityPromptRunListItem-- Prompt run list itemAiVisibilityPromptRunDetails-- Full prompt run detailsAiVisibilityPromptRunStatus-- Status enumAiVisibilityPromptRunCitation-- Citation in a runAiVisibilityPromptRunMention-- Mention in a run