API Reference
RFID Config

RFID Config API

Manages the persisted RFID configuration for a location. Values saved here override environment variables for all RFID operations at that location.

GET /api/rfid/u300/config

Returns the effective config — DB values merged with env var fallbacks.

GET /api/rfid/u300/config
Authorization: Bearer <token>
x-selected-location: 42

Response:

{
  "ok": true,
  "locationId": 42,
  "result": {
    "configType": "rfid_settings",
    "u300": {
      "baseUrl": "http://192.168.1.100:5000",
      "relayToken": "",
      "ingestKey": "...",
      "ingestEndpointUrl": "https://app.vercel.app/api/rfid/u300/ingest",
      "ingestPollMs": 1000,
      "rfLink": 1,
      "antennaPower": 30,
      "antennas": [1, 2]
    },
    "moisture": {
      "tagFamily": "AZN3120-AFR",
      "skipTidReads": true
    },
    "shared": {
      "killPasswordHex": ""
    },
    "r1": { "baseUrl": "" },
    "cp30": { "baseUrl": "" }
  }
}

PATCH /api/rfid/u300/config

Deep-merges a partial config into the saved location config.

PATCH /api/rfid/u300/config
Authorization: Bearer <token>
x-selected-location: 42
Content-Type: application/json
 
{
  "u300": {
    "antennaPower": 30,
    "antennas": [1, 2, 3]
  },
  "moisture": {
    "skipTidReads": true
  }
}

Only the provided fields are updated. All other fields retain their current values.

Response:

{
  "ok": true,
  "locationId": 42,
  "result": { ...full updated config... }
}

Config fields reference

u300

FieldTypeDefaultDescription
baseUrlstring""U300 relay base URL
relayTokenstring""Bearer token for relay auth
ingestKeystring""Secret key for ingest endpoint
ingestEndpointUrlstring""URL relay POSTs tag events to
ingestPollMsnumber1000Poll interval in ms (300–10000)
rfLinknumber1RF link profile (see U300 docs)
antennaPowernumber20TX power in dBm (1–30)
antennasnumber[][]Active antenna ports. Empty = relay default

moisture

FieldTypeDefaultDescription
tagFamilystring"AZN3120-AFR"Tag family name (must exist in rfid_tag_families)
skipTidReadsbooleantrueSkip TID reads, treat all tags as tagFamily

shared

FieldTypeDefaultDescription
killPasswordHexstring""8-char hex kill password