Note : This endpoint is in preview and is subject to change.
If you have any feedback, contact Datadog support .
PATCH https://api.ap1.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.ap2.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.datadoghq.eu/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.ddog-gov.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.us2.ddog-gov.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.uk1.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.us3.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id} https://api.us5.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id}
Overview Update the title, the description, or both, for an Agent Observability prompt.
This endpoint requires
all
of the following permissions:
llm_observability_readllm_observability_writefeature_flag_config_readfeature_flag_config_writefeature_flag_environment_config_readArguments Path Parameters The customer-provided identifier of the Agent Observability prompt.
Request Body Data (required) Update prompt payload.
Expand All
Data object for updating an Agent Observability prompt.
Attributes for updating an Agent Observability prompt. At least one of title or description must be provided; both attributes are optional individually.
Optional new description for the prompt.
Optional new title for the prompt.
Resource type of an Agent Observability prompt.
Allowed enum values: prompt-templates
{
"data" : {
"attributes" : {
"description" : "string" ,
"title" : "string"
},
"type" : "prompt-templates"
}
} Response OK
Response containing a single Agent Observability prompt.
Expand All
Data object for an Agent Observability prompt.
Attributes of an Agent Observability prompt registry entry.
UUID of the user who authored the prompt.
Timestamp when the prompt was created.
Source that created the prompt, such as ui-registry, sdk-registry, or sdk-instrumentation.
Datasets observed in runs associated with this prompt.
Unique identifier of the dataset.
Description of the prompt.
Source prompt from which this prompt was extracted, when applicable.
Whether the prompt is a registry entry (as opposed to a code-discovered prompt).
Timestamp of the most recent observed run of this prompt.
Timestamp when the most recent version of the prompt was created.
The ML application this prompt is associated with.
ML applications observed running this prompt.
Number of versions of the prompt.
Customer-provided identifier of the prompt.
Whether the prompt was created from the registry or discovered from observed LLM calls.
Allowed enum values: registry,code
Tags observed on runs of this prompt.
Unique identifier of the prompt.
Resource type of an Agent Observability prompt.
Allowed enum values: prompt-templates
{
"data" : {
"attributes" : {
"author" : "3b12f1df-14fd-4e12-bd6f-4a2f5c8b3d1e" ,
"created_at" : "2025-01-15T10:00:00Z" ,
"created_from" : "sdk-registry" ,
"description" : "Answers customer questions using the company knowledge base." ,
"in_registry" : true ,
"last_version_created_at" : "2025-01-15T10:00:00Z" ,
"num_versions" : 1 ,
"prompt_id" : "customer-support-assistant" ,
"source" : "registry" ,
"title" : "Customer Support Assistant"
},
"id" : "4a1a28ff-8a25-5f0f-946f-f48264d772eb" ,
"type" : "prompt-templates"
}
} Bad Request
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
Short human-readable summary of the error.
{
"errors" : [
{
"detail" : "Missing required attribute in body" ,
"meta" : {},
"source" : {
"header" : "Authorization" ,
"parameter" : "limit" ,
"pointer" : "/data/attributes/title"
},
"status" : "400" ,
"title" : "Bad Request"
}
]
} Unauthorized
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
Short human-readable summary of the error.
{
"errors" : [
{
"detail" : "Missing required attribute in body" ,
"meta" : {},
"source" : {
"header" : "Authorization" ,
"parameter" : "limit" ,
"pointer" : "/data/attributes/title"
},
"status" : "400" ,
"title" : "Bad Request"
}
]
} Forbidden
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
Short human-readable summary of the error.
{
"errors" : [
{
"detail" : "Missing required attribute in body" ,
"meta" : {},
"source" : {
"header" : "Authorization" ,
"parameter" : "limit" ,
"pointer" : "/data/attributes/title"
},
"status" : "400" ,
"title" : "Bad Request"
}
]
} Not Found
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
Short human-readable summary of the error.
{
"errors" : [
{
"detail" : "Missing required attribute in body" ,
"meta" : {},
"source" : {
"header" : "Authorization" ,
"parameter" : "limit" ,
"pointer" : "/data/attributes/title"
},
"status" : "400" ,
"title" : "Bad Request"
}
]
} Too many requests
{
"errors" : [
"Bad Request"
]
} Code Example Copy
## default
#
# Path parameters export prompt_id = "customer-support-assistant" # Curl command curl -X PATCH "https://api.ap1.datadoghq.com "https://api.ap2.datadoghq.com "https://api.datadoghq.eu "https://api.ddog-gov.com "https://api.us2.ddog-gov.com "https://api.uk1.datadoghq.com "https://api.datadoghq.com "https://api.us3.datadoghq.com "https://api.us5.datadoghq.com /api/v2/llm-obs/v1/prompts/${prompt_id} " \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY} " \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY} " \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Answers customer questions using the company knowledge base.",
"title": "Customer Support Assistant"
},
"type": "prompt-templates"
}
}
EOF
"""
Update an Agent Observability prompt returns "OK" response
"""
from datadog_api_client import ApiClient , Configuration
from datadog_api_client.v2.api.agent_observability_api import AgentObservabilityApi
from datadog_api_client.v2.model.llm_obs_prompt_type import LLMObsPromptType
from datadog_api_client.v2.model.llm_obs_update_prompt_data import LLMObsUpdatePromptData
from datadog_api_client.v2.model.llm_obs_update_prompt_data_attributes import LLMObsUpdatePromptDataAttributes
from datadog_api_client.v2.model.llm_obs_update_prompt_request import LLMObsUpdatePromptRequest
body = LLMObsUpdatePromptRequest (
data = LLMObsUpdatePromptData (
attributes = LLMObsUpdatePromptDataAttributes (),
type = LLMObsPromptType . PROMPT_TEMPLATES ,
),
)
configuration = Configuration ()
configuration . unstable_operations [ "update_llm_obs_prompt" ] = True
with ApiClient ( configuration ) as api_client :
api_instance = AgentObservabilityApi ( api_client )
response = api_instance . update_llm_obs_prompt ( prompt_id = "prompt_id" , body = body )
print ( response )
Instructions First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com uk1.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" python3 "example.py"
# Update an Agent Observability prompt returns "OK" response
require "datadog_api_client"
DatadogAPIClient . configure do | config |
config . unstable_operations [ "v2.update_llm_obs_prompt" . to_sym ] = true
end
api_instance = DatadogAPIClient :: V2 :: AgentObservabilityAPI . new
body = DatadogAPIClient :: V2 :: LLMObsUpdatePromptRequest . new ({
data : DatadogAPIClient :: V2 :: LLMObsUpdatePromptData . new ({
attributes : DatadogAPIClient :: V2 :: LLMObsUpdatePromptDataAttributes . new ({}),
type : DatadogAPIClient :: V2 :: LLMObsPromptType :: PROMPT_TEMPLATES ,
}),
})
p api_instance . update_llm_obs_prompt ( "prompt_id" , body )
Instructions First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com uk1.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" rb "example.rb"
// Update an Agent Observability prompt returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main () {
body := datadogV2 . LLMObsUpdatePromptRequest {
Data : datadogV2 . LLMObsUpdatePromptData {
Attributes : datadogV2 . LLMObsUpdatePromptDataAttributes {},
Type : datadogV2 . LLMOBSPROMPTTYPE_PROMPT_TEMPLATES ,
},
}
ctx := datadog . NewDefaultContext ( context . Background ())
configuration := datadog . NewConfiguration ()
configuration . SetUnstableOperationEnabled ( "v2.UpdateLLMObsPrompt" , true )
apiClient := datadog . NewAPIClient ( configuration )
api := datadogV2 . NewAgentObservabilityApi ( apiClient )
resp , r , err := api . UpdateLLMObsPrompt ( ctx , "prompt_id" , body )
if err != nil {
fmt . Fprintf ( os . Stderr , "Error when calling `AgentObservabilityApi.UpdateLLMObsPrompt`: %v\n" , err )
fmt . Fprintf ( os . Stderr , "Full HTTP response: %v\n" , r )
}
responseContent , _ := json . MarshalIndent ( resp , "" , " " )
fmt . Fprintf ( os . Stdout , "Response from `AgentObservabilityApi.UpdateLLMObsPrompt`:\n%s\n" , responseContent )
}
Instructions First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com uk1.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" go run "main.go"
// Update an Agent Observability prompt returns "OK" response
import com.datadog.api.client.ApiClient ;
import com.datadog.api.client.ApiException ;
import com.datadog.api.client.v2.api.AgentObservabilityApi ;
import com.datadog.api.client.v2.model.LLMObsPromptResponse ;
import com.datadog.api.client.v2.model.LLMObsPromptType ;
import com.datadog.api.client.v2.model.LLMObsUpdatePromptData ;
import com.datadog.api.client.v2.model.LLMObsUpdatePromptDataAttributes ;
import com.datadog.api.client.v2.model.LLMObsUpdatePromptRequest ;
public class Example {
public static void main ( String [] args ) {
ApiClient defaultClient = ApiClient . getDefaultApiClient ();
defaultClient . setUnstableOperationEnabled ( "v2.updateLLMObsPrompt" , true );
AgentObservabilityApi apiInstance = new AgentObservabilityApi ( defaultClient );
LLMObsUpdatePromptRequest body =
new LLMObsUpdatePromptRequest ()
. data (
new LLMObsUpdatePromptData ()
. attributes ( new LLMObsUpdatePromptDataAttributes ())
. type ( LLMObsPromptType . PROMPT_TEMPLATES ));
try {
LLMObsPromptResponse result =
apiInstance . updateLLMObsPrompt ( "customer-support-assistant" , body );
System . out . println ( result );
} catch ( ApiException e ) {
System . err . println ( "Exception when calling AgentObservabilityApi#updateLLMObsPrompt" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
Instructions First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com uk1.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" java "Example.java"
// Update an Agent Observability prompt returns "OK" response
use datadog_api_client ::datadog ;
use datadog_api_client ::datadogV2 ::api_agent_observability ::AgentObservabilityAPI ;
use datadog_api_client ::datadogV2 ::model ::LLMObsPromptType ;
use datadog_api_client ::datadogV2 ::model ::LLMObsUpdatePromptData ;
use datadog_api_client ::datadogV2 ::model ::LLMObsUpdatePromptDataAttributes ;
use datadog_api_client ::datadogV2 ::model ::LLMObsUpdatePromptRequest ;
#[tokio::main]
async fn main () {
let body = LLMObsUpdatePromptRequest ::new ( LLMObsUpdatePromptData ::new (
LLMObsUpdatePromptDataAttributes ::new (),
LLMObsPromptType ::PROMPT_TEMPLATES ,
));
let mut configuration = datadog ::Configuration ::new ();
configuration . set_unstable_operation_enabled ( "v2.UpdateLLMObsPrompt" , true );
let api = AgentObservabilityAPI ::with_config ( configuration );
let resp = api
. update_llm_obs_prompt ( "prompt_id" . to_string (), body )
. await ;
if let Ok ( value ) = resp {
println! ( " {:#?} " , value );
} else {
println! ( " {:#?} " , resp . unwrap_err ());
}
}
Instructions First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com uk1.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" cargo run
/**
* Update an Agent Observability prompt returns "OK" response
*/
import { client , v2 } from "@datadog/datadog-api-client" ;
const configuration = client . createConfiguration ();
configuration . unstableOperations [ "v2.updateLLMObsPrompt" ] = true ;
const apiInstance = new v2 . AgentObservabilityApi ( configuration );
const params : v2.AgentObservabilityApiUpdateLLMObsPromptRequest = {
body : {
data : {
attributes : {},
type : "prompt-templates" ,
},
},
promptId : "prompt_id" ,
};
apiInstance
. updateLLMObsPrompt ( params )
. then (( data : v2.LLMObsPromptResponse ) => {
console . log (
"API called successfully. Returned data: " + JSON . stringify ( data )
);
})
. catch (( error : any ) => console . error ( error ));
Instructions First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com uk1.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" tsc "example.ts"