Templates

Get the latest version

This is the most common endpoint you'll use when working with prompt templates.

This route is used by the Lunary SDKs to fetch the latest version of a template before making an LLM call.

This route differs from all the next ones in that:

  • it requires only the slug parameter to reference a template
  • it doesn't require using a Private Key to authenticate the request (Public Key is enough)
GET
/v1/template-versions/latest
curl --request GET \
  --url https://api.lunary.ai/v1/template-versions/latest \
  --header 'Authorization: Bearer <api_key>' \
  --header 'Content-Type: application/json'

Parameters

NameLocated InRequiredSchema
slugqueryYesstring

Responses

200

Latest version of the template

PropertyTypeDescription
idstring
templateIdstring
contentarray
extraobject
testValuesobject
isDraftboolean
notesstring
createdAtstring
versionnumber

404

Template not found

Questions? We're here to help.

Email