Introducing Confident Voice: Watch the Launch Video Now

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.

PUT/v2/prompts/{promptId}
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"
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • promptIdstringRequired

    The unique id of the prompt.

Request body

  • aliasstringRequired

    The 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.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A prompt's identity and the labels defined on it, without any version content.

    Show 4 propertiesHide 4 properties
    • idstring

      This is the unique id of the prompt.

    • aliasstring

      This is the alias of the prompt, which is unique within your project.

    • typeenum

      This 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
      • TEXT
      • LIST
    • labelslist of strings

      The labels defined on the prompt, in alphabetical order. Call the label endpoints to see the version each one points at.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI