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

# Update a feature

> Update a feature name and credit cost using the complete editable body.

Updates the active feature named by the URL `id`. Send the complete editable body with `name` and a positive integer `creditCost`. The response contains the current `item`; `changed: false` means the submitted values already matched it.

The new cost applies to future [Check credits](https://docs.integrateledger.com/api-reference/usage/check.md) and [Record usage](https://docs.integrateledger.com/api-reference/usage/track.md) calls. Previously recorded charges do not change. An unknown or archived feature returns `404 not_found`; invalid names or costs return `400 invalid_request`. See [Catalog](https://docs.integrateledger.com/catalog.md) for managing feature IDs.


## OpenAPI

````yaml openapi.json PUT /v1/features/{id}
openapi: 3.1.0
info:
  title: Ledger API
  version: 0.1.0
servers:
  - url: https://api.integrateledger.com
    description: Hosted Ledger API
security: []
paths:
  /v1/features/{id}:
    put:
      tags:
        - Features
      summary: Update a feature
      operationId: updateFeature
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            pattern: ^[a-zA-Z0-9_-]+$
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFeatureInput'
      responses:
        '200':
          description: Feature updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureMutation'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Invalid Ledger API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Item not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '409':
          description: Item ID already exists or add-on Checkout is pending
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl --request PUT
            'https://api.integrateledger.com/v1/features/api_call' \
              -H "Authorization: Bearer $LEDGER_API_KEY" \
              -H 'Content-Type: application/json' \
              --data '{"name":"API call","creditCost":2}'
        - lang: python
          label: Python SDK (source only)
          source: |-
            import os
            from ledger_sdk import Ledger

            ledger = Ledger(api_key=os.environ["LEDGER_API_KEY"])
            ledger.update_feature("api_call", name="API call", credit_cost=2)
        - lang: typescript
          label: TypeScript SDK (source only)
          source: >-
            import { Ledger } from "@ledger/sdk";


            const ledger = new Ledger({ apiKey: process.env.LEDGER_API_KEY ?? ""
            });

            await ledger.updateFeature({ id: "api_call", body: { name: "API
            call", creditCost: 2 } });
components:
  schemas:
    UpdateFeatureInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        creditCost:
          type: integer
          exclusiveMinimum: 0
          maximum: 2147483647
      required:
        - name
        - creditCost
      additionalProperties: false
    FeatureMutation:
      type: object
      properties:
        item:
          $ref: '#/components/schemas/FeatureItem'
        changed:
          type: boolean
      required:
        - item
        - changed
    FeatureItem:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^[a-zA-Z0-9_-]+$
        name:
          type: string
          minLength: 1
          maxLength: 120
        creditCost:
          type: integer
          exclusiveMinimum: 0
          maximum: 2147483647
      required:
        - id
        - name
        - creditCost
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.