Templates

Create a new version

This endpoint allows you to push a new version of a prompt. You can specify the content, extra parameters, test values, draft status, and notes for the new version.

POST
/v1/templates/
id
/versions
curl --request POST \
  --url https://api.lunary.ai/v1/templates/{id}/versions \
  --header 'Authorization: Bearer <api_key>' \
  --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"}'

Accepted Keys:

content
extra
isDraft
notes

Example response:

{
  "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
}

Parameters

NameLocated InRequiredSchema
idpathYesstring

Request Body

PropertyTypeDescription
contentarray
extraobject
testValuesobject
isDraftboolean
notesstring

Responses

200

Successful response

PropertyTypeDescription
idstring
templateIdstring
contentarray
extraobject
testValuesobject
isDraftboolean
notesstring
createdAtstring
versionnumber

Questions? We're here to help.

Email