Update Prompt
curl --request PATCH \
--url https://api.eigi.ai/v1/public/prompts/{prompt_name} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompt_content": "You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented."
}
'import requests
url = "https://api.eigi.ai/v1/public/prompts/{prompt_name}"
payload = { "prompt_content": "You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented." }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt_content: 'You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.'
})
};
fetch('https://api.eigi.ai/v1/public/prompts/{prompt_name}', 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/{prompt_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'prompt_content' => 'You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.'
]),
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/{prompt_name}"
payload := strings.NewReader("{\n \"prompt_content\": \"You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.eigi.ai/v1/public/prompts/{prompt_name}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt_content\": \"You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eigi.ai/v1/public/prompts/{prompt_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt_content\": \"You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.\"\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>"
}{
"detail": "<string>"
}Prompts
Update Prompt
Update a prompt by creating a new version with updated content
PATCH
/
v1
/
public
/
prompts
/
{prompt_name}
Update Prompt
curl --request PATCH \
--url https://api.eigi.ai/v1/public/prompts/{prompt_name} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompt_content": "You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented."
}
'import requests
url = "https://api.eigi.ai/v1/public/prompts/{prompt_name}"
payload = { "prompt_content": "You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented." }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt_content: 'You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.'
})
};
fetch('https://api.eigi.ai/v1/public/prompts/{prompt_name}', 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/{prompt_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'prompt_content' => 'You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.'
]),
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/{prompt_name}"
payload := strings.NewReader("{\n \"prompt_content\": \"You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.eigi.ai/v1/public/prompts/{prompt_name}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt_content\": \"You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eigi.ai/v1/public/prompts/{prompt_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt_content\": \"You are an expert customer support agent with 10 years of experience. Always be empathetic and solution-oriented.\"\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>"
}{
"detail": "<string>"
}Overview
Update an existing prompt by creating a new version. The version number is automatically incremented. Previous versions are preserved and can be retrieved using the Get Prompt Versions endpoint.Authentication
string
required
Your eigi.ai API key. Must be prefixed with
vk_.Path Parameters
string
required
The unique name of the prompt to update.
Request Body
string
required
The new prompt text content for the new version.
Response
string
The prompt name.
integer
The new version number (auto-incremented).
string
The updated prompt content.
object
Prompt metadata.
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.
Path Parameters
The unique prompt name
Body
application/json
Response
Prompt updated (new version created)

