Create Query Run
curl --request POST \
--url https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"promptId": 123,
"topicId": 123,
"platform": "<string>",
"brandId": 123
}
'import requests
url = "https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs"
payload = {
"promptId": 123,
"topicId": 123,
"platform": "<string>",
"brandId": 123
}
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({promptId: 123, topicId: 123, platform: '<string>', brandId: 123})
};
fetch('https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs', 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/query-runs",
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([
'promptId' => 123,
'topicId' => 123,
'platform' => '<string>',
'brandId' => 123
]),
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/query-runs"
payload := strings.NewReader("{\n \"promptId\": 123,\n \"topicId\": 123,\n \"platform\": \"<string>\",\n \"brandId\": 123\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/query-runs")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"promptId\": 123,\n \"topicId\": 123,\n \"platform\": \"<string>\",\n \"brandId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs")
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 \"promptId\": 123,\n \"topicId\": 123,\n \"platform\": \"<string>\",\n \"brandId\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"promptId": 123,
"topicId": 123,
"platform": "<string>",
"status": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"errorMessage": "<string>"
}Query Runs
Create Query Run
Manually trigger a query run for a prompt on a specific AI platform.
POST
/
ai-analytics-service
/
api
/
public
/
v1
/
query-runs
Create Query Run
curl --request POST \
--url https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"promptId": 123,
"topicId": 123,
"platform": "<string>",
"brandId": 123
}
'import requests
url = "https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs"
payload = {
"promptId": 123,
"topicId": 123,
"platform": "<string>",
"brandId": 123
}
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({promptId: 123, topicId: 123, platform: '<string>', brandId: 123})
};
fetch('https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs', 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/query-runs",
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([
'promptId' => 123,
'topicId' => 123,
'platform' => '<string>',
'brandId' => 123
]),
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/query-runs"
payload := strings.NewReader("{\n \"promptId\": 123,\n \"topicId\": 123,\n \"platform\": \"<string>\",\n \"brandId\": 123\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/query-runs")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"promptId\": 123,\n \"topicId\": 123,\n \"platform\": \"<string>\",\n \"brandId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs")
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 \"promptId\": 123,\n \"topicId\": 123,\n \"platform\": \"<string>\",\n \"brandId\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"promptId": 123,
"topicId": 123,
"platform": "<string>",
"status": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"errorMessage": "<string>"
}Creates a new query run. Use this to manually trigger a prompt query outside its scheduled cron cycle.
Parameters
string
required
Bearer token. Format:
Bearer slat_<your-token>.number
required
ID of the prompt to run.
number
required
Topic ID associated with the prompt.
string
required
AI platform to query. One of:
CHATGPT, PERPLEXITY, GOOGLE_AI_OVERVIEW, GOOGLE_AI_MODE, GEMINI, CLAUDE.number
Brand ID for the query run.
Response
Returns200 OK with the created query run.
number
required
Unique identifier for the query run.
number
required
Associated prompt ID.
number
required
Associated topic ID.
string
required
AI platform used for the query.
string
required
Run status. Starts as
PENDING.string
required
Timestamp when the run was created. ISO 8601 format.
string
Completion timestamp.
null while the run is in progress.string
Error details if the run failed.
null on success.Example
curl -s -X POST "https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs" \
-H "Authorization: Bearer slat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"promptId": 156,
"topicId": 42,
"platform": "CHATGPT"
}'
import requests
response = requests.post(
"https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs",
headers={
"Authorization": "Bearer slat_YOUR_TOKEN",
"Content-Type": "application/json",
},
json={
"promptId": 156,
"topicId": 42,
"platform": "CHATGPT",
},
)
run = response.json()
print(run["id"], run["status"])
const response = await fetch(
"https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs",
{
method: "POST",
headers: {
"Authorization": "Bearer slat_YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
promptId: 156,
topicId: 42,
platform: "CHATGPT",
}),
}
);
const run = await response.json();
console.log(run.id, run.status);
Response
{
"id": 2048,
"promptId": 156,
"topicId": 42,
"platform": "CHATGPT",
"status": "PENDING",
"startedAt": "2026-02-11T14:30:00Z",
"completedAt": null,
"errorMessage": null
}
Status codes
| Status | Description |
|---|---|
200 | Query run created. |
400 | Invalid request. Missing required fields or invalid platform. |
401 | Missing or invalid Bearer token. See Authentication. |
500 | Internal server error. |
What’s next
- Get Query Run — Check the status of a query run.
- Get Run Details — View the full AI response and metrics.
Was this page helpful?