# Update a Diamond

`PATCH https://api.cademi.com.br/api/v3/automations/diamond/{diamond_id}`

Operation ID: `diamonds.update` · API v3

Updates the name, status, or stage intervals of a Diamond. Stage intervals can be updated partially.

Updating `status` also requires the `diamonds.activate` permission.

Interval changes apply to future scheduling; communications already scheduled for leads are not affected.

Send the current `ETag` in the `If-Match` header to avoid overwriting a newer version.

Required permissions: `diamonds.update`, `diamonds.activate`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `diamond_id` | path | string | yes |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | no |  |
| `settings` | object | no |  |
| `status` | string, one of `active`, `inactive` | no |  |

## Responses

### 200

Returns the updated Diamond.

Body: `data`: Diamond.

Fields of Diamond:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `deleted` | boolean | yes |  |
| `delivery_id` | string or null | yes | Public ID of the Diamond's internal delivery, prefixed with dlv_. |
| `id` | string | yes | Public ID of the Diamond, prefixed with dmd_. |
| `lesson_ids` | array of string | yes | Public IDs of the Diamond's three lessons, in order. |
| `memberships_count` | integer | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `diamond` | yes |  |
| `product_id` | string or null | yes | Public ID of the Diamond's product, prefixed with prd_. |
| `revision` | string | yes |  |
| `settings` | object | yes |  |
| `showcase_id` | string or null | yes | Public ID of the source showcase, prefixed with shw_. |
| `status` | string, one of `active`, `inactive` | yes |  |
| `type` | string, one of `diamond` | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The Diamond was not found or is not accessible with the current credentials.

Body: Error.

### 409

Diamond automations are not enabled for the current account.

Body: Error.

### 412

The resource has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
