Update Prompt Action
(v2)PUT
Updates a prompt action and returns it. Send at least one field. When you send evalTask, name is required and its other fields you omit keep their stored values. The new dataset and evaluator collection must belong to your project, and the evaluation name must not be taken by another evaluation.
curl -X PUT "https://api.confident-ai.com/v2/prompts/{promptId}/prompt-actions/{promptActionId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"trigger": [
"COMMIT"
],
"evalTask": {
"name": "Greeting regression",
"datasetId": "<DATASET-ID>",
"evaluatorCollectionId": "<EVALUATOR-COLLECTION-ID>",
"variableMapping": {
"name": "input"
}
},
"enabled": true
}'{
"success": true,
"data": {
"id": "<PROMPT-ACTION-ID>",
"promptId": "<PROMPT-ID>",
"enabled": true,
"trigger": [
"COMMIT"
],
"evalTask": {
"id": "<EVAL-TASK-ID>",
"name": "Greeting regression",
"datasetId": "<DATASET-ID>",
"evaluatorCollectionId": "<EVALUATOR-COLLECTION-ID>",
"variableMapping": {
"name": "input"
}
},
"createdAt": "2025-01-18T16:45:00.000Z",
"updatedAt": "2025-01-20T09:12:00.000Z"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/prompt-studio/<PROMPT-ID>/actions",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
promptIdstringRequiredThe unique id of the prompt.
promptActionIdstringRequiredThe unique id of the prompt action.
Request body
triggerlist of enumsThe events that start the action. List each trigger once; the action runs whenever any of them happens to the prompt.
Show 4 enum valuesHide 4 enum values
COMMITVERSIONMERGEPULL_REQUEST
evalTaskobjectThe evaluation the action runs.
Show 4 propertiesHide 4 properties
namestringRequiredThe name of the evaluation, unique within your project. Test runs the action starts are named after it.
datasetIdstring | nullThe id of the dataset whose finalized goldens the prompt is evaluated against, or
nullfor none. Omit it to keep the current dataset when updating. The action only runs once a dataset and an evaluator collection are both set.evaluatorCollectionIdstring | nullThe id of the evaluator collection that scores the outputs, or
nullfor none. Omit it to keep the current collection when updating.variableMappingobject | nullMaps each prompt variable to the dataset field that fills it, as
{ variable: field }. Sendnullto clear it, or omit it to keep the current mapping when updating.
enabledbooleanWhether the action runs when triggered. Defaults to
trueon create; omit it to keep the current value when updating.
Response
Update Prompt Action succeeded.
successbooleanIndicates if the request was successful.
dataobjectAn evaluation that runs automatically when something happens to the prompt.
Show 7 propertiesHide 7 properties
idstringThis is the unique id of the prompt action.
promptIdstringThis is the id of the prompt the action belongs to.
enabledbooleanWhether the action runs when triggered.
triggerlist of enumsThese are the events that start the action.
Show 4 enum valuesHide 4 enum values
COMMITVERSIONMERGEPULL_REQUEST
evalTaskobjectThe evaluation a prompt action runs.
Show 5 propertiesHide 5 properties
idstringThis is the unique id of the evaluation.
namestringThis is the name of the evaluation, unique within your project.
datasetIdstring | nullThis is the id of the dataset the prompt is evaluated against, or
nullwhen none is set.evaluatorCollectionIdstring | nullThis is the id of the evaluator collection that scores the outputs, or
nullwhen none is set.variableMappingobject | nullThis maps each prompt variable to the dataset field that fills it, or is
nullwhen none is set.
createdAtstringWhen the action was created.
updatedAtstringWhen the action was last changed.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.