Skip to main content
Updates an existing feature. Only the fields you include in the request body will be changed — all other fields remain untouched.

Endpoint

PUT /api/v1/projects/{slug}/features/{featureId}

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.
featureId
number
required
The feature’s unique ID.

Body Parameters

All fields are optional. Only provided fields are updated.
name
string
Feature display name.
description
string
Description of the feature.
basePrice
number
Base price for this feature. Must be >= 0.
isCountable
boolean
Whether this feature tracks usage or has limits.
featureType
string
One of "Standart", "Limits", or "Usage Based".
usageCount
number
Default usage count or limit value.
condition
string
Condition label (e.g. "Up to", "Unlimited").
countPrice
number
Price per unit of usage.
eventAggregationMethod
string
How usage events are aggregated (e.g. "count", "sum").

Response

Returns the full updated feature object.

Example

curl -X PUT https://cuprice.io/api/v1/projects/my-saas-app/features/101 \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "AI Prompts (v2)",
    "basePrice": 12,
    "usageCount": 1000,
    "countPrice": 0.015
  }'
{
  "id": 101,
  "name": "AI Prompts (v2)",
  "description": "Monthly AI prompt allowance",
  "basePrice": 12,
  "featureType": "Limits",
  "isCountable": true,
  "countableData": {
    "usageCount": 1000,
    "condition": "Up to",
    "countPrice": 0.015,
    "eventAggregationMethod": "count"
  },
  "createdAt": "2025-09-15T10:35:00.000Z",
  "updatedAt": "2025-12-05T11:20:00.000Z"
}

Errors

StatusDescription
400Invalid field value (e.g. negative basePrice)
401Invalid or missing API key
403API key does not have read_write permission
404Project or feature not found