> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create product

Creates a Product in the Akua-Context Workspace from a published version of one of its Packages. Offers sell the Product at exactly that version. Retry with the same Idempotency-Key to receive the same Product.

`POST https://api.akua.dev/v1/products`

## Authorizations

- `Authorization: Bearer <token>` (BearerAuth): Bearer token for the authenticated caller.

## Headers

- `akua-context` (string): Optional workspace/scope context for the request. Carries a single workspace wire id (`ws_…`) today. Only needed for broad tokens - a workspace-owned token implies its workspace. Required string length: `1 - 53`. Example: `"ws_j572abc123def4"`.
- `idempotency-key` (string): Optional caller-supplied idempotency key. Any non-empty key up to 64 characters is accepted. Endpoint-specific documentation describes how the key is used. Required string length: `1 - 64`. Example: `"create-prod-2026-05-07"`.

## Body

Required.

`application/json`: `CreateProductRequest`

- `name` (string, required): Required string length: `2 - 64`. Example: `"PostgreSQL Managed"`.
- `package_id` (string, required): A Package of the Akua-Context Workspace. Required string length: `1 - 54`. Example: `"pkg_j572abc123def456"`.
- `package_version` (string, required): The published Package version the Product offers. Offers made for the Product install exactly this version. Required string length: `1 - 128`. Pattern: `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$`. Example: `"1.2.3"`.
- `description` (string): Maximum string length: `500`.
- `support_email` (string<email>): Shown to customers on Offer pages when they need help. Maximum string length: `254`. Pattern: `^[^\s@]+@[^\s@]+$`.

## Response

### 201: Product created

`application/json`: `ProductResource`

- `id` (string, required): Required string length: `1 - 55`. Example: `"prod_j572abc123def456"`.
- `html_url` (string<uri>, required): Absolute dashboard URL for this resource. OUTPUT_ONLY. Maximum string length: `2048`.
- `workspace_id` (string, required): Required string length: `1 - 53`.
- `name` (string, required)
- `description` (string | null, required)
- `support_email` (string | null, required)
- `package` (object, required): The Package version the Product is pinned to.
  - `id` (string, required): Required string length: `1 - 54`.
  - `version` (string, required)
  - `version_id` (string, required): Required string length: `1 - 55`.
- `status` (enum<string>, required): Available options: `"active"`, `"archived"`.
- `created_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
- `etag` (string, required)

### 400: The request is malformed.

`application/json`: `ApiBadRequest`

- `_tag` (enum<string>, required): Available options: `"Validation"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 401: Missing, invalid or expired credential.

`application/json`: `ApiUnauthorized`

- `_tag` (enum<string>, required): Available options: `"Unauthorized"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 403: The credential may not act in this workspace.

`application/json`: `ApiForbidden`

- `_tag` (enum<string>, required): Available options: `"Forbidden"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 404: The resource was not found in this workspace.

`application/json`: `ApiNotFound`

- `_tag` (enum<string>, required): Available options: `"NotFound"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 409: The request conflicts with existing resource state or immutable intent.

`application/json`: `ApiConflict`

- `_tag` (enum<string>, required): Available options: `"Conflict"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 422: The request is well-formed but cannot be processed.

`application/json`: `ApiUnprocessable`

- `_tag` (enum<string>, required): Available options: `"Unprocessable"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

## Example request

```bash
curl --request POST \
  --url 'https://api.akua.dev/v1/products' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "PostgreSQL Managed",
    "package_id": "pkg_j572abc123def456",
    "package_version": "1.2.3",
    "description": "<string>",
    "support_email": "user@example.com"
  }'
```

## Example response

`201` `application/json`

```json
{
  "id": "prod_j572abc123def456",
  "html_url": "https://example.com",
  "workspace_id": "ws_j572abc123def456",
  "name": "<string>",
  "description": "<string>",
  "support_email": "<string>",
  "package": {
    "id": "prod_j572abc123def456",
    "version": "<string>",
    "version_id": "secv_j572abc123def456"
  },
  "status": "active",
  "created_at": 123,
  "etag": "<string>"
}
```
