Create prompt set
curl --request POST \
--url http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "AI search visibility monitoring",
"description": "A collection of prompts that track how our service appears in AI answers"
}
'import requests
url = "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets"
payload = {
"name": "AI search visibility monitoring",
"description": "A collection of prompts that track how our service appears in AI answers"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'AI search visibility monitoring',
description: 'A collection of prompts that track how our service appears in AI answers'
})
};
fetch('http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets', 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 => "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets",
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([
'name' => 'AI search visibility monitoring',
'description' => 'A collection of prompts that track how our service appears in AI answers'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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 := "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets"
payload := strings.NewReader("{\n \"name\": \"AI search visibility monitoring\",\n \"description\": \"A collection of prompts that track how our service appears in AI answers\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"AI search visibility monitoring\",\n \"description\": \"A collection of prompts that track how our service appears in AI answers\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"AI search visibility monitoring\",\n \"description\": \"A collection of prompts that track how our service appears in AI answers\"\n}"
response = http.request(request)
puts response.read_body{
"id": "T66Yb0Ylf-xJX-Mbx-yhcg"
}{
"code": "COMMON_VALIDATION",
"details": [
"limit: must be 100 or less"
],
"message": "Data validation failed"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}Prompts
Create a prompt set
Creates a prompt set in the organization. A prompt set is a unit for grouping and managing prompts; when requesting a prompt run, you can run the whole set at once by passing promptSetID.
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | COMMON_BINDING | Failed to parse request body JSON |
| 400 | COMMON_VALIDATION | • Name missing or over 100 characters • Description over 1000 characters |
| 401 | COMMON_UNAUTHORIZED | API key or access token is missing or invalid |
| 402 | INSUFFICIENT_CREDITS | The organization’s credit balance is lower than the unit price of this request |
| 429 | PLATFORM_RATE_LIMIT_EXCEEDED | Rate limit exceeded. Wait for the number of seconds in the Retry-After header, then retry |
| 500 | — | Internal server error. Returns message and requestID without a code |
POST
/
v1
/
platform
/
prompt-sets
Create prompt set
curl --request POST \
--url http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "AI search visibility monitoring",
"description": "A collection of prompts that track how our service appears in AI answers"
}
'import requests
url = "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets"
payload = {
"name": "AI search visibility monitoring",
"description": "A collection of prompts that track how our service appears in AI answers"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'AI search visibility monitoring',
description: 'A collection of prompts that track how our service appears in AI answers'
})
};
fetch('http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets', 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 => "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets",
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([
'name' => 'AI search visibility monitoring',
'description' => 'A collection of prompts that track how our service appears in AI answers'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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 := "http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets"
payload := strings.NewReader("{\n \"name\": \"AI search visibility monitoring\",\n \"description\": \"A collection of prompts that track how our service appears in AI answers\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"AI search visibility monitoring\",\n \"description\": \"A collection of prompts that track how our service appears in AI answers\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://dev-platform-api.trychainshift.ai/api/v1/platform/prompt-sets")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"AI search visibility monitoring\",\n \"description\": \"A collection of prompts that track how our service appears in AI answers\"\n}"
response = http.request(request)
puts response.read_body{
"id": "T66Yb0Ylf-xJX-Mbx-yhcg"
}{
"code": "COMMON_VALIDATION",
"details": [
"limit: must be 100 or less"
],
"message": "Data validation failed"
}{
"code": "COMMON_UNAUTHORIZED",
"message": "Unauthenticated user"
}{
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits."
}{
"code": "PLATFORM_RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later."
}{
"message": "Internal Server Error",
"requestID": "bkZqnHQepkgTOocTvyHWSlHcGzRqQbZk"
}Body
application/json
Create prompt set request