---
search:
  tags:
    - V1
    - POST
seo:
  description: >-
    Replace the action groups of a judge version by… Reference for the POST
    /v1/projects/{projectId}/judges/{judgeId}/action-groups endpoint in the
    Judgeval API.
sidebar:
  label: Set judge action groups
  badge: POST
title: Set judge action groups
type: openapi-operation
---
Replace the action groups of a judge version by creating a new immutable version that keeps its evaluation method, outputs, and run settings. Call list_judge_action_groups first. IDs survive edits; new or duplicated groups and actions need new UUIDs.

`POST /v1/projects/{projectId}/judges/{judgeId}/action-groups`

**Request body** (`application/json`, required)

- `source_version` (object, required)
- `target_version` (object, required)
- `promote_to_production` (boolean, required)
- `action_groups` (object[], required) — Complete list. Preserve IDs of existing groups and actions; use new UUIDs when adding or duplicating. Omitted groups are removed in the new version.
- `clear_all_action_groups` (boolean) — Set to true to save an empty action\_groups list

Request body example:

```json
{
  "source_version": {
    "major": 0,
    "minor": 0
  },
  "target_version": {
    "major": 0,
    "minor": 0
  },
  "promote_to_production": true,
  "action_groups": [
    {
      "id": "string",
      "name": "string",
      "enabled": true,
      "environment_names": [
        "string"
      ],
      "when": {
        "kind": "any"
      },
      "frequency": {
        "count": 1,
        "window_seconds": 1
      },
      "cooldown_seconds": 0,
      "actions": [
        {
          "id": "string",
          "enabled": true,
          "type": "webhook",
          "config": {
            "url": "string",
            "secret": "string"
          }
        }
      ]
    }
  ],
  "clear_all_action_groups": true
}
```

**Responses**

- `200` — Response for status 200

Response example, 200:

```json
{
  "judge_id": "string",
  "judge_version_id": "string"
}
```
