curl -X PUT https://app.tracia.io/api/v1/prompts/welcome-email \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Welcome Email",
"content": [
{
"id": "msg_1",
"role": "user",
"content": "Write a friendly welcome email for {{name}} at {{company}}."
}
]
}'
const prompt = await tracia.prompts.update('welcome-email', {
name: 'Updated Welcome Email',
content: [
{ id: 'msg_1', role: 'user', content: 'Write a friendly welcome email for {{name}} at {{company}}.' },
],
});
{
"id": "clx1abc123",
"slug": "welcome-email",
"name": "Updated Welcome Email",
"description": "A welcome email template",
"provider": "OPENAI",
"model": "gpt-4",
"temperature": 0.7,
"topP": null,
"maxOutputTokens": null,
"currentVersion": 4,
"content": [
{
"id": "msg_1",
"role": "user",
"content": "Write a friendly welcome email for {{name}} at {{company}}."
}
],
"variables": ["name", "company"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-22T08:45:00.000Z"
}
{
"code": "NOT_FOUND",
"message": "Prompt not found: welcome-email"
}
{
"code": "CONFLICT",
"message": "A prompt with this slug already exists"
}
Prompts
Update Prompt
Update an existing prompt
PUT
/
prompts
/
{slug}
curl -X PUT https://app.tracia.io/api/v1/prompts/welcome-email \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Welcome Email",
"content": [
{
"id": "msg_1",
"role": "user",
"content": "Write a friendly welcome email for {{name}} at {{company}}."
}
]
}'
const prompt = await tracia.prompts.update('welcome-email', {
name: 'Updated Welcome Email',
content: [
{ id: 'msg_1', role: 'user', content: 'Write a friendly welcome email for {{name}} at {{company}}.' },
],
});
{
"id": "clx1abc123",
"slug": "welcome-email",
"name": "Updated Welcome Email",
"description": "A welcome email template",
"provider": "OPENAI",
"model": "gpt-4",
"temperature": 0.7,
"topP": null,
"maxOutputTokens": null,
"currentVersion": 4,
"content": [
{
"id": "msg_1",
"role": "user",
"content": "Write a friendly welcome email for {{name}} at {{company}}."
}
],
"variables": ["name", "company"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-22T08:45:00.000Z"
}
{
"code": "NOT_FOUND",
"message": "Prompt not found: welcome-email"
}
{
"code": "CONFLICT",
"message": "A prompt with this slug already exists"
}
Update a prompt’s metadata or content. If the content changes, a new version is automatically created.
Request
string
required
Bearer token with your API key:
Bearer tr_your_api_keystring
required
The prompt slug to update
string
New display name
string
New URL-friendly identifier
string
New description (set to empty string to clear)
array
New array of prompt messages. If different from current content, creates a new version.
Response
Returns the updated prompt object with the new version number if content changed.curl -X PUT https://app.tracia.io/api/v1/prompts/welcome-email \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Welcome Email",
"content": [
{
"id": "msg_1",
"role": "user",
"content": "Write a friendly welcome email for {{name}} at {{company}}."
}
]
}'
const prompt = await tracia.prompts.update('welcome-email', {
name: 'Updated Welcome Email',
content: [
{ id: 'msg_1', role: 'user', content: 'Write a friendly welcome email for {{name}} at {{company}}.' },
],
});
{
"id": "clx1abc123",
"slug": "welcome-email",
"name": "Updated Welcome Email",
"description": "A welcome email template",
"provider": "OPENAI",
"model": "gpt-4",
"temperature": 0.7,
"topP": null,
"maxOutputTokens": null,
"currentVersion": 4,
"content": [
{
"id": "msg_1",
"role": "user",
"content": "Write a friendly welcome email for {{name}} at {{company}}."
}
],
"variables": ["name", "company"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-22T08:45:00.000Z"
}
{
"code": "NOT_FOUND",
"message": "Prompt not found: welcome-email"
}
{
"code": "CONFLICT",
"message": "A prompt with this slug already exists"
}
Authorizations
API key starting with tr_
Path Parameters
The prompt slug to update
Body
application/json
Response
Prompt updated
Unique identifier for the prompt
URL-friendly identifier
Display name of the prompt
Description of the prompt
Model provider
Available options:
OPENAI, ANTHROPIC, GOOGLE, AMAZON_BEDROCK Default model for this prompt
Temperature setting for the model (0-2)
Top-p (nucleus) sampling setting (0-1)
Maximum output tokens limit
Current version number
Array of prompt messages
Show child attributes
Show child attributes
List of template variables extracted from content
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update

