Skip to main content
Prompts are the questions Qwairy monitors across AI platforms. Each prompt is categorized by funnel stage (TOFU/MOFU/BOFU), tagged for organization, and linked to a topic. Track which prompts generate mentions and source citations for your brand.
See Entities for the complete Prompt object structure, and Topic / Tag for classification objects.

List Prompts

Authorization
string
required
Bearer token. Example: Bearer qw-api-xxx
GET /api/v1/brands/{brandId}/prompts

Path Parameters

brandId
string
required
The unique identifier of the brand

Query Parameters

period
number
default:"30"
Number of days to include (based on last generated date)
startDate
string
Start date (ISO 8601 format)
endDate
string
End date (ISO 8601 format)
topic
string
Filter by topic ID (keywordId)
tag
string
Filter by tag ID
type
string
Filter by prompt type: TOFU, MOFU, BOFU
limit
number
default:"50"
Maximum number of prompts to return (max: 100)
offset
number
default:"0"
Pagination offset
sort
string
default:"lastGeneratedAt"
Field to sort by: lastGeneratedAt, answersCount, text, createdAt
order
string
default:"desc"
Sort order: asc or desc

Response

success
boolean
Indicates if the request was successful
pagination
object
prompts
array

Example Request

curl -X GET "https://qwairy.co/api/v1/brands/cm1234567890abcdef/prompts?type=TOFU&limit=10" \
  -H "Authorization: Bearer qw-api-your-token-here"

Example Response

{
  "success": true,
  "pagination": {
    "total": 156,
    "count": 1,
    "limit": 10,
    "offset": 0
  },
  "prompts": [
    {
      "id": "q1",
      "text": "What are the best products in this category?",
      "topic": "Product Reviews",
      "type": "TOFU",
      "tags": ["reviews", "comparison"],
      "answersCount": 2,
      "mentionRate": 50.0,
      "sourceRate": 25.0,
      "lastGeneratedAt": "2024-12-19T10:00:00.000Z"
    }
  ]
}

Get Prompt Details

GET /api/v1/brands/{brandId}/prompts/{promptId}

Path Parameters

brandId
string
required
The unique identifier of the brand
promptId
string
required
The unique identifier of the prompt

Response

Returns detailed prompt information with aggregated metrics.

Example Response

{
  "success": true,
  "prompt": {
    "id": "q1",
    "text": "What are the best products in this category?",
    "topic": {
      "id": "topic1",
      "name": "Product Reviews"
    },
    "type": "TOFU",
    "tags": [
      { "id": "tag1", "name": "reviews" },
      { "id": "tag2", "name": "comparison" }
    ],
    "answersCount": 2,
    "mentionRate": 50.0,
    "sourceRate": 25.0,
    "avgSentiment": 78.5,
    "avgRelevance": 72.0,
    "createdAt": "2024-12-01T10:00:00.000Z",
    "lastGeneratedAt": "2024-12-19T10:00:00.000Z"
  }
}

Get Prompt Answers

Retrieve all AI-generated responses for a specific prompt.
GET /api/v1/brands/{brandId}/prompts/{promptId}/answers

Path Parameters

brandId
string
required
The unique identifier of the brand
promptId
string
required
The unique identifier of the prompt

Query Parameters

provider
string
Filter by AI provider

Example Request

curl -X GET "https://qwairy.co/api/v1/brands/cm1234567890abcdef/prompts/q1/answers" \
  -H "Authorization: Bearer qw-api-your-token-here"

Example Response

{
  "success": true,
  "prompt": {
    "id": "q1",
    "text": "What are the best products in this category?"
  },
  "total": 2,
  "answers": [
    {
      "id": "ans1",
      "provider": "ChatGPT",
      "model": "GPT-4o",
      "text": "Based on recent reviews and comparisons...",
      "hasSelfMention": true,
      "selfMentionPosition": 3,
      "hasSelfSource": false,
      "competitorsMentioned": ["My Brand", "Competitor A", "Competitor B"],
      "sourcesCited": ["industry-news.com", "expert-reviews.com"],
      "sentiment": 82,
      "relevance": 75,
      "createdAt": "2024-12-19T10:00:00.000Z"
    },
    {
      "id": "ans2",
      "provider": "Perplexity",
      "model": "Sonar Large",
      "text": "According to expert reviews and user feedback...",
      "hasSelfMention": true,
      "selfMentionPosition": 2,
      "hasSelfSource": true,
      "competitorsMentioned": ["My Brand", "Competitor C", "Competitor D"],
      "sourcesCited": ["mybrand.com", "consumer-reports.com"],
      "sentiment": 78,
      "relevance": 80,
      "createdAt": "2024-12-19T10:05:00.000Z"
    }
  ]
}

Error Responses

StatusCodeDescription
400INVALID_PARAMETERInvalid query parameter
401INVALID_TOKENAuthentication failed
404BRAND_NOT_FOUNDBrand doesn’t exist or not accessible
404PROMPT_NOT_FOUNDPrompt doesn’t exist