Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.topify.ai/llms.txt

Use this file to discover all available pages before exploring further.

Prompts are the AI search queries Topify.ai tracks daily across all AI providers. Each prompt generates responses that are analyzed for brand visibility, sentiment, citations, and competitor mentions. The API supports full CRUD operations on prompts. Read endpoints are available to all API keys. Write endpoints (create, update, delete) require an admin-scoped API key.

List prompts

GET /projects/{project_id}/prompts
Returns all prompts in a project, ordered by creation date.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts" \
  -H "X-API-Key: tk_live_..."

Response

{
  "success": true,
  "data": {
    "project_id": "a1b2c3d4-...",
    "total": 25,
    "prompts": [
      {
        "id": "e5f6a7b8-...",
        "project_id": "a1b2c3d4-...",
        "content": "What is the best project management tool?",
        "prompt_type": "active",
        "topic_id": "t1u2v3w4-...",
        "country": "US",
        "visibility": 85.0,
        "sentiment": 72,
        "position": 2.3,
        "volume": 150,
        "cvr": 45.0,
        "intent": "commercial",
        "trend": "up",
        "created_at": "2026-01-15T10:30:00+00:00"
      }
    ]
  }
}

Prompt fields

FieldTypeNullableDescription
idstring (UUID)NoPrompt ID
project_idstring (UUID)NoParent project ID
contentstringNoThe AI search query text
prompt_typestringNoactive, suggested, pending, inactive, or url_recommended
topic_idstring (UUID)YesTopic this prompt belongs to
countrystringYesTarget country for localized responses
visibilityfloatYesBrand visibility percentage (0—100)
sentimentintegerYesBrand sentiment score
positionfloatYesAverage brand position in responses
volumeintegerYesNumber of responses collected
cvrfloatYesContent visibility rate
intentstringYesQuery intent: informational, commercial, navigational, transactional
trendstringYesTrend direction: up, down, or stable
created_atstring (ISO 8601)NoCreation timestamp

Get prompt

GET /projects/{project_id}/prompts/{prompt_id}
Returns a single prompt. Same fields as list.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID
prompt_idstring (UUID)The prompt ID
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}" \
  -H "X-API-Key: tk_live_..."

Create prompts

POST /projects/{project_id}/prompts
Add one or more prompts to a project. Each prompt begins tracking immediately — Topify.ai will start collecting AI responses and calculating metrics in the background.
Requires an admin-scoped API key. Viewer keys receive a 403 response.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project to add prompts to

Request body

FieldTypeRequiredDescription
promptsstring[]YesArray of prompt texts to track (1—50 per request)
topicIdstring (UUID)YesTopic to assign the prompts to
countrystringNoISO country code for localized responses
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompts": ["What is the best project management tool?", "Top PM software for teams"],
    "topicId": "t1u2v3w4-...",
    "country": "US"
  }'

Response

{
  "code": 200,
  "message": "200 OK",
  "data": {
    "projectId": "a1b2c3d4-...",
    "created": 2,
    "prompts": [
      {
        "id": "e5f6a7b8-...",
        "projectId": "a1b2c3d4-...",
        "content": "What is the best project management tool?",
        "promptType": "Active",
        "topicId": "t1u2v3w4-...",
        "country": "US",
        "createdAt": "2026-03-30T10:30:00+00:00"
      }
    ]
  }
}

Error responses

StatusCause
400Empty prompts array, whitespace-only content, or missing topicId
403API key has read-only (viewer) access
409A prompt with the same content already exists in this project
429Prompt quota exceeded for your plan tier

Update prompt

PATCH /projects/{project_id}/prompts/{prompt_id}
Update the content, country, topic, or type of an existing prompt.
Requires an admin-scoped API key.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID
prompt_idstring (UUID)The prompt to update

Request body

All fields are optional. Include only the fields you want to change.
FieldTypeDescription
contentstringNew prompt text (cannot be empty)
countrystringISO country code
topicIdstring (UUID)Reassign to a different topic
promptTypestringChange prompt type (Active, Inactive, Suggested)
curl -X PATCH "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"content": "Best project management tools for remote teams"}'

Response

Returns the updated prompt with all fields (same shape as get prompt).

Error responses

StatusCause
400Empty request body, whitespace-only content, or no fields changed
403API key has read-only access
404Prompt not found in this project

