Skip to content

Update or restore a rubric

rubrics.update(strrubric_id, RubricUpdateParams**kwargs) -> RubricResponse
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.

ParametersExpand Collapse
rubric_id: str
rubric: Rubric
One of the following:
class RubricPartialRubricRequestBase: …
tags: Optional[Sequence[str]]

The tags associated with the entity

title: Optional[str]

The rubric title

minLength1
class RestoreRequest: …
restore: Literal[true]

Set to true to restore the entity from the database.

ReturnsExpand Collapse
class RubricResponse: …
id: str
created_at: datetime
formatdate-time
created_by: Identity

The identity that created the entity.

id: str
type: Literal["user", "service_account"]
One of the following:
"user"
"service_account"
object: Optional[Literal["identity"]]
tags: Optional[List[str]]

The tags associated with the entity

title: str
version: int
archived_at: Optional[datetime]
formatdate-time
criteria: Optional[List[Criterion]]

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

One of the following:
class RubricCriteriaResponse: …
id: str
created_at: datetime
formatdate-time
rubric_id: str
title: str
version: int
annotations: Optional[Dict[str, object]]
object: Optional[Literal["rubric_criteria"]]
weight: Optional[float]
class RubricCriteriaSummaryResponse: …

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

title: str
weight: Optional[float]
object: Optional[Literal["rubric"]]
updated_at: Optional[datetime]
formatdate-time

Update or restore a rubric

import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
rubric_response = client.rubrics.update(
    rubric_id="rubric_id",
    rubric={},
)
print(rubric_response.id)
{
  "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"
}