> ## 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.

# Update Feature

> Update a feature's properties

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

<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="featureId" type="number" required>
  The feature's unique ID.
</ParamField>

## Body Parameters

All fields are optional. Only provided fields are updated.

<ParamField body="name" type="string">
  Feature display name.
</ParamField>

<ParamField body="description" type="string">
  Description of the feature.
</ParamField>

<ParamField body="basePrice" type="number">
  Base price for this feature. Must be `>= 0`.
</ParamField>

<ParamField body="isCountable" type="boolean">
  Whether this feature tracks usage or has limits.
</ParamField>

<ParamField body="featureType" type="string">
  One of `"Standart"`, `"Limits"`, or `"Usage Based"`.
</ParamField>

<ParamField body="usageCount" type="number">
  Default usage count or limit value.
</ParamField>

<ParamField body="condition" type="string">
  Condition label (e.g. `"Up to"`, `"Unlimited"`).
</ParamField>

<ParamField body="countPrice" type="number">
  Price per unit of usage.
</ParamField>

<ParamField body="eventAggregationMethod" type="string">
  How usage events are aggregated (e.g. `"count"`, `"sum"`).
</ParamField>

## Response

Returns the full updated feature object.

## Example

```bash theme={null}
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
  }'
```

```json theme={null}
{
  "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

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