---
title: "Get Prompt Template by ID"
method: POST
path: "/prompt-templates/{identifier}"
tags: ["prompt-templates"]
---

# Get Prompt Template by ID

`POST /prompt-templates/{identifier}`

## Path parameters

- `identifier` string, required — The identifier can be either the prompt name or the prompt id.

## Request body

- GetPromptTemplate
  - `version` integer, nullable
  - `workspace_id` integer, nullable
  - `label` string, nullable
  - `provider` 'openai' | 'anthropic', nullable
  - `input_variables` object, nullable
  - `metadata_filters` object, nullable — Optional dictionary of key values used for A/B release labels.
  - `model` string, nullable — Optional model name used for returning default parameters with llm_kwargs.
  - `model_parameter_overrides` object, nullable — Optional dictionary of model parameter overrides to use with the prompt template. This will override the parameters at runtime for the specified model and will try to make sure the model supports these parameters. For example, if you supply `maxOutputTokens` for OpenAI, it will be converted to `max_completion_tokens`.

## Response `200`

Successful Response

- GetPromptTemplateResponse
  - `id` integer, required
  - `prompt_name` string, required
  - `prompt_template` union, required
    - CompletionPrompt
      - `content` union[], required
        - union
          - TextContent
            - `type` 'text'
            - `text` string, required
            - `id` string, nullable
            - `annotations` union[], nullable — Citations and references within the text (web citations, file citations, map citations, container file citations).
              - …
            - `thought_signature` string, nullable
          - ThinkingContent
            - `signature` string, nullable
            - `type` 'thinking'
            - `thinking` string, required
            - `id` string, nullable
          - CodeContent — Code content block (e.g. from code execution tools).
            - `type` 'code'
            - `code` string, required
            - `id` string, nullable
            - `container_id` string, nullable
          - ImageContent
            - `type` 'image_url'
            - `image_url` ImageURL, required
              - …
            - `image_variable` string, nullable
          - MediaContent
            - `type` 'media'
            - `media` Media, required
              - …
          - MediaVariable
            - `type` 'media_variable'
            - `name` string, required — Name of the media variable
          - OutputMediaContent — LLM-generated media output (e.g. from image generation tools).
            - `type` 'output_media'
            - `id` string, nullable
            - `url` string, required
            - `mime_type` string
            - `media_type` 'image' | 'video' | 'audio'
            - `provider_metadata` object, nullable
          - ServerToolUseContent — Server-side tool use block (e.g. web search, code execution).
            - `type` 'server_tool_use'
            - `id` string, required
            - `name` string, required
            - `input` object
          - WebSearchToolResultContent — Results from a web search tool invocation.
            - `type` 'web_search_tool_result'
            - `tool_use_id` string, required
            - `content` WebSearchResult[]
              - …
          - CodeExecutionResultContent — Result from a code execution tool.
            - `type` 'code_execution_result'
            - `output` string, required
            - `outcome` string
          - McpListToolsContent — MCP list tools response block.
            - `type` 'mcp_list_tools'
            - `id` string, nullable
            - `server_label` string
            - `tools` object[]
              - …
            - `error` union
              - …
          - McpCallContent — MCP tool call block.
            - `type` 'mcp_call'
            - `id` string, nullable
            - `name` string
            - `server_label` string
            - `arguments` string
            - `output` string, nullable
            - `error` union
              - …
            - `approval_request_id` string, nullable
          - McpApprovalRequestContent — MCP tool approval request block.
            - `type` 'mcp_approval_request'
            - `id` string, nullable
            - `name` string
            - `arguments` string
            - `server_label` string
          - McpApprovalResponseContent — MCP tool approval response block.
            - `type` 'mcp_approval_response'
            - `approval_request_id` string, required
            - `approve` boolean, required
          - BashCodeExecutionToolResultContent — Result from bash code execution tool.
            - `type` 'bash_code_execution_tool_result'
            - `tool_use_id` string, required
            - `content` object
          - TextEditorCodeExecutionToolResultContent — Result from text editor code execution tool.
            - `type` 'text_editor_code_execution_tool_result'
            - `tool_use_id` string, required
            - `content` object
          - ShellCallContent — Shell tool call block.
            - `type` 'shell_call'
            - `id` string, nullable
            - `call_id` string, nullable
            - `action` object
            - `status` string, nullable
          - ShellCallOutputContent — Shell tool output block.
            - `type` 'shell_call_output'
            - `id` string, nullable
            - `call_id` string, nullable
            - `output` object[]
              - …
            - `status` string, nullable
          - ApplyPatchCallContent — Apply patch tool call block.
            - `type` 'apply_patch_call'
            - `id` string, nullable
            - `call_id` string, nullable
            - `operation` object
            - `status` string, nullable
          - ApplyPatchCallOutputContent — Apply patch tool output block.
            - `type` 'apply_patch_call_output'
            - `id` string, nullable
            - `call_id` string, nullable
            - `output` string, nullable
            - `status` string, nullable
      - `input_variables` string[]
      - `template_format` 'f-string' | 'jinja2'
      - `type` 'completion'
    - ChatPrompt
      - `messages` union[], required
        - union
          - SystemMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], required
              - …
            - `role` 'system'
            - `name` string, nullable
          - UserMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], required
              - …
            - `role` 'user'
            - `name` string, nullable
          - AssistantMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], nullable
              - …
            - `role` 'assistant'
            - `function_call` FunctionCall
              - …
            - `name` string, nullable
            - `tool_calls` ToolCall[], nullable
              - …
          - FunctionMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], nullable
              - …
            - `role` 'function'
            - `name` string, required
          - ToolMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], required
              - …
            - `role` 'tool'
            - `tool_call_id` string, required
            - `name` string, nullable
          - PlaceholderMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], nullable
              - …
            - `raw_request_display_role` string
            - `role` 'placeholder'
            - `name` string, required
          - DeveloperMessage
            - `input_variables` string[]
            - `template_format` 'f-string' | 'jinja2'
            - `content` union[], required
              - …
            - `role` 'developer'
            - `name` string, nullable
      - `functions` Function[], nullable
        - `name` string, required
        - `description` string
        - `strict` boolean — Whether to enable strict schema validation for the function parameters.
        - `parameters` object
      - `tools` Tool[], nullable
        - union
          - FunctionTool — A custom function tool definition.
            - `type` 'function'
            - `function` Function, required
              - …
          - BuiltInTool — A provider-native built-in tool (e.g. web search, code interpreter, bash).
            - `id` string, required
            - `name` string, required
            - `description` string, required
            - `provider` string, required
            - `type` 'web_search' | 'file_search' | 'code_interpreter' | 'image_generation' | 'google_maps' | 'url_context' | 'mcp' | 'bash' | 'shell' | 'apply_patch' | 'text_editor', required
            - `config` object, required — Provider-specific tool configuration. Structure varies by provider and tool type.
      - `function_call` union
        - string
        - MessageFunctionCall
          - `name` string, required
      - `tool_choice` union
        - string
        - ChatToolChoice
          - `type` 'function'
          - `function` MessageFunctionCall, required
            - `name` string, required
      - `type` 'chat'
      - `input_variables` string[]
  - `metadata` Metadata — Metadata associated with the prompt blueprint. Supports additional custom fields beyond the model field.
    - `model` Model
      - `provider` string, required — The LLM provider (e.g. openai, anthropic, google, openai.azure, vertexai, mistral, cohere, amazon.bedrock, huggingface).
      - `model_config_display_name` string, nullable — Optional display name for the model configuration.
      - `base_model` string, nullable — The base model name (e.g. for fine-tuned models).
      - `name` string, required — The model name (e.g. gpt-4o, claude-sonnet-4-20250514).
      - `parameters` object — Model parameters (e.g. temperature, max_tokens, top_p).
      - `display_params` object — Display-friendly parameter values shown in the UI.
      - `api_type` string, nullable — The API type (e.g. chat.completions, responses, images). Used to select the correct API endpoint for the provider.
  - `commit_message` string, nullable
  - `llm_kwargs` object, nullable — When you optionally specify `provider` in the body, `llm_kwargs` will be returned for that specific provider and you can pass these kwargs to the provider's API directly. **Important:** This object's structure is provider-specific and may change without notice as LLM providers update their APIs. For stable, provider-agnostic prompt data, use `prompt_template` instead.
  - `version` integer

## Other responses

- `401` — Unauthorized - missing or invalid API key.
- `422` — Validation Error

---

[API](https://skmtc.dev/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.dev/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/revisions/a23093a0a506/schema)
