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 '
{
"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 = {
"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({
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([
'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 \"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 \"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 \"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 '
{
"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 = {
"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({
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([
'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 \"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 \"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 \"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 immediately trigger a live query run after creating the prompt. Default: false.number
required
ID of the topic this prompt belongs to. Must reference an existing topic in your workspace.
string
required
The prompt text to track. Maximum 4000 characters.
string[]
required
AI platforms to query. One or more of:
CHATGPT, PERPLEXITY, GOOGLE_AI_OVERVIEW, GOOGLE_AI_MODE, GEMINI, CLAUDE.string
required
Cron expression defining the query schedule (e.g.,
0 0 * * * for daily).string
required
Timezone for the cron schedule (e.g.,
UTC, America/New_York).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). Maximum 2 characters.Response
Returns201 Created with the new prompt.
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
required
Cron schedule expression.
string
required
Schedule timezone.
boolean
required
Whether the prompt is active.
string
Country code for location filtering.
null if not set.string
Next scheduled run time. ISO 8601 format.
string
Last run time. ISO 8601 format.
null if the prompt has not run yet.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 '{
"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={
"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({
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": "2026-02-12T00:00:00Z",
"lastRun": null
}
Status codes
| Status | Description |
|---|---|
201 | Prompt created. |
400 | Invalid request. Missing required fields, topic not found, or invalid location code. |
401 | Missing or invalid Bearer token. See Authentication. |
500 | Internal server error. |
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?