# Create a tier

`POST https://evohub.io/api/v1/catalog/tiers`

Part of the [Catalog API](https://docs.evohub.io/catalog.md) reference · operationId `createTier`.

Adds a tier, last in the order. An organization may have at most 50
tiers in use.

Requires the `catalog:component:write` scope.

## Authorization

Any one of:

- `bearerKey`
- `headerKey`

Where:

- `bearerKey`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `headerKey`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Request body (required)

Content type: `application/json`

Type: `TierRequest`

- `name` (string, max length 60)
- `description` (string, max length 1000)
- `color` (string): Empty, or a hex colour such as `#d97706`.
- `targets` (SLATargets)
  - `availability` (number, example `99.9`): A percentage above 0 and at most 100, up to 3 decimals.
  - `response` (object): Minutes to acknowledge, per On-Call severity (`critical`, `high`, `medium`, `low`, `info`), 1 to 525600.
    - Other keys: integer
  - `resolution` (object): Minutes to resolve, per severity.
    - Other keys: integer
  - `support_hours` (object)
    - `kind` (string, required, one of `24x7`, `business`)
    - `timezone` (string, example `Europe/Istanbul`)
    - `days` (array of integer): ISO weekdays, 1 is Monday.
    - `from` (string, example `09:00`)
    - `to` (string, example `18:00`)
  - `max_unowned_days` (integer, min 0, max 3650)

## Responses

### 201 — The tier.

Content type: `application/json`

Type: `object`

- `data` (Tier)
  - `id` (string)
  - `name` (string, example `Tier 1`)
  - `description` (string)
  - `rank` (integer): Its place in the order, 1 the most critical.
  - `color` (string, example `#d97706`)
  - `targets` (SLATargets)
    - `availability` (number, example `99.9`): A percentage above 0 and at most 100, up to 3 decimals.
    - `response` (object): Minutes to acknowledge, per On-Call severity (`critical`, `high`, `medium`, `low`, `info`), 1 to 525600.
      - Other keys: integer
    - `resolution` (object): Minutes to resolve, per severity.
      - Other keys: integer
    - `support_hours` (object)
      - `kind` (string, required, one of `24x7`, `business`)
      - `timezone` (string, example `Europe/Istanbul`)
      - `days` (array of integer): ISO weekdays, 1 is Monday.
      - `from` (string, example `09:00`)
      - `to` (string, example `18:00`)
    - `max_unowned_days` (integer, min 0, max 3650)
  - `version` (integer)
  - `archived_at` (string (date-time) | null)
  - `services` (integer): How many services are in it.
  - `created_at` (string (date-time))
  - `updated_at` (string (date-time))

### 400 — The request is not valid: a field or filter value is wrong (`VALIDATION_ERROR`, with a sentence saying what), the body is not the expected JSON or carries an unknown field (`INVALID_BODY`), the cursor is not one this list gave (`INVALID_CURSOR`), a binding names a service that does not exist (`UNKNOWN_COMPONENT`), or a `PATCH` tries to change a slug (`SLUG_IMMUTABLE`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 403 — The key lacks a scope this endpoint needs (`FORBIDDEN`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 409 — Another tier already has this name (`TIER_NAME_TAKEN`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 429 — Too many requests (`RATE_LIMITED`). Wait for `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

## Example request

```bash
curl -X POST 'https://evohub.io/api/v1/catalog/tiers' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "name": "Customer facing",
  "color": "#d97706",
  "targets": {
    "response": {
      "high": 60,
      "critical": 15
    },
    "resolution": {
      "critical": 240
    },
    "availability": 99.9,
    "support_hours": {
      "kind": "24x7"
    },
    "max_unowned_days": 7
  },
  "description": "Anything a customer sees or pays through"
}'
```
