Reference

Data Types Representation

Understanding how internal system types are mapped to JSON in the Monospace API.

Data Types Representation

To learn how fields and data types are structured within your collections and the Studio, read the Data Model Concepts and Introspection guides.

Monospace maps internal system types and database types to uniform JSON representations in the API. While primitive types like strings, booleans, and floats maintain their standard JSON equivalents, certain types are handled specifically to guarantee precision and standardized formatting.

Type Mappings Overview

When querying data or submitting mutations, the following API mappings apply:

Internal TypeJSON TypeDescription
StringStringStandard text string.
Integer (i64)Number64-bit signed integer.
UInteger (u64)Number64-bit unsigned integer.
Float (f64)NumberStandard IEEE 754 floating point number.
DecimalStringArbitrary-precision decimals are serialized as strings to prevent floating-point rounding errors.
BooleanBooleanTrue or false.
BytesStringBinary data is serialized as a base64 encoded string.
JSONJSONJSON column types are returned and accepted as native JSON — an object, array, or scalar embedded directly in the payload.
DateStringFormatted as YYYY-MM-DD.
TimeStringFormatted as HH:MM:SS (may include fractional seconds, e.g., HH:MM:SS.sss).
DateTimeStringISO 8601 formatted without timezone (e.g., YYYY-MM-DDTHH:MM:SS). May include fractional seconds.
DateTimeZStringISO 8601 formatted with timezone offset (e.g., YYYY-MM-DDTHH:MM:SS.sssZ).
UUIDStringStandard UUID string.

Timestamps & Timezones

The DateTime type does not contain timezone information.

Monospace DateTime types are natively parsed and stored as "Naive" DateTimes. When receiving timestamps from the API, they will be formatted as strings without an offset (e.g., 2024-05-12T10:30:00).

It is up to your application to interpret these naive timestamps, generally implying they represent UTC unless you've designed your workspace's data model differently.

If you need timezone-aware timestamps, use the DateTimeZ type, which stores and returns timestamps with timezone information (e.g., 2024-05-12T10:30:00Z).

JSON Serialization Details

Decimal Types

Decimals, often used for currency or precise measurements, are returned as strings.

JSON Fields

A field configured as a JSON data type is embedded directly in the API payload as native JSON — an object, array, or scalar — on both read and write.

  • Response Example: { "key": "value" }.
  • Input Example: { "key": "value" }.
Copyright © 2026