---
title: "Update evaluator"
method: PATCH
path: "/api/v1/platform/evaluators/{evaluator_id}"
tags: ["evaluators"]
---

# Update evaluator

`PATCH /api/v1/platform/evaluators/{evaluator_id}`

## Request

- Base URL: `https://api.smith.langchain.com`
- URL: `https://api.smith.langchain.com/api/v1/platform/evaluators/{evaluator_id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-Tenant-Id`
  - HTTP bearer

Update an existing evaluator's name, LLM configuration, or code configuration. Returns 409 when a code evaluator build is ENQUEUED or BUILDING.

## Path parameters

- `evaluator_id` string, required

## Request body

- EvaluatorsUpdateEvaluatorRequest
  - `code_evaluator` EvaluatorsUpdateCodeEvaluatorRequest
    - `advanced_features_enabled` boolean
    - `code` string
    - `code_evaluator_input` 'thread' | 'all_messages' | 'human_ai_pairs' | 'first_human_last_ai' | 'trajectory', nullable: CodeEvaluatorInput is config (not a snapshot rebuild). Null clears it.
    - `dependencies` string, nullable
    - `language` string
    - `managed_code_evaluator_settings` EvaluatorsManagedCodeEvaluatorSettings
    - `require_attachments` boolean: RequireAttachments is fetch-time config: updating it does not rebuild the sandbox snapshot.
    - `workspace_secrets_keys` string[]: WorkspaceSecretsKeys names the workspace secrets this evaluator may use. Each is sent as a header on requests to the hosts allowed for that secret; evaluator code never sees the value. Requires advanced_features_enabled, and each secret needs an allowed host with a header. Omit to keep the current list; [] clears it. Changing it does not rebuild the evaluator.
  - `llm_evaluator` EvaluatorsUpdateLLMEvaluatorRequest
    - `commit_hash_or_tag` string
    - `num_few_shot_examples` integer
    - `playground_settings_id` string: Model Configuration ID
    - `prompt_repo_handle` string
    - `use_corrections_dataset` boolean
    - `variable_mapping` object
  - `name` string

## Response `200`

OK

- EvaluatorsUpdateEvaluatorResponse
  - `evaluator` EvaluatorsEvaluator
    - `code_evaluator` EvaluatorsCodeEvaluator
      - `advanced_features_enabled` boolean
      - `code` string
      - `code_evaluator_input` 'thread' | 'all_messages' | 'human_ai_pairs' | 'first_human_last_ai' | 'trajectory'
      - `dependencies` string
      - `evaluator_build_error` string
      - `evaluator_build_status` 'ENQUEUED' | 'BUILDING' | 'READY' | 'FAILED'
      - `evaluator_id` string
      - `language` string: Default: "python"
      - `managed_code_evaluator_key` 'voice_metrics'
      - `managed_code_evaluator_settings` EvaluatorsManagedCodeEvaluatorSettings
      - `require_attachments` boolean: RequireAttachments opts the evaluator into selecting/presigning run attachments (s3_urls) at evaluation time. Default false.
      - `workspace_secrets_keys` string[]: WorkspaceSecretsKeys names the workspace secrets this evaluator may use. Each is sent as a header on requests to the hosts allowed for that secret; evaluator code never sees the value. Requires advanced_features_enabled, and each secret needs an allowed host with a header.
    - `created_at` string
    - `created_by` string
    - `feedback_keys` string[]
    - `id` string
    - `is_managed` boolean: IsManaged marks a LangChain Tuned Evaluator (currently the tuned Perceived Error judge). NULL in the DB is read as false via COALESCE.
    - `llm_evaluator` EvaluatorsLLMEvaluator
      - `annotation_queue_id` string
      - `commit_hash_or_tag` string
      - `corrections_dataset_id` string
      - `evaluator_id` string
      - `num_few_shot_examples` integer
      - `prompt_id` string
      - `prompt_repo_handle` string
      - `use_corrections_dataset` boolean: Derived from the evaluator's run rules — shared across all rules on this evaluator. Nil when the evaluator has no run rules.
      - `variable_mapping` object: JSONB
    - `name` string
    - `run_rules` EvaluatorsEvaluatorRunRule[]
      - `corrections_dataset_id` string
      - `dataset_id` string
      - `dataset_name` string
      - `group_by` string
      - `id` string
      - `num_few_shot_examples` integer
      - `session_id` string
      - `session_name` string
      - `spend_limit` EvaluatorsSpendLimit
        - `limit_usd` number
        - `utilization_pct` number
        - `window` string
      - `spend_usd` number: Per-rule usage for the current ISO week (omitted when feature is disabled). LLM-evaluator rules are initialized to 0; code-evaluator rules include trace counts only.
      - `trace_count` integer
      - `use_corrections_dataset` boolean
    - `tenant_id` string
    - `type` 'llm' | 'code' | 'decision_model'
    - `updated_at` string

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `500`: Internal Server Error

## Changes

- **2026-10-20** `44d7fe006ac9`: 1 warning
  - added the new `decision_model` enum value to the `evaluator/type` response property for the response status `200`
- **2026-10-16** `ec156df8da3a`: 1 warning, 1 info
  - added the new `trajectory` enum value to the `evaluator/code_evaluator/code_evaluator_input/anyOf[subschema #1]/allOf[#/components/schemas/evaluators.CodeEvaluatorInput]/` response property for the response status `200`
  - added the new `trajectory` enum value to the request property `code_evaluator/code_evaluator_input/anyOf[subschema #1]/`
- **2026-10-16** `1a8ee9358d81`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v1/platform/evaluators/:evaluator_id/patch.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) - [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) - [OpenAPI document](https://skmtc.dev/langchain-ai/apis/langsmith/revisions/7a01c01f75e8?raw)
