## Create a rubric

`client.rubrics.create(RubricCreateParamsbody, RequestOptionsoptions?): RubricResponse`

**post** `/v5/rubrics`

Create a rubric, optionally with its initial criteria in the same request.

The rubric is created for the caller's account at version 1. If the optional
`criteria` field is supplied it must contain at least one entry, and each
entry is created as a criterion attached to the new rubric; omit it to create
an empty rubric and add criteria later via the criteria endpoint. The response
returns the created rubric together with the full detail of any criteria
created in this call.

### Parameters

- `body: RubricCreateParams`

  - `title: string`

    The rubric title

  - `criteria?: Array<RubricCriteriaInput>`

    Initial criteria to create with the rubric

    - `title: string`

      The Criteria text

    - `annotations?: Record<string, unknown>`

      Free-form metadata for the Criteria

    - `weight?: number`

      Weight multiplier for scoring

  - `tags?: Array<string>`

    The tags associated with the entity

### Returns

- `RubricResponse`

  - `id: string`

  - `created_at: string`

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `tags: Array<string> | null`

    The tags associated with the entity

  - `title: string`

  - `version: number`

  - `archived_at?: string`

  - `criteria?: Array<RubricCriteriaResponse | RubricCriteriaSummaryResponse>`

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

    - `RubricCriteriaResponse`

      - `id: string`

      - `created_at: string`

      - `rubric_id: string`

      - `title: string`

      - `version: number`

      - `annotations?: Record<string, unknown>`

      - `object?: "rubric_criteria"`

        - `"rubric_criteria"`

      - `weight?: number`

    - `RubricCriteriaSummaryResponse`

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

      - `title: string`

      - `weight?: number`

  - `object?: "rubric"`

    - `"rubric"`

  - `updated_at?: string`

### Example

```typescript
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.create({ title: 'x' });

console.log(rubricResponse.id);
```

#### Response

```json
{
  "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"
}
```
