Skip to contentSkip to page list

Docs

Create a new evaluator

Create a new evaluator: a built-in one, a custom code evaluator (type: "code") or one that wraps a workflow (type: "workflow")

POST/api/v1/evaluators
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/evaluators"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}payload = {}​response = requests.post(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "id": "string",  "projectId": "string",  "name": "string",  "slug": "string",  "type": "string",  "config": {},  "workflowId": "string",  "copiedFromEvaluatorId": "string",  "createdAt": "2026-01-01T00:00:00Z",  "updatedAt": "2026-01-01T00:00:00Z",  "fields": [    {      "identifier": "string",      "type": "string",      "optional": false    }  ],  "outputFields": [    {      "identifier": "string",      "type": "string",      "optional": false    }  ],  "workflowName": "string",  "workflowIcon": "string",  "version": 0,  "labels": [    {      "label": "string",      "version": 0    }  ],  "createdBy": {    "id": "string",    "name": "string"  },  "updatedBy": {    "id": "string",    "name": "string"  },  "platformUrl": "string"}
api-reference/evaluators-config/create-evaluators

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Request body

application/json · Required

namestringrequired
At least 1 characterUp to 255 characters
typestring

The kind of evaluator. "evaluator" (the default) is a built-in type named by config.evaluatorType; "code" is a custom Python evaluator whose config carries code and inputs; "workflow" wraps the workflow named by workflowId.

One of"evaluator""code""workflow"
Default: "evaluator"
configobjectrequired

For a built-in evaluator: { evaluatorType, settings }. For a code evaluator: { code, inputs: [{ identifier, type }] }; outputs are the fixed passed, score, label and details. For a workflow evaluator: {}.

workflowIdstring

The workflow a "workflow" evaluator wraps. Only for type "workflow".

At least 1 character

Responses

200

Success

application/json

idstringrequired
projectIdstringrequired
namestringrequired
slugstring | nullrequired
typestringrequired
configobject | nullrequired
Option 1object
Option 2null
workflowIdstring | nullrequired
copiedFromEvaluatorIdstring | nullrequired
createdAtstring (date-time)required
updatedAtstring (date-time)required
fieldsobject[]required
identifierstringrequired
typestringrequired
optionalboolean
outputFieldsobject[]required
identifierstringrequired
typestringrequired
optionalboolean
workflowNamestring
workflowIconstring
versioninteger | nullrequired

The version this response shows: the latest, unless a label or a version was asked for.

Option 1integer
Option 2null
labelsobject[]required

The deploy labels the evaluator carries, such as production, and the version each points at.

labelstringrequired
versionintegerrequired
Maximum 9007199254740991
createdByobject | nullrequired

The user who created the evaluator. Null when an API key created it, or it predates creators being recorded.

Option 1object
idstringrequired
namestring | nullrequired
Option 2null
updatedByobject | nullrequired

The user who changed the evaluator last. Null when an API key changed it.

Option 1object
idstringrequired
namestring | nullrequired
Option 2null
platformUrlstring (uri)required

Documentation