powered by

Field types reference

Every field type you can add to an entity: its API value, storage, display types, JSON shape in requests and responses, validation and an example.

Last updated

A field type decides how a value is stored, which display types you can pick, and what shape the value takes in the REST API. This page is the reference for each type. To add fields and set constraints such as required and unique, see Model your data: entities, fields, relations.

Each section gives the dashboard name, the API value you pass as --type or database_type, how the value is stored, the display types you can pair it with, the JSON value in requests and responses, the validation that applies and an example.

All types at a glance

Type (dashboard) API value Stored as Display types
Small text varchar VARCHAR input (default), select, entity-select
Large text text TEXT textarea (default), rich-text
Integer integer INTEGER input (default), select
Big Integer bigint BIGINT input (default), select
Decimal decimal DECIMAL input (default), select
Boolean boolean BOOLEAN checkbox (default), radio
Date date DATE short-date (default), long-date
Timestamp timestamp TIMESTAMPTZ timestamp
JSON jsonb JSONB jsonb
Geo geo JSONB geo
Select with Multiple varchar[], integer[], decimal[] Array select
File Upload file Link to files file
User user Link to a user user
One-to-One, Many-to-One one-to-one, many-to-one Link to one record relationship
One-to-Many, Many-to-Many one-to-many, many-to-many Links to many records relationship
Dynamic Reference dynamic-reference VARCHAR dynamic-reference

Rules that apply to every type

  • The type is permanent. You can't change a field's type after you create it, so add a new field and copy the values across.
  • A field name is 63 characters or fewer, starts with a letter and uses letters, numbers and underscores. It can't be id, locked, created_at or updated_at, and it can't start with anythink.
  • The display type must be one of the types allowed for the field's type. Anything else is refused with a 400 that lists the allowed display types, such as For database type 'integer', display type must be one of: input, select.
  • A default value fills existing records when you add the field to an entity that already has records.
  • Unique is enforced by the database. A duplicate value returns 400. Required is enforced by the dashboard's record form.
  • Send each value in the shape shown for its type below. Dates and timestamps are ISO 8601.

Small text

API value varchar
Stored as VARCHAR, with no length limit
Display types input (default), select, entity-select. The dashboard's field form offers input and select.
JSON value A string

Use it for names, titles, codes and short strings, and with select for a fixed list of choices. Choices are display options: they decide what the dashboard offers, and don't change what's stored.

bash
anythink fields add orders status --type varchar --display select --options "Draft=draft,Paid=paid,Shipped=shipped"
json
{ "status": "paid" }

Validation: a number is stored as its text. A text field has no minimum or maximum length unless you check it in your app.

Large text

API value text
Stored as TEXT
Display types textarea (default), rich-text
JSON value A string. Line breaks are \n.

Use it for anything longer than a line. rich-text lets editors write Markdown in the dashboard. The stored value is still plain text.

bash
anythink fields add orders notes --type text
json
{ "notes": "First line\nSecond line" }

Integer

API value integer
Stored as INTEGER, a 32-bit whole number from -2,147,483,648 to 2,147,483,647
Display types input (default), select
JSON value A number
bash
anythink fields add orders quantity --type integer --default 1
json
{ "quantity": 42 }

Validation: send a whole number inside the range. A numeric string such as "7" is read as the number 7. Use bigint for anything larger.

Big Integer

API value bigint
Stored as BIGINT, a 64-bit whole number
Display types input (default), select
JSON value A number

Use it for very large numbers such as epoch times.

bash
anythink fields add events occurred_at_ms --type bigint
json
{ "occurred_at_ms": 1790000000000 }

Validation: send a whole number. Responses carry the exact number, but JavaScript's JSON.parse is only exact up to 9,007,199,254,740,991. Above that, read the value with a library that supports big integers, or store it as small text.

Decimal

API value decimal
Stored as DECIMAL, an exact decimal number
Display types input (default), select
JSON value A number

Use it for prices and measurements. It keeps exact values, which a float doesn't.

bash
anythink fields add orders total --type decimal
json
{ "total": 19.99 }

Validation: send a number, or a numeric string such as "19.99".

Boolean

API value boolean
Stored as BOOLEAN
Display types checkbox (default), radio
JSON value true or false

A boolean with no default value defaults to false, so a new record that leaves it out comes back as false.

bash
anythink fields add orders paid --type boolean
json
{ "paid": true }

Date

API value date
Stored as DATE, a calendar date with no time or time zone
Display types short-date (default), long-date
JSON value in requests A string in yyyy-MM-dd form
JSON value in responses A string at midnight, such as 2026-10-02T00:00:00

Use date only when the time of day is meaningless, such as a birthday. For anything that happened at a moment, use timestamp.

bash
anythink fields add orders placed_on --type date
json
{ "placed_on": "2026-10-02" }

