Skip to main content
Version: Beta

Replace Extraction Rule

Replaces the extraction rule identified by id with the rule in the request body. Every editable field is overwritten; fields that are unset in the request are cleared on the stored rule. Use this when you have the entire desired rule state — for partial field updates, use the PATCH UpdateExtractionRule endpoint instead. Concurrent writes follow last-write-wins semantics: the most recent successful update is preserved. The rule's archived state is preserved across the replace; use the archive/unarchive endpoints to change it. The body's rule.scope must match the existing rule's scope; you cannot change scope on replace. To use a different scope, create a new rule and archive this one.

Responses

200

A successful response.

Whole-resource replace. This PUT endpoint overwrites every editable field of the rule with the values in the request body. Fields that are unset on the request are cleared on the stored rule. Use this when you have the entire desired rule state — for example, after editing a rule in your own UI and re-saving it.

Round-tripping a Get response is supported. The natural workflow is Get → mutate → PUT. The PUT endpoint accepts every field returned by Get/List without requiring you to strip it first:

  • created_at, updated_at, and archived (on the rule body) are server-managed and silently ignored on input. Server-managed fields will be regenerated on save; archive state is preserved from the stored rule.
  • id on the rule body is allowed but, if set, must equal the id in the URL path. The path is the authoritative identifier; a mismatch is rejected as a likely client bug rather than silently overwriting the wrong rule.

Concurrency. Concurrent updates follow last-write-wins: if two clients update the same rule at the same time, the most recent successful write is preserved. The legacy etag field is still accepted on the request and returned on responses for backward compatibility, but the server no longer validates or honors it.

Archived state is preserved. Replacing a rule does not change its archive status. Use the archive and unarchive endpoints to change it.