---
title: "Set prompt version."
method: PUT
path: "/v1/prompts/{prompt_id}/set-default-version"
tags: ["Prompts"]
---

# Set prompt version.

`PUT /v1/prompts/{prompt_id}/set-default-version`

Set which version of a prompt should be the default in get_prompt (latest).

## Path parameters

- `prompt_id` string, required — The identifier of the prompt.

## Request body

- SetDefaultVersionBodyRequest — Request body model for setting the default version of a prompt.
  - `version` integer, required — The version to set as default.

## Response `200`

The prompt with the specified version now set as default.

- Prompt — A prompt resource representing a stored OpenAI Compatible prompt template in OGX.
  - `prompt` string, nullable — The system prompt with variable placeholders
  - `version` integer, required — Version (integer starting at 1, incremented on save)
  - `prompt_id` string, required — Unique identifier in format 'pmpt_<48-digit-hash>'
  - `variables` string[] — List of variable names that can be used in the prompt template
  - `is_default` boolean — Boolean indicating whether this version is the default version

## Other responses

- `400` — The request was invalid or malformed
- `429` — The client has sent too many requests in a given amount of time
- `500` — The server encountered an unexpected error
- `default` — An error occurred

---

[API](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis.md) · [All operations](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ogx-ai/ogx-specification-stable-experimental-apis/revisions/f3f783962256/schema)
