Create Prompt
curl --request POST \
--url https://api.eigi.ai/v1/public/prompts \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompt_name": "customer_support_v1",
"prompt_content": "You are a helpful customer support agent. Be polite and professional.",
"prompt_metadata": {
"prompt_type": "main"
}
}
'import requests
url = "https://api.eigi.ai/v1/public/prompts"
payload = {
"prompt_name": "customer_support_v1",
"prompt_content": "You are a helpful customer support agent. Be polite and professional.",
"prompt_metadata": { "prompt_type": "main" }
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt_name: 'customer_support_v1',
prompt_content: 'You are a helpful customer support agent. Be polite and professional.',
prompt_metadata: {prompt_type: 'main'}
})
};
fetch('https://api.eigi.ai/v1/public/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.eigi.ai/v1/public/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([
'prompt_name' => 'customer_support_v1',
'prompt_content' => 'You are a helpful customer support agent. Be polite and professional.',
'prompt_metadata' => [
'prompt_type' => 'main'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.eigi.ai/v1/public/prompts"
payload := strings.NewReader("{\n \"prompt_name\": \"customer_support_v1\",\n \"prompt_content\": \"You are a helpful customer support agent. Be polite and professional.\",\n \"prompt_metadata\": {\n \"prompt_type\": \"main\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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("https://api.eigi.ai/v1/public/prompts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt_name\": \"customer_support_v1\",\n \"prompt_content\": \"You are a helpful customer support agent. Be polite and professional.\",\n \"prompt_metadata\": {\n \"prompt_type\": \"main\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eigi.ai/v1/public/prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt_name\": \"customer_support_v1\",\n \"prompt_content\": \"You are a helpful customer support agent. Be polite and professional.\",\n \"prompt_metadata\": {\n \"prompt_type\": \"main\"\n }\n}"
response = http.request(request)
puts response.read_body{
"prompt_name": "<string>",
"prompt_version": 123,
"prompt_content": "<string>",
"prompt_metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Prompts
Create Prompt
Create a new prompt or a new version of an existing prompt
POST
/
v1
/
public
/
prompts
Create Prompt
curl --request POST \
--url https://api.eigi.ai/v1/public/prompts \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompt_name": "customer_support_v1",
"prompt_content": "You are a helpful customer support agent. Be polite and professional.",
"prompt_metadata": {
"prompt_type": "main"
}
}
'import requests
url = "https://api.eigi.ai/v1/public/prompts"
payload = {
"prompt_name": "customer_support_v1",
"prompt_content": "You are a helpful customer support agent. Be polite and professional.",
"prompt_metadata": { "prompt_type": "main" }
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt_name: 'customer_support_v1',
prompt_content: 'You are a helpful customer support agent. Be polite and professional.',
prompt_metadata: {prompt_type: 'main'}
})
};
fetch('https://api.eigi.ai/v1/public/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.eigi.ai/v1/public/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([
'prompt_name' => 'customer_support_v1',
'prompt_content' => 'You are a helpful customer support agent. Be polite and professional.',
'prompt_metadata' => [
'prompt_type' => 'main'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.eigi.ai/v1/public/prompts"
payload := strings.NewReader("{\n \"prompt_name\": \"customer_support_v1\",\n \"prompt_content\": \"You are a helpful customer support agent. Be polite and professional.\",\n \"prompt_metadata\": {\n \"prompt_type\": \"main\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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("https://api.eigi.ai/v1/public/prompts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt_name\": \"customer_support_v1\",\n \"prompt_content\": \"You are a helpful customer support agent. Be polite and professional.\",\n \"prompt_metadata\": {\n \"prompt_type\": \"main\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eigi.ai/v1/public/prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt_name\": \"customer_support_v1\",\n \"prompt_content\": \"You are a helpful customer support agent. Be polite and professional.\",\n \"prompt_metadata\": {\n \"prompt_type\": \"main\"\n }\n}"
response = http.request(request)
puts response.read_body{
"prompt_name": "<string>",
"prompt_version": 123,
"prompt_content": "<string>",
"prompt_metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Overview
Create a new prompt for use with your AI agents. If a prompt with the same name already exists, a new version is automatically created with an incremented version number. Prompts support two types:- main — Used as the agent’s system prompt / instructions
- analysis — Used for post-conversation analysis
Authentication
string
required
Your eigi.ai API key. Must be prefixed with
vk_.Request Body
string
required
Unique prompt name (1-100 characters). If a prompt with this name exists, a new version is created.
string
required
The prompt text content — the instructions or system message for your agent.
object
Optional metadata for the prompt.
Show properties
Show properties
string
default:"main"
Type of prompt:
main for agent prompts, analysis for conversation analysis prompts.Response
string
The unique prompt name.
integer
Version number (starts at 1, auto-increments for existing prompts).
string
The prompt text content.
object
Metadata including prompt_type.
string
ISO 8601 creation timestamp.
string
ISO 8601 last update timestamp.
Authorizations
API key for authentication. Get your API key from the eigi.ai Dashboard under Settings → API Keys.
Body
application/json
Unique prompt name (1-100 characters)
Required string length:
1 - 100Example:
"customer_support_v1"
The prompt text content
Minimum string length:
1Example:
"You are a helpful customer support agent for TechCorp. Be polite, professional, and solve customer issues efficiently."
Metadata for the prompt
Show child attributes
Show child attributes
Example:
{ "prompt_type": "main" }
Response
Prompt created successfully

