set_post_filter
ReferenceAudience: API consumerUse: add, delete, or modify a post-filter rule on the reader
Overview
set_post_filter configures a post-filter — a rule that includes or excludes scanned RFID tag data before it is reported to a data endpoint. Each call operates on one filter, chosen by postFilterPayload.operation (ADD / DELETE / MODIFY): the rule matches tag data by pattern (prefix, suffix, or regex) and either reports (INCLUDE) or drops (EXCLUDE) it, scoped to a data endpoint. It is a state-changing control-plane (CTRL) command; read the current filters back with get_post_filter.
This is a CTRL-endpoint command, published on the control endpoint (<tenantId>/CTRL/clients/cmnd/<serial>) and answered only there (not on the MGMT/MDM channel). Returning a response requires an active CTRL endpoint (config_endpoint, epType: CTRL, activate: true). Also: dataEpType is the enum DATA_EP1/DATA_EP2, not the endpoint name — sending an endpoint name returns code 23 (see Request Semantics).
Details
| Property | Value |
|---|---|
| Interaction Pattern | Request / Response (app publishes a command; device publishes the correlated reply) |
| State Change | STATE-CHANGING (adds/removes a filter) |
| Reversibility | REVERSIBLE (an ADD is undone by a DELETE on the same dataEpType) |
| Supported Operations | ADD (new), DELETE (existing), MODIFY (existing) |
| Required Request Fields | command, requestId (postFilterPayload is optional in the contract; send it with the rule) |
| Applies To | Endpoint: Control (CTRL). Reader: RFD40 series, RFD90 series |
| API Version | V1.1 (API Version Reporting) |
| Related | get_post_filter, set_operating_mode, config_endpoint |
When to Use
Use set_post_filter to control which scanned tag data reaches a data endpoint:
- Include only matching tags —
reportOperation: INCLUDEreports only tags whose data matches; everything else is dropped. - Exclude noisy tags —
reportOperation: EXCLUDEdrops matching tags from reporting. - Match by prefix, suffix, or regex — choose
matchPatternMethodto fit the tag-data pattern. - Manage the rule set —
ADDto install,DELETEto remove,MODIFYto update; verify withget_post_filter.
Topic Mapping
| Message | Direction | Topic | Note |
|---|---|---|---|
| Request | App → Reader | <tenantId>/CTRL/clients/cmnd/<serial> | On the control endpoint. Requires an active CTRL endpoint. |
| Response | Reader → App | <tenantId>/CTRL/clients/resp/<serial> | Correlated reply; the in-payload requestId links the twin topics. |
Topics follow the pattern <tenantId>/<topic>/<serial> — the tenant id assigned to you at provisioning (a slot you fill in, never a literal), the base topic you configure on the endpoint, and the reader's serial number, which the reader appends itself in its model-prefixed form (for example RFD40-212735201D0053). App → Reader means your app publishes and the reader subscribes; Reader → App means the reader publishes and your app subscribes.
Control commands are answered only on the CTRL endpoint.
Post-filters act on tag data (post-singulation), distinct from the Gen2 select pre-filters in set_operating_mode that act on the air interface. If control commands time out, confirm a CTRL endpoint is active and activate one with config_endpoint if needed.
See Topics and Channels.
Key Fields
postFilterPayload.operation(request) —ADD/DELETE/MODIFY; determines the action on the rule set.dataEpType(request) — the data-endpoint enum (DATA_EP1/DATA_EP2) the filter binds to — ⚠️ not the endpoint name (see Request Semantics).matchPattern+matchPatternMethod(request) — what to match and how (PREFIX/SUFFIX/REGEX).reportOperation(request) —INCLUDE(report matches) orEXCLUDE(drop matches).response.code(response) — read this to determine success vs failure. The contract requires it; note the reported success-path omission (see Success without a code). See Response Codes.
Request Payload
The envelope is command, requestId, and the single-rule postFilterPayload. Pick a match method below; the Example and Schema update together. Use the Schema tab for the full field reference and the Example tab for the concrete payload.
- Example
- Schema
| Field | Type | Enum / Units | Example | Description |
|---|---|---|---|---|
command* | string | — | set_post_filter | Fixed command name. |
requestId* | string | — | abc123 | A unique identifier for the request; echoed back in the response. |
postFilterPayload | object | — | — | The single post-filter rule to add, delete, or modify. Optional in the contract, as is every field inside it, but a request without it carries no rule to apply. |
operation, nesting level 2 | enum | ADDDELETEMODIFY | ADD | ADD a new filter, DELETE an existing one, or MODIFY one. See Request Semantics. |
dataEpType, nesting level 2 | enum | DATA_EP1DATA_EP2 | DATA_EP1 | The data-endpoint TYPE the filter binds to. ⚠️ This is the enum value DATA_EP1/DATA_EP2, not the endpoint name (see Request Semantics) — a wrong value returns code 23. DATA_EP2 targets the DATA2 endpoint, which is currently not supported. |
matchPattern, nesting level 2 | string | — | FFFFBBBBA500 | The value matched against scanned tag data. For PREFIX/SUFFIX: hex digits only, even count. For REGEX: a regular expression. See Request Semantics. |
matchPatternMethod, nesting level 2 | enum | PREFIXSUFFIXREGEX | REGEX | How the pattern is matched — beginning (PREFIX), end (SUFFIX), or regular expression (REGEX). |
reportOperation, nesting level 2 | enum | INCLUDEEXCLUDE | INCLUDE | INCLUDE reports only matching tag data; EXCLUDE drops matching tag data from reporting. |
Request Semantics
Modes. postFilterPayload.operation selects the action; each call handles one rule:
ADD— install a new post-filter for the givendataEpType.DELETE— remove the post filter on a data endpoint. Sendoperation: DELETEwithdataEpTypealone;matchPattern,matchPatternMethodandreportOperationare not needed. Undoes a priorADDon the samedataEpType.MODIFY— update an existing filter.
Confirm the resulting rule set with get_post_filter, which returns the stored postFilter[] (or nothing when none remain).
dataEpTypeis an enum, not the endpoint name.dataEpTypemust be the enum valueDATA_EP1orDATA_EP2— not the endpoint name you gave a data endpoint inconfig_endpoint(e.g.DATA1_EP). Sending the endpoint name is an enum violation and the device rejects it with code23("Invalid enum value"). Map yourDATA1endpoint toDATA_EP1when setting a filter;DATA_EP2targets theDATA2endpoint, which is currently not supported.matchPatternrules follow the match method. ForPREFIXandSUFFIXmethods,matchPatternmust be hexadecimal digits only, with an even count — the contract states this rule in the field description but does not enforce it with a pattern; forREGEXit is a free-form regular expression.PREFIXpost-filters and Gen2selectpre-filters are mutually exclusive. APREFIXpost-filter precludes using Gen2selectpre-filters at the same time.
Response Payload
set_post_filter returns a status-only envelope — command, requestId, apiVersion, and response. Confirm with get_post_filter — there is no filter echo.
- Example
- Schema
| Field | Type | Enum / Units | Example | Description |
|---|---|---|---|---|
command* | string | — | set_post_filter | Echoes the executed command. |
requestId* | string | — | abc123 | Echoes the request's requestId — pairs reply to request. |
apiVersion* | enum | V1.0V1.1V1.2V1.21V1.22 | V1.1 | API version reported by this command. Emitted per-handler, not device-wide. |
response* | object | — | — | Status-only result — set_post_filter echoes no configuration. |
code*, nesting level 2 | integer | 0–101 | 0 | 0 = Success; non-zero = error. Required by the contract. Readers have been reported to omit it on success — see Response Payload and Response Codes below. |
description*, nesting level 2 | string | — | Success | Human-readable status. |
The contract requires response.code. Readers have been reported to omit it on a successful reply, returning just response: { "description": "Success" } — treat that as success too. See Success without a code.
As reported, a successful set or delete can arrive with code omitted. This form does not validate against the contract; the reply with code: 0 above is the documented form:
Response Codes
set_post_filter returns response.code. The codes applicable to this command are below; for the full table see the Response Codes and Correlation and Request/Response Pairing.
| Code | Description |
|---|---|
0 | Success — the filter was added, deleted, or modified. (Readers have been reported to omit code on this reply — see above.) |
23 | Invalid enum value (IOT_ERROR_INVALID_ENUM) — a field (operation, dataEpType, matchPatternMethod, or reportOperation) is outside its allowed set. Commonly triggered by sending an endpoint name (e.g. DATA1_EP) as dataEpType instead of the enum DATA_EP1 — see Request Semantics. |
101 | Default error — generic catch-all. |
Examples
Publish set_post_filter over the CTRL endpoint; the device replies with the status envelope under Response Payload. The Post filter scenario dropdown under Request Payload shows each contract example: an ADD by prefix, regex and suffix, and a DELETE. In the regex example, matchPattern is free-form; the hex-digit rule applies only to prefix and suffix patterns.
Sending an endpoint name (not the enum) as dataEpType is rejected with code 23:
Notes and Caveats
- Post-filters vs pre-filters.
set_post_filterconfigures post-filters — rules applied to scanned tag data before it reaches a data endpoint (INCLUDE/EXCLUDE). These are separate from the Gen2selectpre-filters inset_operating_mode, which filter on the air interface during inventory.
set_post_filter is reversible — an ADD is undone by a DELETE on the same dataEpType. It carries no credentials (match patterns are tag-data hex/regex strings). After setting a filter, verify with get_post_filter — the setter's response has no configuration echo. For the concept-level view, see Tag Filtering.
Related: 📕 get_post_filter · 📕 set_operating_mode · 📕 config_endpoint · 📕 Tag Filtering · 📕 Response Codes