POST
/
v1
/
templates
/
{id}
/
versions
curl --request POST \
  --url https://api.lunary.ai/v1/templates/{id}/versions \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "Hello {{name}}, welcome to {{company}}!",
  "extra": {
    "temperature": 0.7,
    "max_tokens": 150
  },
  "isDraft": false,
  "notes": "Updated welcome message with company name"
}'
{
  "id": "123",
  "templateId": "456",
  "content": "Hello {{name}}, welcome to {{company}}!",
  "extra": {
    "temperature": 0.7,
    "max_tokens": 150
  },
  "isDraft": false,
  "notes": "Updated welcome message with company name",
  "createdAt": "2023-06-01T12:00:00Z",
  "version": 2
}

Path Parameters

id
string
required

The ID of the template to create a new version for

Body

application/json
content
any[]
required
isDraft
boolean
required
extra
object
testValues
object
notes
string

Response

200 - application/json
Successful response
id
string
templateId
string
content
any[]
extra
object
testValues
object
isDraft
boolean
notes
string
createdAt
string
version
number