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.
JSONStringJSON column types from the database are serialized as a standalone JSON string. You will need to parse this string (JSON.parse()) on the client side.
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 project'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

If you have a field in your project configured as a JSON data type, the API payload will contain a string representation of that JSON, rather than an embedded JSON object.

  • Response Example: "{\"key\": \"value\"}" instead of {"key": "value"}.
  • Input Example: When mutating a JSON field, you must provide the stringified JSON value.
Copyright © 2026