Skip to main content
POST
/
{brand_id}
/
prompts
Create Prompt
curl --request POST \
  --url https://api.scrunchai.com/v1/{brand_id}/prompts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>",
  "persona_id": 123,
  "tags": [],
  "key_topics": [],
  "platforms": []
}
'
import requests

url = "https://api.scrunchai.com/v1/{brand_id}/prompts"

payload = {
"text": "<string>",
"persona_id": 123,
"tags": [],
"key_topics": [],
"platforms": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '<string>', persona_id: 123, tags: [], key_topics: [], platforms: []})
};

fetch('https://api.scrunchai.com/v1/{brand_id}/prompts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrunchai.com/v1/{brand_id}/prompts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'persona_id' => 123,
'tags' => [

],
'key_topics' => [

],
'platforms' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.scrunchai.com/v1/{brand_id}/prompts"

payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"persona_id\": 123,\n \"tags\": [],\n \"key_topics\": [],\n \"platforms\": []\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.scrunchai.com/v1/{brand_id}/prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"persona_id\": 123,\n \"tags\": [],\n \"key_topics\": [],\n \"platforms\": []\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.scrunchai.com/v1/{brand_id}/prompts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"persona_id\": 123,\n \"tags\": [],\n \"key_topics\": [],\n \"platforms\": []\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "text": "<string>",
  "persona_id": 123,
  "platforms": [],
  "tags": [
    "<string>"
  ],
  "topics": [
    "<string>"
  ],
  "created_at": "2023-11-07T05:31:56Z"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

brand_id
integer
required

The unique identifier for the brand

Body

application/json

Input model for creating a new prompt to track AI visibility.

text
string
required

The prompt text to track across AI platforms

stage
enum<string>
required

The customer journey stage this prompt represents:

  • Advice - Seeking recommendations or guidance
  • Awareness - Exploring a topic or problem space
  • Evaluation - Assessing specific options
  • Comparison - Comparing multiple options
  • Other - Doesn't fit other categories
Available options:
Advice,
Awareness,
Evaluation,
Comparison,
Other
persona_id
integer | null

Optional persona ID to associate with this prompt for segmented analysis

tags
string[]

Custom tags for categorizing and filtering prompts

key_topics
string[]

Key topics to associate with this prompt from the brand's topic list

platforms
enum<string>[]

AI platforms to track this prompt on. If empty, defaults to all supported platforms.

Supported platforms:

  • chatgpt - OpenAI ChatGPT
  • claude - Anthropic Claude
  • google_ai_overviews - Google AI Overviews (Search)
  • perplexity - Perplexity AI
  • meta - Meta AI
  • google_ai_mode - Google AI Mode
  • google_gemini - Google Gemini
  • copilot - Microsoft Copilot
Available options:
chatgpt,
claude,
google_ai_overviews,
perplexity,
meta,
google_ai_mode,
google_gemini,
copilot,
grok

Response

Successful Response

Represents a prompt being tracked for AI visibility, including its configuration and metadata.

id
integer
required

Unique identifier for the prompt

text
string
required

The prompt text being tracked

stage
enum<string>
required

The customer journey stage this prompt represents

Available options:
Advice,
Awareness,
Evaluation,
Comparison,
Other
persona_id
integer | null
required

ID of the associated persona, if any

platforms
enum<string>[]
required

AI platforms this prompt is tracked on

Available options:
chatgpt,
claude,
google_ai_overviews,
perplexity,
meta,
google_ai_mode,
google_gemini,
copilot,
grok
tags
string[]
required

Custom tags assigned to this prompt

topics
string[]
required

Auto-detected or assigned topics for this prompt

created_at
string<date-time>
required

Timestamp when the prompt was created