Skip to main content

List Prompts

Path Parameters

brandId
string
required
Brand ID

Query Parameters

page
string
Page number (default: 1)
limit
string
Results per page (default: 20, max: 100)
tags
string
Comma-separated list of tags to filter by

Response

prompts
Prompt[]
Array of prompt objects
total
number
Total number of prompts
page
number
Current page
limit
number
Results per page
totalPages
number
Total number of pages

Example Request

curl -X GET "https://api.opensight.ai/api/brands/brand_123/prompts?page=1&limit=20&tags=pricing,features" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "prompts": [
    {
      "id": "prompt_123",
      "brand_id": "brand_123",
      "text": "Best project management tools for remote teams",
      "tags": ["pricing", "features"],
      "is_active": true,
      "created_at": "2024-01-15T10:00:00Z",
      "updated_at": "2024-01-15T10:00:00Z",
      "latest_results": [
        {
          "engine": "chatgpt",
          "score": 85,
          "sentiment": "positive",
          "mentioned": true
        },
        {
          "engine": "perplexity",
          "score": 72,
          "sentiment": "neutral",
          "mentioned": true
        }
      ]
    }
  ],
  "total": 45,
  "page": 1,
  "limit": 20,
  "totalPages": 3
}

Errors

  • 404 Not Found - Brand not found or user doesn’t own it

Create Prompt(s)

Path Parameters

brandId
string
required
Brand ID

Request Body (Single Prompt)

text
string
required
Prompt text (1-1000 characters)
tags
string[]
Array of tags (max 10 tags, each max 50 characters)

Request Body (Bulk Prompts)

prompts
object[]
required
Array of prompt objects (min 1, max 50)

Response (Single)

prompt
Prompt
The created prompt object

Response (Bulk)

created
Prompt[]
Array of created prompts
skipped
object[]
Array of skipped prompts (duplicates)

Example Request (Single)

curl -X POST "https://api.opensight.ai/api/brands/brand_123/prompts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Best project management tools for remote teams",
    "tags": ["pricing", "features"]
  }'

Example Request (Bulk)

curl -X POST "https://api.opensight.ai/api/brands/brand_123/prompts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompts": [
      {
        "text": "Best CRM for small businesses",
        "tags": ["crm", "small-business"]
      },
      {
        "text": "Top marketing automation tools",
        "tags": ["marketing", "automation"]
      }
    ]
  }'

Example Response (Bulk)

{
  "created": [
    {
      "id": "prompt_123",
      "brand_id": "brand_123",
      "text": "Best CRM for small businesses",
      "tags": ["crm", "small-business"],
      "is_active": true,
      "created_at": "2024-01-15T10:00:00Z",
      "updated_at": "2024-01-15T10:00:00Z"
    }
  ],
  "skipped": [
    {
      "text": "Top marketing automation tools",
      "reason": "Prompt already exists"
    }
  ]
}

Errors

  • 403 Forbidden - Prompt limit reached for your plan
  • 404 Not Found - Brand not found or user doesn’t own it
  • 409 Conflict - Prompt with this text already exists
  • 400 Bad Request - Invalid input data

Plan Limits

  • Free: 25 prompts per brand
  • Starter: 100 prompts per brand
  • Growth: 250 prompts per brand

Suggest Prompts

Path Parameters

brandId
string
required
Brand ID

Request Body

count
number
Number of suggestions to generate (default: 20, min: 1, max: 50)
industry
string
Industry to generate suggestions for (SaaS, E-commerce, Finance, Healthcare, Agency, Other)

Response

suggestions
string[]
Array of suggested prompt texts

Example Request

curl -X POST "https://api.opensight.ai/api/brands/brand_123/prompts/suggest" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "count": 10,
    "industry": "SaaS"
  }'

Example Response

{
  "suggestions": [
    "Best project management software for remote teams",
    "Top CRM tools for startups",
    "Most affordable marketing automation platforms",
    "Best team collaboration tools 2024",
    "Compare project management software features"
  ]
}

Get Prompt

Path Parameters

brandId
string
required
Brand ID
promptId
string
required
Prompt ID

Response

prompt
Prompt
The prompt object (see List Prompts for structure)

Example Request

curl -X GET "https://api.opensight.ai/api/brands/brand_123/prompts/prompt_123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Errors

  • 404 Not Found - Brand or prompt not found, or user doesn’t own the brand

Update Prompt

Path Parameters

brandId
string
required
Brand ID
promptId
string
required
Prompt ID

Request Body

text
string
Prompt text (1-1000 characters)
tags
string[]
Array of tags (max 10 tags, each max 50 characters)
is_active
boolean
Whether prompt is active

Response

prompt
Prompt
The updated prompt object

Example Request

curl -X PATCH "https://api.opensight.ai/api/brands/brand_123/prompts/prompt_123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Best project management tools for distributed teams",
    "tags": ["pricing", "features", "remote"],
    "is_active": true
  }'

Errors

  • 404 Not Found - Brand or prompt not found, or user doesn’t own the brand
  • 409 Conflict - Prompt with this text already exists

Delete Prompt

Path Parameters

brandId
string
required
Brand ID
promptId
string
required
Prompt ID

Response

success
boolean
Returns true if successful

Example Request

curl -X DELETE "https://api.opensight.ai/api/brands/brand_123/prompts/prompt_123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Errors

  • 404 Not Found - Brand or prompt not found, or user doesn’t own the brand

Get Prompt Results

Path Parameters

brandId
string
required
Brand ID
promptId
string
required
Prompt ID

Response

results
PromptResult[]
Array of prompt result objects

Example Request

curl -X GET "https://api.opensight.ai/api/brands/brand_123/prompts/prompt_123/results" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "results": [
    {
      "id": "result_123",
      "prompt_id": "prompt_123",
      "brand_id": "brand_123",
      "engine": "chatgpt",
      "run_date": "2024-01-15",
      "response_text": "For project management tools, Acme Inc offers excellent features...",
      "brand_mentioned": true,
      "mention_position": 1,
      "sentiment_score": 0.8,
      "sentiment_label": "positive",
      "citation_urls": ["https://acme.com/features"],
      "competitor_mentions": [
        {
          "name": "Competitor Inc",
          "position": 3,
          "sentiment": "neutral"
        }
      ],
      "visibility_score": 85,
      "created_at": "2024-01-15T08:00:00Z"
    }
  ]
}

Errors

  • 404 Not Found - Brand or prompt not found, or user doesn’t own the brand

Build docs developers (and LLMs) love