PATCH
/
v1
/
templates
/
{id}
curl --request PATCH \
  --url https://api.lunary.ai/v1/templates/{id} \
  --header 'Content-Type: application/json' \
  --data '{
  "slug": "updated-customer-support-chat",
  "mode": "openai"
}'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "slug": "updated-customer-support-chat",
  "mode": "openai",
  "projectId": "456e7890-e12b-34d5-a678-426614174111",
  "createdAt": "2023-01-01T00:00:00Z",
  "versions": [
    {
      "id": "789e0123-e45b-67d8-a901-426614174222",
      "templateId": "123e4567-e89b-12d3-a456-426614174000",
      "content": [
        {
          "role": "system",
          "content": "You are a helpful customer support agent."
        },
        {
          "role": "user",
          "content": "I have a question about my order."
        }
      ],
      "extra": {
        "temperature": 0.7,
        "max_tokens": 150
      },
      "testValues": {
        "orderNumber": "ORD-12345"
      },
      "isDraft": false,
      "notes": "Updated version for improved customer support",
      "createdAt": "2023-01-02T12:00:00Z",
      "version": 1
    }
  ]
}

Path Parameters

id
string
required

The ID of the template to update

Body

application/json
slug
string
mode
enum<string>
Available options:
text,
openai

Response

200
application/json
Successful response
id
string
name
string
slug
string
mode
enum<string>
Available options:
text,
openai
createdAt
string
group
string
projectId
string
versions
object[]