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
Store a query run record for a prompt. This endpoint does not send the prompt to AI platforms.
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 query run record for a prompt. This endpoint only stores the record: it doesn’t send the prompt to the AI platform, and the new run’s
status is null. To query the AI platforms right away, create the prompt with run=true (see Create Prompt).
Parameters
string
required
Bearer token. Format:
Bearer slat_<your-token>.number
required
ID of an active prompt in your workspace.
number
Ignored. The run always uses the prompt’s topic.
string
required
AI platform for the run. One of:
CHATGPT, PERPLEXITY, GOOGLE_AI_OVERVIEW, GOOGLE_AI_MODE, GEMINI, CLAUDE. The platform isn’t checked against the prompt’s configured platforms.number
Ignored. The run always uses the prompt’s brand.
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
Run status.
null for runs created with this endpoint.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,
"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,
"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,
platform: "CHATGPT",
}),
}
);
const run = await response.json();
console.log(run.id, run.status);
Response
{
"id": 2048,
"promptId": 156,
"topicId": 42,
"platform": "CHATGPT",
"status": null,
"startedAt": "2026-02-11T14:30:00Z",
"completedAt": null,
"errorMessage": null
}
Status codes
| Status | Description |
|---|---|
200 | Query run created. |
400 | Invalid request. promptId is missing, the platform is unsupported, 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 prompt doesn’t exist in this workspace or is inactive (prompt not found). |
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?