Skip to content

Update or restore a rubric

PATCH/v5/rubrics/{rubric_id}

Update a rubric’s fields, or restore a previously archived rubric.

The request body is a discriminated union. Send {"restore": true} to restore an archived rubric (clearing its archived state); send any other field set (such as title or tags) to update those fields, carrying forward any field not supplied. Both paths are append-only and produce a new version of the rubric rather than mutating the existing row. Updating the fields of an archived rubric is rejected — restore it first. Restoring a rubric that is not archived is a no-op that returns it unchanged without creating a new version.

Path ParametersExpand Collapse
rubric_id: string
Body ParametersJSONExpand Collapse
rubric: object { tags, title } or RestoreRequest { restore }
One of the following:
PartialRubricRequestBase object { tags, title }
tags: optional array of string

The tags associated with the entity

title: optional string

The rubric title

minLength1
RestoreRequest object { restore }
restore: true

Set to true to restore the entity from the database.

ReturnsExpand Collapse
RubricResponse object { id, created_at, created_by, 7 more }
id: string
created_at: string
formatdate-time
created_by: Identity { id, type, object }

The identity that created the entity.

id: string
type: "user" or "service_account"
One of the following:
"user"
"service_account"
object: optional "identity"
tags: array of string

The tags associated with the entity

title: string
version: number
archived_at: optional string
formatdate-time
criteria: optional array of RubricCriteriaResponse { id, created_at, rubric_id, 5 more } or RubricCriteriaSummaryResponse { title, weight }

Full criteria on get, summary (title + weight) on list

One of the following:
RubricCriteriaResponse object { id, created_at, rubric_id, 5 more }
id: string
created_at: string
formatdate-time
rubric_id: string
title: string
version: number
annotations: optional map[unknown]
object: optional "rubric_criteria"
weight: optional number
RubricCriteriaSummaryResponse object { title, weight }

Slim criteria projection for list endpoints (title + weight only).

title: string
weight: optional number
object: optional "rubric"
updated_at: optional string
formatdate-time

Update or restore a rubric

curl https://api.egp.scale.com/v5/rubrics/$RUBRIC_ID \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $SGP_API_KEY" \
    -d '{
          "tags": [
            "string"
          ],
          "title": "x"
        }'
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "tags": [
    "string"
  ],
  "title": "title",
  "version": 0,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "criteria": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "rubric_id": "rubric_id",
      "title": "title",
      "version": 0,
      "annotations": {
        "foo": "bar"
      },
      "object": "rubric_criteria",
      "weight": 0
    }
  ],
  "object": "rubric",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "tags": [
    "string"
  ],
  "title": "title",
  "version": 0,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "criteria": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "rubric_id": "rubric_id",
      "title": "title",
      "version": 0,
      "annotations": {
        "foo": "bar"
      },
      "object": "rubric_criteria",
      "weight": 0
    }
  ],
  "object": "rubric",
  "updated_at": "2019-12-27T18:11:19.117Z"
}