Skip to main content
PATCH
/
v1
/
prompt
/
{prompt_id}
Partially update prompt
curl --request PATCH \
  --url https://api.braintrust.dev/v1/prompt/{prompt_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "slug": "<string>",
  "description": "<string>",
  "prompt_data": {
    "prompt": {
      "type": "chat",
      "messages": [
        {
          "content": "<string>",
          "role": "system",
          "name": "<string>"
        }
      ],
      "tools": "<string>"
    },
    "options": {
      "model": "<string>",
      "params": {
        "use_cache": true,
        "temperature": 123,
        "top_p": 123,
        "max_tokens": 123,
        "max_completion_tokens": 123,
        "frequency_penalty": 123,
        "presence_penalty": 123,
        "response_format": {
          "type": "json_object"
        },
        "tool_choice": "auto",
        "function_call": "auto",
        "n": 123,
        "stop": [
          "<string>"
        ],
        "reasoning_effort": "minimal",
        "verbosity": "low"
      },
      "position": "<string>"
    },
    "parser": {
      "type": "llm_classifier",
      "use_cot": true,
      "choice_scores": {}
    },
    "tool_functions": [
      {
        "type": "function",
        "id": "<string>"
      }
    ],
    "origin": {
      "prompt_id": "<string>",
      "project_id": "<string>",
      "prompt_version": "<string>"
    }
  },
  "tags": [
    "<string>"
  ]
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "_xact_id": "<string>",
  "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "log_id": "p",
  "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "slug": "<string>",
  "description": "<string>",
  "created": "2023-11-07T05:31:56Z",
  "prompt_data": {
    "prompt": {
      "type": "chat",
      "messages": [
        {
          "content": "<string>",
          "role": "system",
          "name": "<string>"
        }
      ],
      "tools": "<string>"
    },
    "options": {
      "model": "<string>",
      "params": {
        "use_cache": true,
        "temperature": 123,
        "top_p": 123,
        "max_tokens": 123,
        "max_completion_tokens": 123,
        "frequency_penalty": 123,
        "presence_penalty": 123,
        "response_format": {
          "type": "json_object"
        },
        "tool_choice": "auto",
        "function_call": "auto",
        "n": 123,
        "stop": [
          "<string>"
        ],
        "reasoning_effort": "minimal",
        "verbosity": "low"
      },
      "position": "<string>"
    },
    "parser": {
      "type": "llm_classifier",
      "use_cot": true,
      "choice_scores": {}
    },
    "tool_functions": [
      {
        "type": "function",
        "id": "<string>"
      }
    ],
    "origin": {
      "prompt_id": "<string>",
      "project_id": "<string>",
      "prompt_version": "<string>"
    }
  },
  "tags": [
    "<string>"
  ],
  "metadata": {},
  "function_type": "llm"
}

Authorizations

Authorization
string
header
required

Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.

Path Parameters

prompt_id
string<uuid>
required

Prompt id

Body

application/json

Fields to update

name
string | null

Name of the prompt

slug
string | null

Unique identifier for the prompt

description
string | null

Textual description of the prompt

prompt_data
object | null

The prompt, model, and its parameters

tags
string[] | null

A list of tags for the prompt

Response

Returns the prompt object

id
string<uuid>
required

Unique identifier for the prompt

_xact_id
string
required

The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the prompt (see the version parameter)

project_id
string<uuid>
required

Unique identifier for the project that the prompt belongs under

log_id
enum<string>
required

A literal 'p' which identifies the object as a project prompt

Available options:
p
org_id
string<uuid>
required

Unique identifier for the organization

name
string
required

Name of the prompt

slug
string
required

Unique identifier for the prompt

description
string | null

Textual description of the prompt

created
string<date-time> | null

Date of prompt creation

prompt_data
object | null

The prompt, model, and its parameters

tags
string[] | null

A list of tags for the prompt

metadata
object | null

User-controlled metadata about the prompt

function_type
enum<string> | null
Available options:
llm,
scorer,
task,
tool