# Update a stage

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

Operation ID: `diamonds.stages.update` · API v3

Updates the waiting interval of a time-based stage. Only time-based stages accept an interval, and only the supported interval values are accepted.

The change applies to future scheduling; communications already scheduled for leads are not affected.

Stages share the Diamond's revision: send the Diamond's current `ETag` in the `If-Match` header to avoid overwriting a newer version.

Required permissions: `diamonds.update`.

## Parameters

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

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `interval_minutes` | integer | yes |  |

## Responses

### 200

Returns the updated stage.

Body: `data`: Stage.

Fields of Stage:

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string, one of `lead`, `class_1_not_initiated`, `class_1_concluded`, `class_2_not_initiated`, `class_2_concluded`, `class_3_not_initiated`, `class_3_concluded`, `checkout_not_initiated`, `checkout_initiated`, `checkout_abandoned`, `won` | yes |  |
| `interval_minutes` | integer or null | yes | Wait time in minutes, or null for stages that are not scheduled. |
| `kind` | string, one of `lead`, `class`, `checkout`, `won` | yes |  |
| `lesson_id` | string or null | yes | Public ID of the stage lesson, with the les_ prefix, or null for stages that are not tied to a lesson. |
| `memberships_count` | integer | yes |  |
| `object` | string, one of `stage` | yes |  |
| `position` | integer | yes | Position of the stage in the Diamond sequence, from 0 to 10. |
| `trigger_id` | string or null | yes | Public ID of the stage trigger, with the trg_ prefix. |

### 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 or the stage 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
