Skip to main content
PUT
/
prompts
/
{promptId}
Update a prompt
curl --request PUT \
  --url https://api.portkey.ai/v1/prompts/{promptId} \
  --header 'Content-Type: application/json' \
  --header 'x-portkey-api-key: <api-key>' \
  --data '
{
  "patch": true,
  "name": "<string>",
  "collection_id": "<string>",
  "string": "<string>",
  "parameters": {},
  "model": "<string>",
  "virtual_key": "<string>",
  "version_description": "<string>",
  "functions": [
    {}
  ],
  "tools": [
    {}
  ],
  "tool_choice": {},
  "is_raw_template": 0,
  "prompt_metadata": {}
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "slug": "<string>",
  "prompt_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

x-portkey-api-key
string
header
required

Path Parameters

promptId
string
required

Body

application/json
patch
boolean

When true, enables partial version updates. Missing version fields (string, parameters, model) are backfilled from the current latest version, so you only need to provide the fields you want to change. When false or omitted, the original strict validation is preserved for backward compatibility.

name
string
collection_id
string
string
string

The prompt template string. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

parameters
object

Model parameters (e.g. temperature, max_tokens). When patch is true, this field is optional and will be inherited from the current latest version if omitted.

model
string

The model identifier. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

virtual_key
string

The virtual key to associate with this version. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

version_description
string

A human-readable description for this version. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

functions
object[]

Function definitions available to the model. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

tools
object[]

Tool definitions available to the model. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

tool_choice
object

Controls which tool the model uses. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

is_raw_template
enum<integer>

Whether the template string is raw (1) or processed (0). When patch is true, this field is optional and will be inherited from the current latest version if omitted.

Available options:
0,
1
prompt_metadata
object

Additional metadata for the prompt version. When patch is true, this field is optional and will be inherited from the current latest version if omitted.

Response

Prompt updated successfully

id
string<uuid>
slug
string
prompt_version_id
string<uuid>
Last modified on February 27, 2026