Update or restore a rubric
client.rubrics.update(stringrubricID, RubricUpdateParams { rubric } params, RequestOptionsoptions?): RubricResponse { id, created_at, created_by, 7 more }
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.
Update or restore a rubric
import SGPClient from 'scale-gp';
const client = new SGPClient({
accountID: 'My Account ID',
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const rubricResponse = await client.rubrics.update('rubric_id', { rubric: {} });
console.log(rubricResponse.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"
}