Build

Update Index Fact

Update a single canonical deal fact — write a value directly or promote an existing observation — in the Lev API.

Updated September 2026
PATCH/api/external/v2/deals/{deal_id}/index/facts

Update a single canonical deal fact value

Use this to change the canonical value behind a fact returned by Search Index. Provide exactly one of:

  • value — a direct, user-supplied replacement. Strips document provenance.
  • observation_id — promote an existing observation returned by Index Observations. Preferred when the user is choosing among extracted values, because the new canonical value keeps its source document, page range, and confidence.

Editability is enforced server-side. Some facts (for example most property-canonical fields and certain sponsor financials) cannot be changed through this endpoint and will return a 422 — even if a prior search result hinted otherwise. There is no version history: the last write wins.

Path parameters
deal_idintegerrequired
The deal ID
Request body
sot_idstringrequired
Prefixed SOT id from a search result (e.g. d:5362, a:123:property:690). Identifies the fact to update.
valuestring
Free-text replacement value. Provide exactly one of value or observation_id.
observation_idinteger
Observation id (> 0) to promote as the new canonical value. Returned by /index/observations.
curl -X PATCH "https://api.lev.com/api/external/v2/deals/101/index/facts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sot_id": "d:5362",
    "observation_id": 9012
  }'

Response (200):

{
  "request_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
  "timestamp": "2026-05-12T17:50:12Z",
  "data": {
    "id": "5362",
    "sot_id": 5362,
    "metric_key": "deal_financials.in_place_noi",
    "metric_id": 42,
    "value_text": "$1,250,000",
    "value_type": "currency",
    "period_type": "point_in_time",
    "period_value": null,
    "entity_type": "deal",
    "entity_id": null,
    "entity_ref": "deal:101",
    "group_ref": null,
    "category_id": 5,
    "source_type": "document",
    "source_id": "99",
    "observation_id": 9012,
    "weight": 10,
    "origin": "promoted_observation",
    "editable": true
  }
}
422validation_error
Provide exactly one of value or observation_idThe request body omits both, or sends both, of value and observation_id
422validation_error
Metric is not editableThe fact targets a metric flagged as non-editable upstream
401unauthorized
Authentication requiredMissing or invalid Authorization header
404not_found
Deal not foundThe deal_id doesn't exist or isn't accessible to the authenticated user
503service_unavailable
Deal fact update is temporarily unavailable. Please try again shortly.The indexed-data service is unavailable or returned a malformed payload
More in this section