# Create a product

`POST https://api.cademi.com.br/api/v3/products`

Operation ID: `products.create` · API v3

Creates a product in the given showcase. New products are created with the `draft` status.

`external_id` must be unique among the account's products that are not in the trash; a duplicate value returns the `already_exists` error code.

Required permissions: `products.create`.

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `external_id` | string or null | no |  |
| `format` | string, one of `course`, `flix`, `blog`, `link`, `alias` | yes |  |
| `name` | string | yes |  |
| `position` | integer | no |  |
| `showcase_id` | string | yes |  |

## Responses

### 201

Returns the newly created product.

Body: `data`: Product.

Fields of Product:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `definitions` | object | yes | Product definitions. Only aliasproductid is supported; an empty object unless the product uses the alias format. |
| `deleted` | boolean | yes |  |
| `display` | object | yes | Display options. Only hidemodulebar and show_progress are supported; an empty object when no options have been defined. |
| `external_id` | string or null | no |  |
| `format` | string, one of `course`, `flix`, `blog`, `link`, `alias` | yes |  |
| `id` | string | yes | Public ID, with the prd_ prefix. |
| `image` | string or null | yes |  |
| `lessons_count` | integer | yes |  |
| `modules_count` | integer | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `product` | yes |  |
| `offer` | object | no | Offer details of the product. Included only when the credentials have the products.read_offer permission. |
| `position` | integer | yes |  |
| `revision` | string | yes |  |
| `showcase_id` | string | yes | Public ID, with the shw_ prefix. |
| `status` | string, one of `published`, `draft`, `unlisted`, `hidden` | 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

Another product in the account already uses this external_id.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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