---
title: "Update a feature credits entry"
method: PATCH
path: "/accounts/{account_id}/features/{feature_id}/entries/{entry_id}"
tags: ["Entitlements"]
---

# Update a feature credits entry

`PATCH /accounts/{account_id}/features/{feature_id}/entries/{entry_id}`

## Request

- Base URL: `https://api.togai.com`
- URL: `https://api.togai.com/accounts/{account_id}/features/{feature_id}/entries/{entry_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/togaihq/apis/togai-apis/docs/accounts/:account_id/features/:feature_id/entries/:entry_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

#### This API let's you to update the following attributes: `effectiveUntil` and `granted`

- **effectiveUntil**: must be in future
- **granted**: must be greater than the existing usage (previous granted - current balance)

## Path parameters

- `account_id` string, required
- `feature_id` string, required
- `entry_id` string, required

## Request body

- UpdateFeatureCreditsRequest
  - `effectiveUntil` string, date-time: Expiry date-time for a feature credits entry
  - `granted` number: Granted units for a feature credits entry

## Response `200`

Success response

- FeatureCreditEntry: Get feature credits response
  - `id` string, required
  - `source` 'ENTITLEMENT' | 'PRICE_PLAN' | 'OVERAGE' | 'REFUND', required: Source of the feature credit
  - `status` 'ACTIVE' | 'EXPIRED' | 'VOIDED', required: Status of the feature credit entry
  - `effectiveFrom` string, date-time, required
  - `effectiveUntil` string, date-time, required
  - `granted` number
  - `balance` number
  - `used` number, required

## Other responses

- `400`: Bad request. Please check the response message for failure details.
- `401`: Credential is not valid. Please check the response message for failure details.
- `403`: Credential does not have access to update a feature credit entry.
- `404`: Entry not found. Please check the response message for failure details.
- `429`: Request throttled. Please check the response message on the failure details.
- `default`: Error response

## Changes

- **2023-11-03** `a6c96c5ec06e`: 1 warning
  - added the new `REFUND` enum value to the `source` response property for the response status `200`
- **2023-10-16** `898bb5f2ce0c`: 1 warning, 2 info
  - removed the request property `grantedUnits`
  - added the new optional request property `granted`
  - added the non-success response with the status `404`
- **2023-10-09** `16b435d2f602`: 2 breaking, 2 info
  - removed the required property `sourceId` from the response with the `200` status
  - removed the required property `sourceType` from the response with the `200` status
  - added the required property `id` to the response with the `200` status
  - added the required property `source` to the response with the `200` status
- **2023-10-06** `bde5658f101e`: 2 warning, 8 info
  - removed the optional property `data` from the response with the `200` status
  - removed the optional property `nextToken` from the response with the `200` status
  - added the optional property `balance` to the response with the `200` status
  - added the optional property `granted` to the response with the `200` status
  - …6 more
- **2023-10-06** `4d0b22a4b65c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/togaihq/apis/togai-apis/changes/accounts/:account_id/features/:feature_id/entries/:entry_id/patch.md)

---

[API](https://skmtc.dev/togaihq/apis/togai-apis.md) - [All operations](https://skmtc.dev/togaihq/apis/togai-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/togaihq/apis/togai-apis/revisions/442f5d8f4aa0?raw)
