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

# Duplicate Plan

> Create a copy of an existing pricing plan

Creates a duplicate of an existing plan, copying all of its feature assignments. The new plan gets a default name of `"Original Name (Copy)"` unless you specify a custom name.

## Endpoint

```
POST /api/v1/projects/{slug}/plans/{planId}/duplicate
```

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key. Requires `read_write` permission.
</ParamField>

## Path Parameters

<ParamField path="slug" type="string" required>
  The project's URL-friendly slug identifier.
</ParamField>

<ParamField path="planId" type="number" required>
  The ID of the plan to duplicate.
</ParamField>

## Body Parameters

<ParamField body="name" type="string">
  Name for the duplicated plan. Defaults to `"Original Name (Copy)"` if not provided.
</ParamField>

## Response

Returns the newly created plan object with status `201 Created`, including all copied feature assignments.

## Example — Default Name

```bash theme={null}
curl -X POST https://cuprice.io/api/v1/projects/my-saas-app/plans/201/duplicate \
  -H "Authorization: Bearer cpk_your_key_here"
```

```json theme={null}
{
  "id": 210,
  "name": "Pro (Copy)",
  "description": "For growing teams",
  "basePrice": 29,
  "isPopular": false,
  "isVisible": true,
  "isFree": false,
  "planFeatures": [
    {
      "id": 320,
      "multiplier": 5,
      "feature": {
        "id": 101,
        "name": "AI Prompts",
        "featureType": "Limits",
        "basePrice": 10
      }
    },
    {
      "id": 321,
      "multiplier": 1,
      "feature": {
        "id": 102,
        "name": "Team Members",
        "featureType": "Standart",
        "basePrice": 5
      }
    },
    {
      "id": 322,
      "multiplier": 1,
      "feature": {
        "id": 104,
        "name": "Priority Support",
        "featureType": "Standart",
        "basePrice": 20
      }
    }
  ],
  "createdAt": "2025-12-10T15:00:00.000Z",
  "updatedAt": "2025-12-10T15:00:00.000Z"
}
```

## Example — Custom Name

```bash theme={null}
curl -X POST https://cuprice.io/api/v1/projects/my-saas-app/plans/201/duplicate \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Pro Annual"
  }'
```

```json theme={null}
{
  "id": 211,
  "name": "Pro Annual",
  "description": "For growing teams",
  "basePrice": 29,
  "isPopular": false,
  "isVisible": true,
  "isFree": false,
  "planFeatures": [
    {
      "id": 325,
      "multiplier": 5,
      "feature": {
        "id": 101,
        "name": "AI Prompts",
        "featureType": "Limits",
        "basePrice": 10
      }
    },
    {
      "id": 326,
      "multiplier": 1,
      "feature": {
        "id": 102,
        "name": "Team Members",
        "featureType": "Standart",
        "basePrice": 5
      }
    }
  ],
  "createdAt": "2025-12-10T15:05:00.000Z",
  "updatedAt": "2025-12-10T15:05:00.000Z"
}
```

## Errors

| Status | Description                                   |
| ------ | --------------------------------------------- |
| `401`  | Invalid or missing API key                    |
| `403`  | API key does not have `read_write` permission |
| `404`  | Project or plan not found                     |
