# Create a Diamond

`POST https://api.cademi.com.br/api/v3/automations/diamond`

Operation ID: `diamonds.create` · API v3

Creates a Diamond automation from an existing showcase.

The operation also creates the Diamond's product, its three lessons, the internal delivery that grants access to those lessons, and one trigger for each of the eleven stages. Credentials scoped to the showcase can access all of these resources.

In addition to `diamonds.create`, this operation requires the `products.create` and `deliveries.create` permissions.

Required permissions: `diamonds.create`, `products.create`, `deliveries.create`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | yes |  |

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string or null | no |  |
| `showcase_id` | string | yes |  |
| `type` | string, one of `diamond` | no |  |

## Responses

### 201

Returns the newly created 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 showcase 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.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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