Skip to content

Retry Failed Raw Event

POST /v1/projects/:project_id/raw-events/:id/process

Send Authorization: Bearer <api-key> with rules:test permission. project_id identifies the owning project; id is the original raw_event_id. There are no query parameters.

Field Required Meaning
processing_log_id Yes Failure log id from List Processing Failures. Only retried_at = 0 can be processed.
extractor_rule_set_id No Override the extractor; must be supplied with extractor_version. Takes precedence over the logged or replacement event’s extractor ID.
extractor_version No Positive version number of the specified extractor. Must be published and accessible to this tenant/project; no fallback to the latest version.
raw_event No Complete replacement business input. Omit to use the stored input. This is an object, not a JSON string.
raw_event.extractor_rule_set_id Yes when replacing without a root override Extractor rule set to use.
raw_event.idempotency_key Yes when replacing Original idempotency key; changing event identity is rejected.
raw_event.occurred_at Yes when replacing Original occurrence time in Unix seconds; changing event identity is rejected.
raw_event.raw_json Yes when replacing Corrected original usage JSON.
raw_event.source No Event source.
raw_event.external_event_id No External identifier.
raw_event.subject_type, raw_event.subject_id No Explicit subject; provide both or neither.
raw_event.x-billing No Reported dynamic charge items and pricing/discount hints; same contract as ingest.
raw_event.x-usage-control No Usage-control extension; same contract as ingest.
raw_event.metadata No Business string map. Internal processing metadata is preserved by the service.

Copy raw_event from the failure list to edit business data. An explicit replacement is complete, not a partial patch. Tenant/project ownership, revision and original ingested_at are managed by the service. The ID is recalculated from tenant, project, idempotency key, occurred_at and the stored revision, and must match id.

The extractor fields use the same names as reprice. Omit both to retain the existing selection behavior. Provide both to pin an exact published version, even without replacing raw_event. Invalid versions are rejected before claiming the log. If processing fails, the new failure snapshot retains the selected extractor and version for subsequent retries.

{
"processing_log_id": "rpl_attempt_1",
"extractor_rule_set_id": "ers_gateway",
"extractor_version": 2,
"raw_event": {
"extractor_rule_set_id": "ers_gateway",
"source": "gateway",
"idempotency_key": "request_123",
"occurred_at": 1791602563,
"raw_json": {"usage": {"tokens": 12}}
}
}

A successful synchronous retry returns HTTP 200:

{
"raw_event_id": "raw_original",
"subject_type": "user",
"subject_id": "user_123",
"dimensions": {"model": "example"},
"charge_items": [],
"unmatched_items": []
}

raw_event_id, subject_type, subject_id are strings; dimensions is a string map; charge_items and unmatched_items are arrays of the rated and unmatched charge-item schema. Normal wallet debit, limits and analytics publication apply on success.

Validation failures (including changed identity) return HTTP 400 and leave the log eligible. A processing failure returns HTTP 400, sets the old log’s retried_at and creates a new failure with corrected input and retried_at = 0. The old log disappears from the failure list and cannot be processed again. Concurrent requests can claim a log once; raw-event conflicts never debit again. This endpoint does not repair already successful events or analytics projections.

The process API claims the failure log after input/identity validation and before rating. Shared batch persistence only inserts raw events and financial facts; it does not claim failure logs. Request cancellation still attempts to persist a new failure using a bounded recovery context.