# Apply a configuration plan

`POST https://api.cademi.com.br/api/v3/configuration/applications`

Operation ID: `configuration.applications.create` · API v3

Applies a configuration plan previously returned by the plan operation. Submit the plan's `id` as `plan_id`, together with its `signature` and `steps`.

Before accepting the request, the API verifies that the plan is still valid, that its signature matches the submitted steps, and that none of the affected resources has changed since the plan was calculated. A plan can only be applied with the same credentials used to create it, and only once.

The plan is applied asynchronously. The response returns an operation, and the `Location` header points to it so you can track progress.

Steps are not applied as a single transaction: if a step fails, steps that were already applied remain in effect.

Required permissions: `configuration.apply`.

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `plan_id` | string | yes |  |
| `signature` | string | yes | The signature value returned with the plan. |
| `steps` | array of object | yes | The plan steps exactly as returned with the plan. Write-only values appear as "***" in the plan; replace them with the actual values before submitting. This replacement does not invalidate the signature. |

## Responses

### 202

The plan was accepted for asynchronous processing. Returns the operation that tracks its application.

Body: `data`: Operation.

Fields of Operation:

| Field | Type | Required | Description |
|---|---|---|---|
| `attempt` | object or null | yes |  |
| `cancellation_requested` | boolean | yes |  |
| `created_at` | string (date-time) | yes |  |
| `error` | object or null | yes |  |
| `expires_at` | string (date-time) | yes |  |
| `finished_at` | string or null (date-time) | yes |  |
| `id` | string | yes | Public ID, with the op_ prefix. |
| `items_url` | string | yes |  |
| `object` | string, one of `operation` | yes |  |
| `progress` | object | yes |  |
| `result_url` | string or null | yes |  |
| `started_at` | string or null (date-time) | yes |  |
| `status` | string, one of `queued`, `running`, `succeeded`, `partially_succeeded`, `failed`, `canceled` | yes |  |
| `type` | string | yes | Type of the operation, from a fixed set of values. |

### 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 plan was not found or is not accessible with the current credentials.

Body: Error.

### 409

The plan can no longer be applied. Returns planexpired when the plan has expired or was already applied, and planstale when an affected resource has changed since the plan was calculated. In both cases, calculate a new plan.

Body: Error.

### 422

The signature does not match the submitted plan, or a step was modified (plan_invalid).

Body: Error.

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