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",
            "id": "<string>",
            "annotations": [
              {
                "type": "<string>",
                "title": "<string>",
                "url": "<string>",
                "start_index": 123,
                "end_index": 123,
                "cited_text": "<string>",
                "encrypted_index": "<string>"
              }
            ],
            "thought_signature": "<string>"
          }
        ],
        "input_variables": [],
        "template_format": "f-string",
        "type": "completion"
      },
      "metadata": {
        "model": {
          "provider": "<string>",
          "name": "<string>",
          "model_config_display_name": "<string>",
          "base_model": "<string>",
          "parameters": {},
          "display_params": {},
          "api_type": "<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. Results are ordered by creation date, newest first. Each returned prompt template includes the latest version by default. When filtering by label, the version associated with that label is returned instead.

Pagination

  • page: Page number to retrieve (default: 1)
  • per_page: Number of results per page (default: 30)

Filtering

  • label: Filter prompt templates by release label (e.g., prod, dev, staging). Returns the version associated with that label for each matching template.
  • name: Filter prompt templates by name (case-insensitive partial match)
  • tags: Filter prompt templates by one or more tags. Can be provided as a single string or a list of strings. Only templates whose tags contain all specified values are returned.

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)

tags

Filter prompt templates by tags. Can be a single tag or a list of tags. Only templates whose tags contain all specified values are returned.

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