Update Prompt
(v2)PUT
Renames the prompt by changing its alias, which must be unique within your project, and returns the updated prompt. The prompt keeps its id, commits, versions and labels, but pulls by the previous alias stop resolving.
curl -X PUT "https://api.confident-ai.com/v2/prompts/{promptId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"alias": "greeting-v2"
}'{
"success": true,
"data": {
"id": "<PROMPT-ID>",
"alias": "greeting",
"type": "TEXT",
"labels": [
"production",
"staging"
]
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/prompt-studio/<PROMPT-ID>?branch=main",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
promptIdstringRequiredThe unique id of the prompt.
Request body
aliasstringRequiredThe new alias of the prompt, unique within your project. Pulls by the previous alias stop resolving once the prompt is renamed.
Response
Update Prompt succeeded.
successbooleanIndicates if the request was successful.
dataobjectA prompt's identity and the labels defined on it, without any version content.
Show 4 propertiesHide 4 properties
idstringThis is the unique id of the prompt.
aliasstringThis is the alias of the prompt, which is unique within your project.
typeenumThis is the type of the prompt, which can be either a simple text or a list of messages.
Show 2 enum valuesHide 2 enum values
TEXTLIST
labelslist of stringsThe labels defined on the prompt, in alphabetical order. Call the label endpoints to see the version each one points at.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.