---
title: "Finds a prompt template by id."
method: GET
path: "/prompt_templates/{prompt_template_id}"
tags: ["Prompt Templates"]
---

# Finds a prompt template by id.

`GET /prompt_templates/{prompt_template_id}`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/prompt_templates/{prompt_template_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/prompt_templates/:prompt_template_id/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns a single prompt template by its unique identifier.

## Path parameters

- `prompt_template_id` string, required

## Response `200`

Successful operation

- PromptTemplate
  - `name` string: A name of the prompt template.
  - `description` string: A description of the prompt template.
  - `lang` string: A language code.
  - `system_prompt` string: A system prompt.
  - `pre_prompt_query` string: A text that is prepended before the contextual document chunks.
  - `prompt_query` string: A text that is appended to the beginning of the user's message.
  - `hyde_no_rag_llm_prompt_extension` string: An LLM prompt extension.
  - `pre_prompt_summary` string: A prompt that goes before each large piece of text to summarize.
  - `prompt_summary` string: A prompt that goes after each large piece of text to summarize.
  - `system_prompt_reflection` string: A system prompt for self-reflection.
  - `prompt_reflection` string: A template for self-reflection, must contain two occurrences of %s for full previous prompt (including system prompt, document related context and prompts if applicable, and user prompts) and answer
  - `auto_gen_description_prompt` string: A prompt to create a description of the collection.
  - `auto_gen_document_summary_pre_prompt_summary` string: A `pre_prompt_summary` for summary of a freshly imported document (if enabled).
  - `auto_gen_document_summary_prompt_summary` string: A `prompt_summary` for summary of a freshly imported document (if enabled).`
  - `auto_gen_document_sample_questions_prompt` string: A prompt to create sample questions for a freshly imported document (if enabled).
  - `default_sample_questions` string[]: Default sample questions in case there are no auto-generated sample questions.
  - `image_batch_image_prompt` string: A prompt for each image batch for vision models.
  - `image_batch_final_prompt` string: A prompt for each image batch for vision models.
  - `id` string, required: A unique identifier of the prompt template.
  - `is_default` boolean, required: A flag identifying if the prompt template is default or not.
  - `user_count` integer: The number of users who have access to the prompt template.
  - `group_count` integer: The number of groups who have access to the prompt template.
  - `username` string: Name of the user owning the prompt template.
  - `user_id` string: The unique identifier of the user owning the prompt template.
  - `created_at` string, date-time: The moment when the prompt template was created.
  - `updated_at` string, date-time: The Last time when the prompt template was modified.
  - `is_public` boolean, required: Whether the prompt template is public or private (only applies to custom templates).
  - `visible` boolean: A flag identifying if a default prompt template is visible to system users.
  - `is_system_default` boolean: A flag identifying if a default prompt template is the system default.

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `404`: Not found
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
