Create System Prompt
Create a new system prompt composition.
curl --request POST \
--url https://api.cuadra.ai/v1/system-prompts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "System prompt for customer support interactions",
"name": "Customer Support Agent",
"particles": [
{
"order": 0,
"particleId": "particle-uuid-1"
},
{
"order": 1,
"particleId": "particle-uuid-2"
}
]
}
'import requests
url = "https://api.cuadra.ai/v1/system-prompts"
payload = {
"description": "System prompt for customer support interactions",
"name": "Customer Support Agent",
"particles": [
{
"order": 0,
"particleId": "particle-uuid-1"
},
{
"order": 1,
"particleId": "particle-uuid-2"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'System prompt for customer support interactions',
name: 'Customer Support Agent',
particles: [
{order: 0, particleId: 'particle-uuid-1'},
{order: 1, particleId: 'particle-uuid-2'}
]
})
};
fetch('https://api.cuadra.ai/v1/system-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.cuadra.ai/v1/system-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([
'description' => 'System prompt for customer support interactions',
'name' => 'Customer Support Agent',
'particles' => [
[
'order' => 0,
'particleId' => 'particle-uuid-1'
],
[
'order' => 1,
'particleId' => 'particle-uuid-2'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cuadra.ai/v1/system-prompts"
payload := strings.NewReader("{\n \"description\": \"System prompt for customer support interactions\",\n \"name\": \"Customer Support Agent\",\n \"particles\": [\n {\n \"order\": 0,\n \"particleId\": \"particle-uuid-1\"\n },\n {\n \"order\": 1,\n \"particleId\": \"particle-uuid-2\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cuadra.ai/v1/system-prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"System prompt for customer support interactions\",\n \"name\": \"Customer Support Agent\",\n \"particles\": [\n {\n \"order\": 0,\n \"particleId\": \"particle-uuid-1\"\n },\n {\n \"order\": 1,\n \"particleId\": \"particle-uuid-2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cuadra.ai/v1/system-prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"System prompt for customer support interactions\",\n \"name\": \"Customer Support Agent\",\n \"particles\": [\n {\n \"order\": 0,\n \"particleId\": \"particle-uuid-1\"\n },\n {\n \"order\": 1,\n \"particleId\": \"particle-uuid-2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "sp_abc123",
"name": "Customer Support Agent",
"enabled": true,
"isSystem": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "System prompt for customer support interactions",
"slug": "customer-support-agent",
"totalTokenCount": 150,
"particleCount": 3,
"particles": [
{
"id": "spa_abc123",
"particleId": "part_xyz789",
"order": 0,
"particleName": "Professional Tone",
"particleCategory": "tone",
"particleVersionId": "pv_abc123",
"pinnedVersion": 2,
"tokenCount": 25
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
JWT token from Stytch B2B authentication (magic link, SSO, or M2M)
Headers
Body
Request schema for creating a system prompt.
Human-readable name for the system prompt
1 - 255Optional description of the system prompt's purpose
1000Whether the system prompt is active
Initial particles to add (optional)
Show child attributes
Show child attributes
Response
Successful Response
Response schema for system prompt.
Unique system prompt identifier
"sp_abc123"
Human-readable name
"Customer Support Agent"
Whether the system prompt is active
true
Whether this is a system-managed template
false
Timestamp when the system prompt was created
Timestamp when the system prompt was last updated
System prompt description
"System prompt for customer support interactions"
Stable kebab-case identifier (system profiles only, immutable)
"customer-support-agent"
Total token count of all particles
150
Number of particles in this system prompt
3
Particle associations (when expanded)
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.cuadra.ai/v1/system-prompts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "System prompt for customer support interactions",
"name": "Customer Support Agent",
"particles": [
{
"order": 0,
"particleId": "particle-uuid-1"
},
{
"order": 1,
"particleId": "particle-uuid-2"
}
]
}
'import requests
url = "https://api.cuadra.ai/v1/system-prompts"
payload = {
"description": "System prompt for customer support interactions",
"name": "Customer Support Agent",
"particles": [
{
"order": 0,
"particleId": "particle-uuid-1"
},
{
"order": 1,
"particleId": "particle-uuid-2"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'System prompt for customer support interactions',
name: 'Customer Support Agent',
particles: [
{order: 0, particleId: 'particle-uuid-1'},
{order: 1, particleId: 'particle-uuid-2'}
]
})
};
fetch('https://api.cuadra.ai/v1/system-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.cuadra.ai/v1/system-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([
'description' => 'System prompt for customer support interactions',
'name' => 'Customer Support Agent',
'particles' => [
[
'order' => 0,
'particleId' => 'particle-uuid-1'
],
[
'order' => 1,
'particleId' => 'particle-uuid-2'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cuadra.ai/v1/system-prompts"
payload := strings.NewReader("{\n \"description\": \"System prompt for customer support interactions\",\n \"name\": \"Customer Support Agent\",\n \"particles\": [\n {\n \"order\": 0,\n \"particleId\": \"particle-uuid-1\"\n },\n {\n \"order\": 1,\n \"particleId\": \"particle-uuid-2\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cuadra.ai/v1/system-prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"System prompt for customer support interactions\",\n \"name\": \"Customer Support Agent\",\n \"particles\": [\n {\n \"order\": 0,\n \"particleId\": \"particle-uuid-1\"\n },\n {\n \"order\": 1,\n \"particleId\": \"particle-uuid-2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cuadra.ai/v1/system-prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"System prompt for customer support interactions\",\n \"name\": \"Customer Support Agent\",\n \"particles\": [\n {\n \"order\": 0,\n \"particleId\": \"particle-uuid-1\"\n },\n {\n \"order\": 1,\n \"particleId\": \"particle-uuid-2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "sp_abc123",
"name": "Customer Support Agent",
"enabled": true,
"isSystem": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "System prompt for customer support interactions",
"slug": "customer-support-agent",
"totalTokenCount": 150,
"particleCount": 3,
"particles": [
{
"id": "spa_abc123",
"particleId": "part_xyz789",
"order": 0,
"particleName": "Professional Tone",
"particleCategory": "tone",
"particleVersionId": "pv_abc123",
"pinnedVersion": 2,
"tokenCount": 25
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}