# Delete Driver Value

Operation ID: `deleteDriverValue`

Group: Value Accounting › Business Drivers › Driver Values

[Open in the interactive reference](https://lensing.ai/api-docs/lensing/v1/endpoints/deleteDriverValue)

`DELETE /value-accounting/driver-values/{id}`

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Delete ONE recorded business driver value; returns an empty body. WRITES and is DESTRUCTIVE. For a CUMULATIVE driver the value is removed (Delete entry in the audit history). For an AS-OF driver it usually REVERTS: the period falls back to the value carried from before it, the row keeps its id and becomes a carried row, and the later carried rows follow. Deleting an As-of combination's only recorded value removes it with its carried rows; its FIRST value is refused while a later recorded value exists (DELETE_FIRST_VALUE_BLOCKED) — delete newest first, or use bulkDeleteDriverValues (POST value-accounting/driver-values/bulk-delete), which orders the deletes for you. A carried row cannot be deleted on its own (DELETE_CARRIED_BLOCKED). The period must be open and not in the future (PERIOD_LOCKED). A system driver's values are refused (SYSTEM_DRIVER). The audit history survives. An unknown id is NOT_FOUND. It runs in one transaction, so a refusal writes nothing.

Deletes ONE recorded business driver value and returns an empty body. What 'delete' does depends on the driver's calculation type.

CUMULATIVE driver: the value is removed and a Delete entry is written to the audit history.

AS-OF driver: usually a REVERT, not a removal — the period falls back to the value carried from the last recorded value before it, so the row stays (same id, now `isCarried: true`) and the carried rows after it follow. Deleting a combination's ONLY recorded value removes it together with its carried rows; deleting its FIRST value is refused while a later recorded value exists (`DELETE_FIRST_VALUE_BLOCKED`) — delete from the newest value backwards, or use bulkDeleteDriverValues (POST value-accounting/driver-values/bulk-delete), which orders the deletes for you.

A system-carried row cannot be deleted on its own (`DELETE_CARRIED_BLOCKED`); change the recorded value it derives from. The period must be open and not in the future (`PERIOD_LOCKED`). A system driver's values are refused (`SYSTEM_DRIVER`). The audit history always survives the value. An unknown id fails with `NOT_FOUND`. It runs in one transaction, so a refusal writes nothing.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `Idempotency-Key` | header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with `400 IDEMPOTENCY_NOT_SUPPORTED` rather than silently ignored. |
| `id` | path | string | yes | Id (a UUID) of the value to delete; bound from the :id path segment. Take it from searchDriverValues (POST value-accounting/driver-values/search); it must be a recorded row (isCarried false). Matched case-insensitively. |

## Response

`200` Success

```json
{
  "data": {},
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |
| `SYSTEM_DRIVER` | 400 |
| `DELETE_CARRIED_BLOCKED` | 400 |
| `DELETE_FIRST_VALUE_BLOCKED` | 400 |
| `END_COMBO_EXPLICIT_AFTER` | 400 |
| `LINE_NOT_FOUND` | 400 |
| `DRIVER_NOT_FOUND` | 400 |
| `PERIOD_LOCKED` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND, SYSTEM_DRIVER, DELETE_CARRIED_BLOCKED, DELETE_FIRST_VALUE_BLOCKED, END_COMBO_EXPLICIT_AFTER, LINE_NOT_FOUND, DRIVER_NOT_FOUND, PERIOD_LOCKED
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
