How many triggers a metadata pattern reaches

The guard against a silent no-op. bulk-update returns matched: 0 and no error when its pattern selects nothing, so a configuration change appears saved and is not.

Send the SAME match the update will send as matchMetadata, and the same codes. Anything else measures a different population than the one about to be written — a trigger can carry the key you scope by and still miss the pattern, so "carries a label" and "will be reached" are different questions.

Set scope to the labels that select the PATIENTS in the group being written. It matches the labels on each patient, while match matches the labels on each trigger — that split is deliberate. A population selected by TRIGGER labels would exclude every trigger carrying none, and an unlabelled trigger is exactly what a bulk update silently fails to reach, so the gate would go green over a half-labelled group. Anchoring on the patient keeps those inside the population, where they show up as unmatched. It also stops the two predicates collapsing into one condition, which would make unmatched: 0 arithmetically unavoidable.

Within a scope, matched is the number to compare against how many triggers you expect in the set — only the caller knows what SHOULD be there. unmatched is the rest of the population the pattern will not touch, INCLUDING anything still unlabelled.

Without a scope the population is every patient in the tenant.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
match
object
required

The containment pattern to measure, as JSON. Send the same value the
subsequent bulk-update will send as matchMetadata, or the answer
describes a different population than the one about to be written.

scope
object

Which PATIENTS make up the population, as JSON, matched against each
patient's own labels.

Deliberately the patient and not the trigger. The thing a caller most needs
to find before a bulk update is a trigger that carries no labels at all —
and a population selected by trigger labels excludes exactly those, so
unmatched could never report them and the gate would go green over a
half-labelled group. Selecting the population by patient keeps unlabelled
triggers inside it, where they show up as unmatched.

It also keeps the two predicates independent. match is on the trigger and
scope is on the patient, so they can never collapse into the same
condition and make unmatched: 0 arithmetically unavoidable.

Omit and the population is every patient in the tenant, which is rarely
what a caller wants: where one tenant holds several independent groups,
unmatched counts every other group as well.

null is rejected rather than treated as absent — see the note on the
validator below.

codes
array of strings
length between 1 and 64

Narrow the population to these codes, mirroring bulk-update's own
codes. Omit to count every code in the population.

Accepts a repeated value or one comma-separated string.

codes
Responses

400

match was absent, or either pattern was not a non-empty JSON object. null is rejected — it is not the same as omitting the field.

401

Missing, malformed or unrecognised Basic credentials.

403

Authenticated, but the client's role does not permit this, or it is not attached to the patient.

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