The response gives "placed_on": "2026-10-02T00:00:00". Ignore the time part. Filter dates with yyyy-MM-dd, as in Filter operators reference.

Timestamp

API value timestamp
Stored as TIMESTAMPTZ, a date and time with time zone
Display types timestamp
JSON value in requests An ISO 8601 string, with or without a zone offset, or a Unix time in seconds
JSON value in responses A UTC string ending in Z

Anythink converts every timestamp to UTC. A value with no offset is read as UTC.

bash
anythink fields add orders shipped_at --type timestamp
json
{ "shipped_at": "2026-10-05T23:30:00+01:00" }

The response gives "shipped_at": "2026-10-05T22:30:00Z". created_at and updated_at are timestamps that Anythink sets on every record.

JSON

API value jsonb
Stored as JSONB
Display types jsonb (a JSON editor)
JSON value in requests Any JSON object or array
JSON value in responses A string containing the JSON text

Use it when the shape varies between records and you don't need to filter on its contents.

bash
anythink fields add orders metadata --type jsonb
json
{ "metadata": { "channel": "web", "tags": ["gift", "express"] } }

The response gives the same data as a string, so parse it in your app:

json
{ "metadata": "{\"channel\": \"web\", \"tags\": [\"gift\", \"express\"]}" }

Validation: the value must be valid JSON. Key order isn't kept.

Geo

API value geo
Stored as JSONB
Display types geo (a map)
JSON value in requests [latitude, longitude]
JSON value in responses A string containing the JSON text

A geo field is reported with database_type jsonb and display type geo. The dashboard's map reads and writes a point as [latitude, longitude].

bash
anythink fields add stores location --type geo
json
{ "location": [51.505, -0.09] }

The response gives "location": "[51.505,-0.09]", a string you parse in your app.

Select with Multiple

Tick Multiple on a select field to let one record hold several choices. The field is then stored as an array of the type you picked.

API value varchar[], integer[] or decimal[], set for you
Stored as A Postgres array of that type
Display types select
JSON value An array of strings, whole numbers or numbers

In the dashboard, choose Small text, Integer or Decimal, set the display type to Select, add the choices and tick Multiple. With the CLI, pass --multiple:

bash
anythink fields add customers interests --type varchar --display select --multiple --options "Running,Cycling,Rugby"
json
{ "interests": ["Running", "Rugby"] }

Validation: always send an array, even for one choice. Send ["Running"], not "Running". The response is the same array.

File Upload

API value file
Stored as A link to records in your project's files
Display types file
JSON value in responses { "__count": n, "__data": [ … ] }

A file field links a record to uploaded files. Responses follow the shape for relationships that hold many records, with __count the number of files and __data their details. Display options set the allowed file types and how many files a record can hold. See Upload and manage files for uploading and attaching files.

User

API value user
Stored as A link to a user in your project
Display types user
JSON value in requests The user's id, a whole number
JSON value in responses The user as an object, or null when it isn't set

A user field behaves like a many-to-one relationship to your project's users. Choose what happens to the record when the user is deleted: CASCADE, SET NULL, RESTRICT or SET DEFAULT. A required field can't use SET NULL.

Relationships

API values one-to-one, many-to-one, one-to-many, many-to-many
Stored as One-to-one and many-to-one keep the related record's id on this entity. One-to-many and many-to-many keep nothing on this entity.
Display types relationship

A relationship field needs a target entity and an on-delete behaviour: CASCADE, SET NULL, RESTRICT or SET DEFAULT. A required field can't use SET NULL. A one-to-many field also needs the name of the field on the target entity that points back.

bash
anythink fields add orders customer --type many-to-one --target customers --on-delete "SET NULL"

In requests, a one-to-one or many-to-one field takes the related record's id:

json
{ "customer": 1 }

In responses, the shape depends on the relationship:

Relationship Shape under the field name
One-to-one, many-to-one The related record as an object, or null when it isn't set
One-to-many, many-to-many { "__count": n, "__data": [ … ] }
json
{
  "id": 3,
  "customer": { "id": 1, "name": "Ada Lovelace", "__name": "Ada Lovelace" }
}

A many-to-one or one-to-one field comes back expanded by default. A one-to-many or many-to-many field comes back with each related record's id and __name. Use the fields parameter to change either. The REST API reference covers expansion, and Connect entities with relationships covers modelling, writing and filtering linked records.

Dynamic Reference

API value dynamic-reference
Stored as VARCHAR
Display types dynamic-reference
JSON value A string

A dynamic reference points at a record of any entity, where a relationship points at one chosen entity. Anythink stores and returns the text you send and doesn't follow it to the record, so choose a format and keep to it, for example entity_name:record_id.

bash
anythink fields add comments subject --type dynamic-reference
json
{ "subject": "orders:12" }

Next steps