Skip to content

Create a judge class

POST
/v1/judge-classes
curl --request POST \
--url https://example.com/v1/judge-classes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "scope": { "kind": "tenant" }, "name": "example", "weight": 1, "description": "example", "assertableBy": { "minReviewerRole": "standard", "principalKinds": [ "user" ], "principalIds": [ "example" ] } }'

A named kind of judge with a weight, scoped to the tenant, a project, or an agent in a project. Names are unique among the live classes of a scope. Needs admin on the tenant (tenant scope) or the project.

Idempotency-Key
string
>= 1 characters

Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the tenant is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5).

Media typeapplication/json
object
scope
required
One of:
object
kind
required
string
Allowed value: tenant
name
required
string
>= 1 characters <= 100 characters
weight
required
number
description
string
assertableBy

Who may assert the class: every part that is set must hold. A class with one is restricted: a judgment recorded while it is carries restricted, and a comparison weighted restricted-only counts only those.

object
>= 1 properties
minReviewerRole

The caller’s reviewer role is at least this (its token’s, or the roster’s).

string
Allowed values: standard senior admin
principalKinds

Users, service tokens, or both.

Array<string>
>= 1 items
Allowed values: user service
principalIds

Only these principals: user ids, or service token ids.

Array<string>
>= 1 items <= 100 items

Judge class created.

Media typeapplication/json
object
id
required
string
tenantId
required
string
scope
required
One of:
object
kind
required
string
Allowed value: tenant
name
required

The deployment’s own word for the class: “expert”, “user”, “arbitrator”.

string
weight
required

How much a judgment of this class counts, relative to the others.

number
description
string
assertableBy

Who may assert the class, as the caller sees it: every part that is set must hold. principalIds is sent only to an admin on the class’s scope; principalCount to everyone who reads it.

object
>= 1 properties
minReviewerRole

The caller’s reviewer role is at least this (its token’s, or the roster’s).

string
Allowed values: standard senior admin
principalKinds

Users, service tokens, or both.

Array<string>
>= 1 items
Allowed values: user service
principalIds

Only these principals: user ids, or service token ids. Sent only to an admin on the class’s scope.

Array<string>
>= 1 items <= 100 items
principalCount

How many principals the class is restricted to (principalIds), for every reader. Absent when it names none.

integer
>= 1
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
unregisteredAt

Set when the class was retired.

string format: date-time
Example
{
"scope": {
"kind": "tenant"
},
"assertableBy": {
"minReviewerRole": "standard",
"principalKinds": [
"user"
]
}
}

Malformed request body.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

permission-denied.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

judge-class-name-taken, or an idempotency conflict.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Server error (unmapped domain code or framework crash).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}