Create a new version
curl --request POST \
--url https://api.lunary.ai/v1/templates/{id}/versions \
--header 'Authorization: Bearer <token>' \
--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
}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
Create a new version
curl --request POST \
--url https://api.lunary.ai/v1/templates/{id}/versions \
--header 'Authorization: Bearer <token>' \
--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
}Authorizations
Use a project private API key via Authorization: Bearer <key>.
Path Parameters
The ID of the template to create a new version for
Body
application/json