# Update Automation Rule Evaluator by id

PATCH http://localhost:5173/api/v1/private/automations/evaluators/{id}
Content-Type: application/json

Update Automation Rule Evaluator by id

Reference: https://www.comet.com/docs/opik/reference/rest-api/automation-rule-evaluators/update-automation-rule-evaluator

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Update Automation Rule Evaluator by id
  version: endpoint_automationRuleEvaluators.updateAutomationRuleEvaluator
paths:
  /v1/private/automations/evaluators/{id}:
    patch:
      operationId: update-automation-rule-evaluator
      summary: Update Automation Rule Evaluator by id
      description: Update Automation Rule Evaluator by id
      tags:
        - - subpackage_automationRuleEvaluators
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No content
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Automation rule
                  evaluators_updateAutomationRuleEvaluator_Response_204
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationRuleEvaluatorUpdate'
components:
  schemas:
    AutomationRuleEvaluatorUpdateType:
      type: string
      enum:
        - value: llm_as_judge
        - value: user_defined_metric_python
        - value: trace_thread_llm_as_judge
        - value: trace_thread_user_defined_metric_python
        - value: span_llm_as_judge
        - value: span_user_defined_metric_python
    AutomationRuleEvaluatorUpdateAction:
      type: string
      enum:
        - value: evaluator
    AutomationRuleEvaluatorUpdate:
      type: object
      properties:
        name:
          type: string
        sampling_rate:
          type: number
          format: double
        enabled:
          type: boolean
        project_id:
          type: string
          format: uuid
          description: >-
            Primary project ID (legacy field, maintained for backwards
            compatibility)
        project_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Multiple project IDs (new field for multi-project support)
        type:
          $ref: '#/components/schemas/AutomationRuleEvaluatorUpdateType'
        action:
          $ref: '#/components/schemas/AutomationRuleEvaluatorUpdateAction'
      required:
        - name
        - action
    Automation rule evaluators_updateAutomationRuleEvaluator_Response_204:
      type: object
      properties: {}

```

## SDK Code Examples

```python
import requests

url = "http://localhost:5173/api/v1/private/automations/evaluators/id"

payload = {
    "name": "string",
    "action": "evaluator"
}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:5173/api/v1/private/automations/evaluators/id';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"string","action":"evaluator"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:5173/api/v1/private/automations/evaluators/id"

	payload := strings.NewReader("{\n  \"name\": \"string\",\n  \"action\": \"evaluator\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:5173/api/v1/private/automations/evaluators/id")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"string\",\n  \"action\": \"evaluator\"\n}"

response = http.request(request)
puts response.read_body
```

```java
HttpResponse<String> response = Unirest.patch("http://localhost:5173/api/v1/private/automations/evaluators/id")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"string\",\n  \"action\": \"evaluator\"\n}")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'http://localhost:5173/api/v1/private/automations/evaluators/id', [
  'body' => '{
  "name": "string",
  "action": "evaluator"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
var client = new RestClient("http://localhost:5173/api/v1/private/automations/evaluators/id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"string\",\n  \"action\": \"evaluator\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "name": "string",
  "action": "evaluator"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5173/api/v1/private/automations/evaluators/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```