Templates
Get a specific template
Getting Started
Audit Logs
Datasets
- GETList datasets
- POSTCreate a new dataset
- GETGet dataset by ID or slug
- DELDelete a dataset
- PATCHUpdate a dataset
- POSTCreate a new prompt
- GETGet prompt by ID
- DELDelete a prompt
- PATCHUpdate a prompt
- GETGet prompt variation by ID
- DELDelete a prompt variation
- PATCHUpdate a prompt variation
- POSTCreate a new prompt variation
Runs
Templates
Templates
Get a specific template
Get a specific prompt template and all its versions by its ID.
GET
/
v1
/
templates
/
{id}
curl --request GET \
--url https://api.lunary.ai/v1/templates/{id}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Chat",
"slug": "customer-support-chat",
"mode": "openai",
"createdAt": "2023-01-01T00:00:00Z",
"projectId": "987e6543-e21b-12d3-a456-426614174000",
"versions": [
{
"id": "abcd1234-e56f-78g9-h012-ijklmnopqrst",
"templateId": "123e4567-e89b-12d3-a456-426614174000",
"content": [
{
"role": "system",
"content": "You are a helpful customer support agent."
},
{
"role": "user",
"content": "Hello, I have a question about my order."
},
{
"role": "assistant",
"content": "Of course! I'd be happy to help you with your order. Could you please provide me with your order number?"
}
],
"extra": {
"temperature": 0.7,
"maxTokens": 150
},
"testValues": {
"orderNumber": "ORD-12345"
},
"isDraft": false,
"notes": "Updated to improve response clarity",
"createdAt": "2023-01-02T12:00:00Z",
"version": 1
}
]
}
Path Parameters
Response
200
application/json
Successful response
Available options:
text
, openai
curl --request GET \
--url https://api.lunary.ai/v1/templates/{id}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Chat",
"slug": "customer-support-chat",
"mode": "openai",
"createdAt": "2023-01-01T00:00:00Z",
"projectId": "987e6543-e21b-12d3-a456-426614174000",
"versions": [
{
"id": "abcd1234-e56f-78g9-h012-ijklmnopqrst",
"templateId": "123e4567-e89b-12d3-a456-426614174000",
"content": [
{
"role": "system",
"content": "You are a helpful customer support agent."
},
{
"role": "user",
"content": "Hello, I have a question about my order."
},
{
"role": "assistant",
"content": "Of course! I'd be happy to help you with your order. Could you please provide me with your order number?"
}
],
"extra": {
"temperature": 0.7,
"maxTokens": 150
},
"testValues": {
"orderNumber": "ORD-12345"
},
"isDraft": false,
"notes": "Updated to improve response clarity",
"createdAt": "2023-01-02T12:00:00Z",
"version": 1
}
]
}