Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview

Set judge action groups

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
Authorization
AuthorizationPersonal API key · headerrequired

Your personal API key from Settings > Personal API Keys, sent as Bearer <key>.

X-Organization-IdOrganization ID · headerrequired

The organization to act in. Copy it with Copy organization ID in the organization menu or the settings sidebar.

Path parameters
projectIdstringrequired
judgeIdstring<uuid>required

The judge ID

matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Request body
requiredapplication/json
source_versionobjectrequired
Show properties
majorintegerrequired
min 0 · max 9007199254740991
minorintegerrequired
min 0 · max 9007199254740991
target_versionobjectrequired
Show properties
majorintegerrequired
min 0 · max 9007199254740991
minorintegerrequired
min 0 · max 9007199254740991
promote_to_productionbooleanrequired
action_groupsobject[]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.

Show properties
Array of object
idstringrequired
min length 1
namestringrequired

Action group display name; an empty string uses Action group 1, 2, etc.

enabledbooleanrequired
environment_namesstring[]required

Empty runs the group in every environment

whenobjectrequired

Judge result that runs the group. Categorical groups run when the result is any listed output name.

Show properties
One of:
object
kindstringrequired
object
kindstringrequired
valuebooleanrequired
object
kindstringrequired
valuesstring[]required
min items 1
object
kindstringrequired
operatorstringrequired
Allowed:ltlteeqgtegt
valuenumberrequired
frequencyobjectrequired
Show properties
countintegerrequired
min 1 · max 9007199254740991
window_secondsintegerrequired
min 1 · max 9007199254740991
cooldown_secondsintegerrequired
min 0 · max 9007199254740991
actionsobject[]required
Show properties
Array of object
One of:
object
idstringrequired
min length 1
enabledbooleanrequired
typestringrequired
configobjectrequired
Show properties
urlstringrequired
min length 1
secretstringrequired
min length 1
object
idstringrequired
min length 1
enabledbooleanrequired
typestringrequired
configobjectrequired
Show properties
email_addressstringrequired
min length 1
object
idstringrequired
min length 1
enabledbooleanrequired
typestringrequired
configobjectrequired
Show properties
team_idstring
min length 1
channel_idstring
min length 1
messagestring
custom_attribute_keysstring[]
object
idstringrequired
min length 1
enabledbooleanrequired
typestringrequired
configobjectrequired
Show properties
dataset_idstringrequired
min length 1
object
idstringrequired
min length 1
enabledbooleanrequired
typestringrequired
configobjectrequired
Show properties
judge_idsstring[]required
min items 1
clear_all_action_groupsboolean

Set to true to save an empty action_groups list

Responses
200

Response for status 200

judge_idstringrequired
judge_version_idstring | nullrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.judgmentlabs.ai/v1/projects/YOUR_PROJECT_ID/judges/YOUR_JUDGE_ID/action-groups' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Organization-Id: YOUR_ORGANIZATION_ID' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "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
}'
Response
{
  "judge_id": "string",
  "judge_version_id": "string"
}

Was this page helpful?