Delete prompt

DELETE /projects/{project_id}/prompts/{prompt_id}
Permanently delete a prompt and stop tracking it. Historical analytics data for this prompt is also removed.
This action cannot be undone. Requires an admin-scoped API key.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID
prompt_idstring (UUID)The prompt to delete
curl -X DELETE "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}" \
  -H "X-API-Key: tk_live_..."

Response

{
  "code": 200,
  "message": "200 OK",
  "data": {
    "promptId": "e5f6a7b8-...",
    "message": "Prompt deleted successfully"
  }
}

Error responses

StatusCause
403API key has read-only access
404Prompt not found in this project

Prompt analytics

GET /projects/{project_id}/prompts/{prompt_id}/analytics
Returns time-series visibility, position, and sentiment data grouped by date and AI provider.

Query parameters

ParamTypeDefaultDescription
duration_daysinteger7Days to look back
date_fromstringStart date (YYYY-MM-DD)
date_tostringEnd date (YYYY-MM-DD)
providersstringComma-separated provider filter
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/analytics?duration_days=7" \
  -H "X-API-Key: tk_live_..."

Response

{
  "success": true,
  "data": {
    "prompt_id": "e5f6a7b8-...",
    "prompt_content": "What is the best project management tool?",
    "volume": 42,
    "sentiment": 72,
    "visibility_chart": {
      "2026-03-01": [
        { "provider": "chatgpt", "value": 85.0 },
        { "provider": "perplexity", "value": 90.0 }
      ],
      "2026-03-02": [
        { "provider": "chatgpt", "value": 80.0 }
      ]
    },
    "position_chart": {
      "2026-03-01": [
        { "provider": "chatgpt", "value": 2.0 }
      ]
    },
    "sentiment_chart": {
      "2026-03-01": [
        { "provider": "chatgpt", "value": 75.0 }
      ]
    }
  }
}

Response fields

FieldTypeNullableDescription
prompt_idstring (UUID)NoPrompt ID
prompt_contentstringNoThe AI search query text
volumeintegerYesTotal responses collected
sentimentintegerYesOverall brand sentiment across the period
visibility_chartobjectNoDate-keyed map of ProviderMetric[] (visibility %)
position_chartobjectNoDate-keyed map of ProviderMetric[] (avg position)
sentiment_chartobjectNoDate-keyed map of ProviderMetric[] (avg sentiment)
ProviderMetric:
FieldTypeDescription
providerstringAI provider name (e.g., chatgpt)
valuefloatMetric value for that provider on that date

AI responses (chats)

GET /projects/{project_id}/prompts/{prompt_id}/chats
Returns raw AI responses with brand mentions, sentiment, position, and citation references.

Query parameters

Same as analytics.
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/chats?duration_days=7" \
  -H "X-API-Key: tk_live_..."

Response

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "c1d2e3f4-...",
        "date": "2026-03-01T12:00:00+00:00",
        "mentioned": true,
        "position": 2,
        "all_mentions": [
          {
            "name": "Acme Corp",
            "icon_url": "https://logo.clearbit.com/acme.com",
            "icon_urls": ["https://logo.clearbit.com/acme.com", "https://www.google.com/s2/favicons?domain=acme.com&sz=64"]
          }
        ],
        "chat_preview": "When it comes to project management tools...",
        "platform": "chatgpt",
        "model": "gpt-4o",
        "full_content": "When it comes to project management tools, Acme Corp stands out for...",
        "prompt_content": "What is the best project management tool?",
        "references": [
          {
            "title": "Best PM Tools 2026",
            "link": "https://techcrunch.com/best-pm-tools",
            "snippet": "Acme Corp ranked #1...",
            "reference_index": 1
          }
        ],
        "brands_mentioned": {
          "Acme Corp": { "position": 1, "count": 3 },
          "Competitor A": { "position": 2, "count": 1 }
        },
        "sentiment": 80,
        "sentiment_by_brands": {
          "Acme Corp": 80,
          "Competitor A": 60
        }
      }
    ]
  }
}

ChatItem fields

