Update or create an Operation Pattern Rule by origin or ID

Upsert semantics, per this API's standard {originOrId} convention: if {originOrId}
resolves to an existing rule, it's updated; if it doesn't resolve to anything, a new
rule is created for non-UI (machine token/OAuth) callers only --

  • if {originOrId} looks like a UUID, the new rule is created with that UUID as its
    dash0.com/id (metadata.labels["dash0.com/origin"] in the body, if any, is
    stamped normally per POST's rules);
  • otherwise, {originOrId} itself becomes the new rule's dash0.com/origin and a
    fresh dash0.com/id is generated.

A UI (Clerk session token) caller gets a strict 404 instead of a create when
{originOrId} doesn't resolve -- the UI creates rules via POST only, matching this
API's other single-/api/-family resources.

metadata.labels["dash0.com/origin"] is immutable after creation: a value supplied on
update is silently ignored, never rejected, so a normal GET -> edit spec -> PUT round
trip doesn't need to strip it back out.

metadata.labels["dash0.com/dataset"]/spec.serviceNamespace/spec.serviceName are immutable; a value that
disagrees with the stored row is rejected with 400 and the row is left unchanged.
Setting spec.ownership to auto_derived is rejected with 400; the only accepted
transition is auto_derived -> user_defined (promoting a Miner-inferred rule).
Unlike POST, spec.status is required on every PUT -- there is no default, since
omitting it could otherwise silently reactivate or deactivate a rule the caller did
not intend to touch.

If the incoming payload is identical to what's already stored, the write is skipped
entirely and the existing rule is returned as-is, without bumping
dash0.com/updated-at -- so re-applying the same manifest (a normal IaC workflow)
never spuriously conflicts with itself.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The Operation Pattern Rule's dash0.com/origin or dash0.com/id.

Query Params
string
required
^[a-zA-Z0-9_-]{3,26}$

The dataset the Pattern Rule belongs to.

Body Params

A Pattern Rule abstracts a high-cardinality span operation name (e.g. /users/1234)
into a templated one (e.g. /users/<userId>), so the collector's Operation Processor
can collapse matching operation names together. Rows are either authored by a human
through this API (spec.ownership: user_defined) or inferred by the Operation Miner
(spec.ownership: auto_derived).

Unlike most CRD-enveloped resources in this API, Pattern Rules have no independent,
user-editable display name, versioning, folder, or sharing concept -- metadata.name is
server-computed (see below). They are addressable either by their server-generated
metadata.labels["dash0.com/id"] or by metadata.labels["dash0.com/origin"] (an
IaC/Terraform-style stable label) -- see {originOrId} on each path below.
metadata.labels["dash0.com/dataset"]/spec.serviceNamespace/spec.serviceName identify
the partition (dataset + service) a rule belongs to, and are immutable once the rule is
created.

string
enum
required
Allowed:
metadata
object
required
spec
object
required
Responses

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json