Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors

JSON Payload Data Types

ThingsBoard chooses a data type for every value while it parses a telemetry or attribute payload, and stores the value under that type. The type it chooses is not always the one the JSON carried: by default a string that looks like a number is stored as a number, so "07432124" reads back as 7432124.

The rules below apply to payloads sent over the MQTT, HTTP, CoAP, and Gateway APIs, and to values written through the REST API, the web UI, the save time series and save attributes rule nodes, calculated fields, and CSV/XLS import.

What the payload carries Stored as Example
true or false Boolean {"valve": true} stays true
A number with no fractional part, written without a decimal point or with an exponent, that fits a signed 64-bit integer Long {"count": 11} stays 11; {"count": 1E+1} becomes 10
Any other number with at most 16 decimal places Double {"temperature": 1.1} stays 1.1; {"temperature": 42.0} stays 42.0; {"temperature": 101E-1} becomes 10.1
A number that fits neither — a whole number outside the signed 64-bit range, or more than 16 decimal places String {"reading": 9.9701010061400066E19} becomes "99701010061400066000"
An object or an array JSON {"position": {"x": 1, "y": 2}} is stored as written
A string that parses as a plain decimal number Long or Double — see below {"serialNumber": "07432124"} becomes 7432124
Any other string String {"devEui": "70B3D57ED0012345"} stays unchanged
null Skipped over the device transports; an error on the REST API, the web UI, the rule nodes, calculated fields and CSV/XLS import — see below {"temperature": null} stores no value over MQTT

A null value is skipped only on the MQTT, HTTP, CoAP, LwM2M and Gateway transports. Sent through the REST API, the web UI, the save time series or save attributes rule nodes, a calculated field or CSV/XLS import, the same payload is rejected instead, and nothing in that request is saved. The time series REST call answers 400 with Unable to parse time series payload. Invalid JSON body: Can't parse value: followed by the offending value or by the whole object.

Integration uplinks skip null values the same way: an uplink converter’s output goes through the same parser as a transport payload.

A string is cast only when it is an optional leading - followed by digits and at most one decimal point. Exponent notation ("1e5"), hexadecimal ("0x1A"), a leading +, and a trailing . do not qualify, so those values stay strings.

The rule reads the text, not the number it denotes — 1E+1 sent as a number becomes 10, while "1E+1" sent as a string stays "1E+1".

Sent Stored
{"serialNumber": "07432124"} 7432124
{"joinEui": "0000000000000000"} 0
{"firmwareVersion": "1.10"} 1.1
{"devEui": "70B3D57ED0012345"} "70B3D57ED0012345" — the letters make it non-numeric

Integration uplinks are the exception. An integration built for ChirpStack, The Things Stack, ThingPark, or LORIOT unwraps the network server’s envelope itself, and the keys it takes from there — devAddr and joinEui among them — keep their exact text even while the cast is on, so "joinEui": "0000000000000000" is stored as sent. Keys the uplink converter’s own decoder produces are cast as usual.

The cast is controlled by transport.json.type_cast_enabled, set by the JSON_TYPE_CAST_ENABLED environment variable. It is true in every service except the standalone LwM2M transport service, which ships with false.

Every service that parses device JSON reads its own copy of the setting:

  • the MQTT, HTTP, CoAP, LwM2M, and SNMP transports;
  • tb-node — the REST API, the web UI, the save time series and save attributes rule nodes, calculated fields, and CSV/XLS import.

tb-integration-executor parses the JSON that uplink converters produce, and reads the setting as well.

A monolithic installation runs all of them in one process, so a single setting covers everything. In a microservices deployment, set the variable on every service — otherwise the same payload is typed differently depending on how it reached the platform.

The neighboring transport.json.max_string_value_length (JSON_MAX_STRING_VALUE_LENGTH, 0 by default, meaning no limit) rejects string values longer than the given number of characters.

See How to change configuration for where to put the variable in your deployment.