FieldTypeNullableDescription
idstring (UUID)NoLLM output ID
datestring (ISO 8601)NoWhen the response was generated
mentionedbooleanNoWhether your brand was mentioned
positionintegerYesYour brand’s rank position in this response
all_mentionsBrandMention[]NoAll brands mentioned in the response
chat_previewstringNoFirst sentence of the response (max 150 chars)
platformstringNoAI provider (chatgpt, perplexity, google_ai_overview, gemini, claude)
modelstringNoSpecific model used (e.g., gpt-4o)
full_contentstringNoComplete AI response text
prompt_contentstringNoThe prompt that generated this response
referencesReferenceItem[]NoCitations/sources in the response
brands_mentionedobjectYesRaw brand extraction data (brand name to position/count mapping)
sentimentintegerYesYour brand’s sentiment score in this response
sentiment_by_brandsobjectYesSentiment scores keyed by brand name
BrandMention:
FieldTypeDescription
namestringBrand name as it appeared in the response
icon_urlstringPrimary logo URL
icon_urlsstring[]Multiple logo URL sources
ReferenceItem:
FieldTypeDescription
titlestringCitation title
linkstringCitation URL
snippetstringCitation snippet text
reference_indexintegerPosition of the citation in the response

Domains

GET /projects/{project_id}/prompts/{prompt_id}/domains
Returns domain-level citation breakdown, sorted by citation count descending.

Query parameters

Same as analytics.
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/domains?duration_days=7" \
  -H "X-API-Key: tk_live_..."

Response

{
  "success": true,
  "data": {
    "items": [
      {
        "domain": "techcrunch.com",
        "domain_type": 1,
        "citation_count": 15,
        "avg_citations": 2.5,
        "used_percentage": 75.0,
        "mentioned": true,
        "brands_appeared": [
          {
            "name": "Acme Corp",
            "icon_url": "https://logo.clearbit.com/acme.com",
            "icon_urls": ["https://logo.clearbit.com/acme.com"]
          }
        ],
        "favicon_url": "https://www.google.com/s2/favicons?domain=techcrunch.com&sz=64",
        "favicon_urls": [
          "https://logo.clearbit.com/techcrunch.com",
          "https://www.google.com/s2/favicons?domain=techcrunch.com&sz=64"
        ]
      }
    ]
  }
}

DomainItem fields

FieldTypeNullableDescription
domainstringNoDomain name
domain_typeintegerNoSource category ID
citation_countintegerNoTotal citation count across all responses
avg_citationsfloatNoAverage citations per response that cited this domain
used_percentagefloatNoHow frequently this domain appears (percentage)
mentionedbooleanNoWhether your brand appeared alongside this domain
brands_appearedBrandInfo[]NoBrands that appeared in responses citing this domain
favicon_urlstringYesPrimary favicon URL
favicon_urlsstring[]NoMultiple favicon URL sources
BrandInfo:
FieldTypeDescription
namestringBrand name
icon_urlstringPrimary logo URL
icon_urlsstring[]Multiple logo URL sources

URLs

GET /projects/{project_id}/prompts/{prompt_id}/urls
Returns URL-level citation data, sorted by mention count descending.

Query parameters

Same as analytics.
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/urls?duration_days=7" \
  -H "X-API-Key: tk_live_..."

Response

{
  "success": true,
  "data": {
    "items": [
      {
        "url": "https://techcrunch.com/best-pm-tools-2026",
        "title": "Best PM Tools 2026",
        "domain": "techcrunch.com",
        "url_type": null,
        "url_type_name": "unknown",
        "mentioned_count": 8,
        "brands_appear": [
          {
            "name": "Acme Corp",
            "icon_url": "https://logo.clearbit.com/acme.com",
            "icon_urls": ["https://logo.clearbit.com/acme.com"]
          }
        ],
        "first_seen": "2026-02-15T00:00:00+00:00",
        "last_seen": "2026-03-01T00:00:00+00:00"
      }
    ]
  }
}

UrlItem fields

FieldTypeNullableDescription
urlstringNoFull URL
titlestringNoPage title
domainstringNoDomain extracted from URL
url_typeintegerYesURL type ID
url_type_namestringNoURL type label (e.g., unknown)
mentioned_countintegerNoNumber of times this URL was cited
brands_appearBrandInfo[]NoBrands appearing in responses that cited this URL
first_seenstring (ISO 8601)NoEarliest citation date
last_seenstring (ISO 8601)NoMost recent citation date