Skip to main content
POST
Add a field to a collection

Authorizations

Authorization
string
header
required

Cactal API key. Create one in the dashboard or via POST /apiKeys. The plaintext key is shown once at creation.

Path Parameters

collectionId
string
required
Minimum string length: 1

Body

application/json
key
string
required
Pattern: ^[a-z][a-z0-9_]{0,63}$
displayName
string
required
Required string length: 1 - 200
type
enum<string>
required
Available options:
plain_text,
markdown,
number,
boolean,
date,
link,
email,
color,
option,
reference,
multi_reference,
image,
gallery,
file
description
string | null
Maximum string length: 2000
required
boolean
isUnique
boolean
example
any
targetCollectionId
string
Minimum string length: 1
config
object

Response

The created field.

id
string
required

Unique field id.

collectionId
string
required

Id of the owning collection.

key
string
required

JSON key under item data. Lowercase snake_case, max 64 characters, unique per collection. Changed only via key on the update-field endpoint, which migrates stored data.

displayName
string
required

Human-readable name, 1–200 characters.

description
string | null
required

Optional description, up to 2,000 characters.

type
enum<string>
required

Value type. Immutable after creation.

Available options:
plain_text,
markdown,
number,
boolean,
date,
link,
email,
color,
option,
reference,
multi_reference,
image,
gallery,
file
required
boolean
required

Whether every item must carry a non-null value for this field. Enforced on write.

isUnique
boolean
required

Whether values must be unique across the collection’s active items. Not supported for plain_text, markdown, multi_reference, image, gallery, or file fields.

position
string
required

Fractional ordering key; fields sort lexicographically by this value.

example
any
required

Optional example value used as a design-phase placeholder. Any JSON value; null when unset.

config
object | null
required

Type-specific configuration. Present for option fields only; null for all other types.

targetCollectionId
string | null
required

For reference and multi_reference fields, the id of the collection referenced items must belong to (same website). null otherwise. Immutable.