# Change a tier

> Changes the fields sent and leaves the rest. Every workspace on the tier gets the new limits, and any workspace whose balance cap is turned on from none has its cap reset.

Source: https://docs.spicrawl.com/api-reference/partner/partner-tier-update

## PATCH /v1/partner/tiers/{tier_id}

Operation ID: `partnerTierUpdate`. API key scope: `partner`.

Changes the fields sent and leaves the rest. Every workspace on the tier gets the new limits, and any
workspace whose balance cap is turned on from none has its cap reset. Changes reach requests within about 60 seconds.
`"default": true` makes this tier the default; `false` is `400`. A duplicate name is `409`.

### Example

```bash
curl -X PATCH "https://api.spicrawl.com/v1/partner/tiers/{tier_id}" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY"
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `tier_id` | path | string | yes | The tier's id, from the list or the create response. |

### Request body

`application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | no |  |
| `requests_per_minute` | integer | no |  |
| `concurrency` | integer | no |  |
| `free_credits` | integer | no |  |
| `wallet_cap` | integer | no |  |
| `default` | boolean: `true` | no |  |

### Responses

#### 200

The tier after the change.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Spicrawl's id for the tier. |
| `name` | string | yes | Unique among the partner's tiers, ignoring case. |
| `requests_per_minute` | integer | yes | Requests per minute a user may make to scrape, and cloud browser sessions a user may start. Cannot exceed the partner's ceiling (60 times its requests per second). |
| `concurrency` | integer | yes | Requests and browser sessions a user may run at once. Cannot exceed the partner's concurrency limit. |
| `free_credits` | integer | yes | Free credits per user per month, in whole credits. Cannot exceed the free credits Spicrawl grants the partner per workspace. |
| `wallet_cap` | integer | yes | Most credits per user per month the user may draw from the partner's balance. `null` means the tier sets no cap; a partner default then applies. |
| `default` | boolean | yes | True on the one tier new workspaces start on. |
| `workspaces` | integer | yes | Live workspaces on this tier. |
| `created_at` | string (date-time) | yes |  |
| `updated_at` | string (date-time) | yes |  |

#### 400

The request is invalid. Not retryable; fix the request using `code` and `diagnostics.hint`.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 404

No such resource for this key's organization.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 409

Conflicts with the resource's current state, for example a session in use (`ERR::SESSION::BUSY`, retryable).

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
