Skip to main content
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

Authorization
string
required
Bearer token with your API key. Requires read_write permission.

Path Parameters

slug
string
required
The project’s URL-friendly slug identifier.
planId
number
required
The ID of the plan to duplicate.

Body Parameters

name
string
Name for the duplicated plan. Defaults to "Original Name (Copy)" if not provided.

Response

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

Example — Default Name

curl -X POST https://cuprice.io/api/v1/projects/my-saas-app/plans/201/duplicate \
  -H "Authorization: Bearer cpk_your_key_here"
{
  "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

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"
  }'
{
  "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

StatusDescription
401Invalid or missing API key
403API key does not have read_write permission
404Project or plan not found