Create Prompt
curl --request POST \
--url https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"brandId": 123,
"topicId": 123,
"promptText": "<string>",
"platform": [
"<string>"
],
"cronExpr": "<string>",
"timezone": "<string>",
"active": true,
"location": "<string>"
}
'import requests
url = "https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts"
payload = {
"brandId": 123,
"topicId": 123,
"promptText": "<string>",
"platform": ["<string>"],
"cronExpr": "<string>",
"timezone": "<string>",
"active": True,
"location": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brandId: 123,
topicId: 123,
promptText: '<string>',
platform: ['<string>'],
cronExpr: '<string>',
timezone: '<string>',
active: true,
location: '<string>'
})
};
fetch('https://api.slatehq.ai/ai-analytics-service/api/public/v1/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.slatehq.ai/ai-analytics-service/api/public/v1/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([
'brandId' => 123,
'topicId' => 123,
'promptText' => '<string>',
'platform' => [
'<string>'
],
'cronExpr' => '<string>',
'timezone' => '<string>',
'active' => true,
'location' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.slatehq.ai/ai-analytics-service/api/public/v1/prompts"
payload := strings.NewReader("{\n \"brandId\": 123,\n \"topicId\": 123,\n \"promptText\": \"<string>\",\n \"platform\": [\n \"<string>\"\n ],\n \"cronExpr\": \"<string>\",\n \"timezone\": \"<string>\",\n \"active\": true,\n \"location\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.slatehq.ai/ai-analytics-service/api/public/v1/prompts")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"brandId\": 123,\n \"topicId\": 123,\n \"promptText\": \"<string>\",\n \"platform\": [\n \"<string>\"\n ],\n \"cronExpr\": \"<string>\",\n \"timezone\": \"<string>\",\n \"active\": true,\n \"location\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brandId\": 123,\n \"topicId\": 123,\n \"promptText\": \"<string>\",\n \"platform\": [\n \"<string>\"\n ],\n \"cronExpr\": \"<string>\",\n \"timezone\": \"<string>\",\n \"active\": true,\n \"location\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"topicId": 123,
"promptText": "<string>",
"platform": [
"<string>"
],
"cronExpr": "<string>",
"timezone": "<string>",
"active": true,
"location": "<string>",
"nextRun": "<string>",
"lastRun": "<string>"
}Prompts
Create Prompt
Create a new prompt for tracking AI search visibility.
POST
/
ai-analytics-service
/
api
/
public
/
v1
/
prompts
Create Prompt
curl --request POST \
--url https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"brandId": 123,
"topicId": 123,
"promptText": "<string>",
"platform": [
"<string>"
],
"cronExpr": "<string>",
"timezone": "<string>",
"active": true,
"location": "<string>"
}
'import requests
url = "https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts"
payload = {
"brandId": 123,
"topicId": 123,
"promptText": "<string>",
"platform": ["<string>"],
"cronExpr": "<string>",
"timezone": "<string>",
"active": True,
"location": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brandId: 123,
topicId: 123,
promptText: '<string>',
platform: ['<string>'],
cronExpr: '<string>',
timezone: '<string>',
active: true,
location: '<string>'
})
};
fetch('https://api.slatehq.ai/ai-analytics-service/api/public/v1/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.slatehq.ai/ai-analytics-service/api/public/v1/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([
'brandId' => 123,
'topicId' => 123,
'promptText' => '<string>',
'platform' => [
'<string>'
],
'cronExpr' => '<string>',
'timezone' => '<string>',
'active' => true,
'location' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.slatehq.ai/ai-analytics-service/api/public/v1/prompts"
payload := strings.NewReader("{\n \"brandId\": 123,\n \"topicId\": 123,\n \"promptText\": \"<string>\",\n \"platform\": [\n \"<string>\"\n ],\n \"cronExpr\": \"<string>\",\n \"timezone\": \"<string>\",\n \"active\": true,\n \"location\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.slatehq.ai/ai-analytics-service/api/public/v1/prompts")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"brandId\": 123,\n \"topicId\": 123,\n \"promptText\": \"<string>\",\n \"platform\": [\n \"<string>\"\n ],\n \"cronExpr\": \"<string>\",\n \"timezone\": \"<string>\",\n \"active\": true,\n \"location\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brandId\": 123,\n \"topicId\": 123,\n \"promptText\": \"<string>\",\n \"platform\": [\n \"<string>\"\n ],\n \"cronExpr\": \"<string>\",\n \"timezone\": \"<string>\",\n \"active\": true,\n \"location\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"topicId": 123,
"promptText": "<string>",
"platform": [
"<string>"
],
"cronExpr": "<string>",
"timezone": "<string>",
"active": true,
"location": "<string>",
"nextRun": "<string>",
"lastRun": "<string>"
}Creates a new prompt under a specific topic. Optionally triggers an immediate query run across the selected AI platforms.
Parameters
string
required
Bearer token. Format:
Bearer slat_<your-token>.boolean
Set to
true to start a live query run on each of the prompt’s platforms right after creating it. Default: false.number
required
Brand ID for the prompt.
topicId must belong to this brand.number
required
ID of the topic this prompt belongs to. Must reference an active topic in your workspace that belongs to
brandId.string
required
The prompt text to track. Maximum 4000 characters. Another prompt in the workspace can’t have the same text.
string[]
required
AI platforms to query. One or more of:
CHATGPT, PERPLEXITY, GOOGLE_AI_OVERVIEW, GOOGLE_AI_MODE, GEMINI, CLAUDE.string
Cron expression defining the query schedule (e.g.,
0 0 * * * for daily). Omit to create a prompt without a schedule.string
Timezone for the cron schedule (e.g.,
UTC, America/New_York). Default: UTC.boolean
Whether the prompt is active. Default:
true.string
ISO 3166-1 alpha-2 country code for location-specific results (e.g.,
US, GB, IN). Must be exactly two letters.Response
Returns200 OK with the new prompt.
When run=true, the response is an object with three fields instead: prompt (the new prompt, with the fields below), runIds (IDs of the started query runs), and status (running).
number
required
Unique identifier for the prompt.
number
required
Topic ID the prompt belongs to.
string
required
The prompt text.
string[]
required
Target AI platforms.
string
Cron schedule expression.
null if the prompt has no schedule.string
required
Schedule timezone.
boolean
required
Whether the prompt is active.
string
Country code for location filtering.
null if not set.string
Next run time stored on the prompt. ISO 8601 format.
null in the create response.string
Last run time stored on the prompt. ISO 8601 format.
null if not set.Example
curl -s -X POST "https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts" \
-H "Authorization: Bearer slat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"brandId": 5,
"topicId": 42,
"promptText": "What is the best project management tool for remote teams?",
"platform": ["CHATGPT", "PERPLEXITY"],
"cronExpr": "0 0 * * *",
"timezone": "UTC",
"location": "US"
}'
import requests
response = requests.post(
"https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts",
headers={
"Authorization": "Bearer slat_YOUR_TOKEN",
"Content-Type": "application/json",
},
json={
"brandId": 5,
"topicId": 42,
"promptText": "What is the best project management tool for remote teams?",
"platform": ["CHATGPT", "PERPLEXITY"],
"cronExpr": "0 0 * * *",
"timezone": "UTC",
"location": "US",
},
)
prompt = response.json()
print(prompt["id"])
const response = await fetch(
"https://api.slatehq.ai/ai-analytics-service/api/public/v1/prompts",
{
method: "POST",
headers: {
"Authorization": "Bearer slat_YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
brandId: 5,
topicId: 42,
promptText: "What is the best project management tool for remote teams?",
platform: ["CHATGPT", "PERPLEXITY"],
cronExpr: "0 0 * * *",
timezone: "UTC",
location: "US",
}),
}
);
const prompt = await response.json();
console.log(prompt.id);
Response
{
"id": 156,
"topicId": 42,
"promptText": "What is the best project management tool for remote teams?",
"platform": ["CHATGPT", "PERPLEXITY"],
"cronExpr": "0 0 * * *",
"timezone": "UTC",
"active": true,
"location": "US",
"nextRun": null,
"lastRun": null
}
Status codes
| Status | Description |
|---|---|
200 | Prompt created. With run=true, the prompt was created and its runs were started. |
400 | Invalid request. A required field (brandId, topicId, promptText, platform) is missing, a platform is unsupported, promptText exceeds 4000 characters, the location code is invalid, or the body isn’t valid JSON or contains unknown fields. |
401 | Missing or invalid Bearer token. See Authentication. |
403 | A workspaceId in the body or query doesn’t match the token’s workspace. |
404 | The topic doesn’t exist, is inactive, or doesn’t belong to brandId (topic not found). |
409 | A prompt with the same text already exists in the workspace. The body has code (PROMPT_ALREADY_EXISTS), message, and, when found, existingPromptId and existingTopicId. |
500 | Internal server error. |
502 | With run=true, the prompt was created but its runs couldn’t be queued. |
What’s next
- List Prompts — View all prompts in your workspace.
- Create Query Run — Manually trigger a query run.
- Create Topic — Create a topic to organize prompts.
Was this page helpful?