Skip to main content
GET
/
prompt-templates
Get All
curl --request GET \
  --url https://api.promptlayer.com/prompt-templates \
  --header 'X-API-KEY: <x-api-key>'
{
  "has_next": true,
  "has_prev": true,
  "items": [
    {
      "id": 123,
      "prompt_name": "<string>",
      "prompt_template": {
        "content": [
          {
            "text": "<string>",
            "type": "text"
          }
        ],
        "input_variables": [],
        "template_format": "f-string",
        "type": "completion"
      },
      "metadata": {
        "model": {
          "provider": "<string>",
          "name": "<string>",
          "parameters": {}
        },
        "customField": "<string>"
      },
      "commit_message": "<string>",
      "llm_kwargs": {},
      "version": 123
    }
  ],
  "next_num": 123,
  "prev_num": 123,
  "page": 123,
  "pages": 123,
  "total": 123
}
Get a paginated list of all prompt templates in your workspace.

Filtering

  • label: Filter prompt templates by release label (e.g., ‘prod’, ‘dev’, ‘staging’)
  • name: Filter prompt templates by name (case-insensitive partial match)

Filtering by Status

Use the status parameter to control which prompt templates are returned based on their deletion status:
  • active (default): Returns only active prompt templates
  • deleted: Returns only deleted/archived prompt templates
  • all: Returns both active and deleted prompt templates

Authentication

This endpoint requires API key authentication via the X-API-KEY header.

Headers

X-API-KEY
string
required

Query Parameters

page
integer
per_page
integer
label
string

Filter prompt templates by release label (e.g., 'prod', 'dev', 'staging')

name
string

Filter prompt templates by name (case-insensitive partial match)

status
enum<string>
default:active

Filter prompt templates by status: 'active' (default) returns only active templates, 'deleted' returns only deleted/archived templates, 'all' returns both

Available options:
active,
deleted,
all

Response

200 - application/json

Successful Response

has_next
boolean
required
has_prev
boolean
required
items
GetPromptTemplateResponse · object[]
required
next_num
integer
required
prev_num
integer
required
page
integer
required
pages
integer
required
total
integer
required