Enable or Disable an Evaluator¶
POST /api/v1/agent_eval/evaluator/{evaluator_uuid}/status
Overview¶
Sets the enable/disable status of a custom evaluator in the current workspace.
Before Calling and Usage Steps¶
Use the DF-API-KEY of the target workspace; even for read-only access, the Application Configuration Management permission for Agent Monitoring is required. Only custom evaluators in the current workspace are operated on; system built-in evaluators are not exposed. Place parameters only in the corresponding query/path or JSON body; body parameters in the URL are prohibited. First read the details to verify the current status, then POST JSON to set enabled/disabled. When the status does not change, the original publishedAt/lastScanAt are retained, and audit records are not duplicated; enabling from another status updates publishedAt (seconds) and lastScanAt (milliseconds). Prompt requires available AI capabilities, and Schema requires valid in-document references. Disabling only stops new online scheduling; existing tasks may still complete. This API does not clear historical results and does not prove that the evaluation has completed. After a timeout, read back the status before deciding whether to retry.
Path Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| evaluator_uuid | string | Y | UUID of a custom evaluator in the current workspace; UUIDs of system built-in evaluators and other workspaces are treated as nonexistent. Example: aeve_0123456789abcdef0123456789abcdefHow to obtain or fill in: Obtain it from content.uuid in Create Evaluator or content.data[].uuid in List Evaluators. |
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI credential for the target workspace; both read and write require the Application Configuration Management permission for Agent Monitoring; the associated role must be owner, wsAdmin, or general. Example: <DF-API-KEY>How to obtain or fill in: Create and authorize it in API Key Management of the target workspace, and pass it in the DF-API-KEY request header; do not put a real Key in URLs or examples. |
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| status | string | Y | Required; must be enabled or disabled. After enabling, online evaluation can be performed on newly arriving data; disabling stops new scheduling but does not mean that already submitted tasks are revoked. Repeatedly setting the current status does not refresh scan progress or duplicate status change audit records. Allowed null: False Allowed values: ['enabled', 'disabled'] Example: disabledHow to obtain or fill in: Check the current status in content.status from Details, then select the target value. |
Additional Parameter Notes¶
Pass enabled in the JSON request body to enable, or disabled to disable. Repeatedly setting the current status retains existing scan progress. When enabling a Prompt evaluator, the workspace must have available AI capabilities.
Request Example¶
curl 'https://openapi.truewatch.com/api/v1/agent_eval/evaluator/aeve_0123456789abcdef0123456789abcdef/status' \
--request POST \
--header 'DF-API-KEY:
Response¶
HTTP 200, application/json. The success wrapper and fields are as follows; for failures, see common errors and the exception handling on this page.
| Field | Type | Description |
|---|---|---|
| code | integer | Business response status; 200 on success. |
| errorCode | string | Empty on success; a specific error code on failure. |
| message | string | Empty on success; an error message on failure. |
| success | boolean | Whether the request succeeded. |
| traceId | string | Trace ID for this request; retain it when troubleshooting. |
| content | object | Complete evaluator configuration that was saved or read. |
| content.uuid | string | Evaluator UUID, used for subsequent details, modification, enable/disable, and deletion. |
| content.name | string | Evaluator name. |
| content.description | string | Business description; may be an empty string. |
| content.evalType | string | prompt or schema. |
| content.templateKey | string | Schema system template identifier; empty for the Prompt type. |
| content.schemaConfig | object | Normalized Schema configuration; empty object for the Prompt type. |
| content.schemaConfig.templateVersion | integer | Schema template version, currently 1; present only when the Schema configuration is non-empty. |
| content.schemaConfig.schemaDialect | string | Schema dialect draft-07; present only when the Schema configuration is non-empty. |
| content.schemaConfig.validationSource | string | Schema value source: output or tool_calls. |
| content.schemaConfig.targetField | string | Schema validation target field, such as gen_ai_output_messages or tool_calls. |
| content.schemaConfig.missingPolicy | string | Schema missing policy; currently fail. |
| content.schemaConfig.schema | object | Actual JSON Schema; its structure is determined by the system template and custom configuration. Internal keys are standard Draft 7 keywords and custom business attributes. |
| content.promptUUID | string | Built-in Prompt template UUID; empty for custom Prompts and Schema. |
| content.promptName | string | Template display name; when no Prompt is associated, Schema may return its system template name. |
| content.promptDescription | string | Template description; empty when no template is associated. |
| content.promptContent | string | Actual evaluation instructions; empty for the Schema type. |
| content.promptOrigin | string | Prompt source, builtin or custom; Schema may also return a compatible default builtin value, which does not mean a Prompt is used. |
| content.selectedInputFields | array<string> or null | Input fields selected in the legacy version or generic aliases derived in version 1; may be null when not configured, and may be an empty array in version 1 when only raw paths are selected. |
| content.selectedInputFields[] | string | Input evidence alias, such as gen_ai_input; it is not an arbitrary raw Trace path. |
| content.generationDescription | string | Original template generation description; may be empty. |
| content.inputTemplateVersion | integer or null | Returns 1 for version 1; null for legacy versions and when not configured. |
| content.userPromptTemplate | string | For version 1, the saved input template; for legacy Prompts, an input template generated according to the read language; empty for Schema. |
| content.targetType | string | agent or llm; Schema supports only agent. |
| content.evalScope | string | trace or span for Prompt; an empty string for Schema. |
| content.resultType | string | boolean or score; Schema supports only boolean. |
| content.resultConfig | object | Output configuration, determined by resultType; it cannot be written directly through this API. |
| content.resultConfig.values | array<string> | Present for the boolean type; fixed to pass and fail. |
| content.resultConfig.values[] | string | Boolean evaluation result label, pass or fail. |
| content.resultConfig.min | integer | Present for the score type; fixed to 0. |
| content.resultConfig.max | integer | Present for the score type; fixed to 100. |
| content.sourceType | string | This group of APIs manages only custom evaluators. |
| content.targetConfig | object | Saved filtering, language, and input configuration; some subfields vary by type and input version. |
| content.targetConfig.agentRuntime | string | Normalized Agent runtime filter value; empty means unrestricted. |
| content.targetConfig.agentID | string | Agent instance filter value; may be empty. |
| content.targetConfig.appID | string | Public appId filter value for the LLM application; may be empty. |
| content.targetConfig.appName | string | Saved LLM application display name, used for the app_name label in evaluation results; it does not participate in online candidate Trace filtering. To filter applications, set appID. May be empty. |
| content.targetConfig.language | string | Saved evaluation output language. |
| content.targetConfig.promptOrigin | string | Source saved for the Prompt type, builtin or custom; Schema usually does not have this key. |
| content.targetConfig.selectedInputFields | array<string> | Present when legacy field selection or version 1 is configured; same meaning as the top-level selectedInputFields. |
| content.targetConfig.selectedInputFields[] | string | Saved or derived generic input field name. |
| content.targetConfig.generationDescription | string | Generation description saved for the Prompt type. |
| content.targetConfig.inputTemplateVersion | integer | Present for version 1 with a value of 1. |
| content.targetConfig.inputVariables | array<string> | Present for version 1; deduplicated variable paths parsed from userPromptTemplate, up to 100 items. |
| content.targetConfig.inputVariables[] | string | Raw variable path or generic alias, such as root.input or spans[*].output. |
| content.status | string | Saved status; newly created evaluators are enabled. The status API can set enabled or disabled. Historical data may be draft. |
| content.samplingRate | integer | Online sampling percentage, 0–100. |
| content.dailyCallLimit | integer | Daily call limit, 1–1000000. |
| content.timeoutSeconds | integer | Evaluation execution timeout, in seconds. |
| content.maxRetries | integer | Maximum number of retries for online evaluation, 0–5. |
| content.publishedAt | integer | Published/enabled time, in Unix seconds; unpublished historical values may be -1. |
| content.lastScanAt | integer | Latest scan progress time, in Unix milliseconds; historical unset values may be -1. Actual configuration changes may reset it; it is not the completion time of this HTTP request. |
| content.createAt | integer | Creation time, in Unix seconds. |
| content.updateAt | integer | Modification time, in Unix seconds. |
| content.declaration | object or null | Public declaration for this workspace; when not configured, it may be an empty object or null. In list responses, only the content level carries it; it is not populated item by item in data[]. |
{
"code": 200,
"content": {
"uuid": "aeve_0123456789abcdef0123456789abcdef",
"name": "LLM 回答完整性",
"description": "",
"evalType": "prompt",
"templateKey": "",
"schemaConfig": {},
"promptUUID": "",
"promptName": "",
"promptDescription": "",
"promptContent": "判断回答是否完整回应了用户问题。给出通过或不通过的结果及原因。",
"promptOrigin": "custom",
"selectedInputFields": [
"gen_ai_input",
"gen_ai_output"
],
"generationDescription": "",
"inputTemplateVersion": null,
"userPromptTemplate": "gen_ai_input:\n{{gen_ai_input}}\n\ngen_ai_output:\n{{gen_ai_output}}",
"targetType": "llm",
"evalScope": "trace",
"resultType": "boolean",
"resultConfig": {
"values": [
"pass",
"fail"
]
},
"sourceType": "custom",
"targetConfig": {
"agentRuntime": "",
"agentID": "",
"appID": "support_assistant",
"appName": "",
"language": "zh",
"promptOrigin": "custom",
"selectedInputFields": [
"gen_ai_input",
"gen_ai_output"
],
"generationDescription": ""
},
"status": "disabled",
"samplingRate": 20,
"dailyCallLimit": 10000,
"timeoutSeconds": 30,
"maxRetries": 2,
"publishedAt": 1795226400,
"lastScanAt": 1795226400000,
"createAt": 1795226400,
"updateAt": 1795226400,
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "example-trace-id"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | The JSON body is missing status, contains extra fields, or the status type/enum does not match the declaration | Parameter parsing failed | Submit only the status field in the JSON body, with the value enabled or disabled; do not submit configuration or template text through this API. |
| 406 | ft.InvalidParameterV2 | status is invalid; body parameters are included in the URL; when enabling a Schema evaluator from a non-enabled state, the saved Schema contains an invalid non-local or non-Draft 7 reference | The value {} of parameter {} is invalid; for Schema reference failure: OpenAPI Schema evaluation requires valid local Draft 7 references; when URL body parameters are rejected: Send evaluator parameters in the JSON request body. |
Use only enabled or disabled for the status value, and remove URL body parameters. If the saved Schema reference is invalid, first fix schemaConfig through the update API, then enable it again. |
| 404 | ft.ObjectNotExists | The target evaluator does not exist, belongs to another workspace, or is a system built-in evaluator | Agent evaluator does not exist | Use the current workspace Key to list custom evaluators and verify content.data[].uuid; do not use UUIDs from other workspaces or system built-in evaluators. |
| 400 | ft.NotEnabledAiRobotServer | When enabling a Prompt evaluator from a non-enabled state, AI capabilities are unavailable in the current workspace | AI service is not enabled or has been disabled | First enable and confirm that the AI service is available in the current workspace in the console. Disabling does not require this check, and repeatedly setting an already enabled status does not trigger the enable check again. |
| 500 | ft.InternalServerError | An unhandled exception occurs while saving database records, writing audit logs, or in another dependency | Internal error | Retain the traceId, read back the target configuration or list to confirm the actual saved state, and then decide whether to retry; do not assume that a failed response means nothing was saved. |