Skip to main content
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}}."
      }
    ]
  }'
{
  "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"
}
Update a prompt’s metadata or content. If the content changes, a new version is automatically created.

Request

Authorization
string
required
Bearer token with your API key: Bearer tr_your_api_key
slug
string
required
The prompt slug to update
name
string
New display name
slug
string
New URL-friendly identifier
description
string
New description (set to empty string to clear)
content
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}}."
      }
    ]
  }'
{
  "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"
}

Authorizations

Authorization
string
header
required

API key starting with tr_

Path Parameters

slug
string
required

The prompt slug to update

Body

application/json
name
string

New display name

slug
string

New URL-friendly identifier

description
string

New description (set to empty string to clear)

content
object[]

New array of prompt messages

Response

Prompt updated

id
string

Unique identifier for the prompt

slug
string

URL-friendly identifier

name
string

Display name of the prompt

description
string | null

Description of the prompt

provider
enum<string> | null

Model provider

Available options:
OPENAI,
ANTHROPIC,
GOOGLE
model
string | null

Default model for this prompt

temperature
number | null

Temperature setting for the model (0-2)

topP
number | null

Top-p (nucleus) sampling setting (0-1)

maxOutputTokens
integer | null

Maximum output tokens limit

currentVersion
integer

Current version number

content
object[]

Array of prompt messages

variables
string[]

List of template variables extracted from content

createdAt
string<date-time>

ISO 8601 timestamp of creation

updatedAt
string<date-time>

ISO 8601 timestamp of last update