Skip to main content
Create an enumeration

Authorizations

token
string
query
required

Standard authorization for most API calls. This token identifies the logged-in user and their permissions. It is obtained either as a temporary token after a successful login or as a long-term API key.

Body

application/json
fields
object[]
required

Fields a record of this enumeration is made of. They are the whole of it - a value sent under any other key when a record is written is dropped.

Minimum array length: 1
name
string
required

Name of the enumeration definition, unique within the tenant and used as its identifier wherever the enumeration is referenced.

Required string length: 1 - 100
Pattern: ^[a-z0-9_]+$
Example:

"priorities"

unique
string[] | null
required

Names of the fields whose values identify a record - at least one is mandatory, and every one of them has to be declared in fields as a type that can carry an identity: integer, decimal, keyword or boolean. A field named here as text is accepted and stored as keyword instead. The choice is permanent - no later update can change it.

Minimum array length: 1
Required string length: 1 - 100
dynamic
boolean
default:false

Whether ordinary users may write the records of this enumeration. Left off, adding, changing and importing records is reserved for an administrator, while reading stays open to everybody.

Example:

false

import
object

Records to load into the new enumeration right away, described the same way as for POST /enums/{name}/import. Left out, the enumeration is created empty.

private
boolean
default:false

Whether each record belongs to the user who created it. In a private enumeration a caller reaches only their own records and the ones shared with them, and the same values may be stored once per user; in a shared one every record is visible to everybody in the tenant. It is decided here and cannot be changed afterwards.

Example:

false

sortBy
string

Name of the field a client should order the records by when it offers them to a user. It is presentation metadata stored for the enumeration's consumers, not an ordering the search endpoints apply. Left out, their manual __order position is what a client falls back to.

Example:

"priority"

system
boolean
default:false

Whether the enumeration counts as one of the platform's own. A system enumeration cannot be deleted.

Example:

false

Response

Returns the new definition, together with the import counts when records were loaded with it.

dynamic
boolean | null

Whether ordinary users may write the records of this enumeration. Left off, adding, changing and importing records is reserved for an administrator, while reading stays open to everybody.

failed
number

How many records of the imported file were refused, most often because they duplicate the unique values of a record already stored. Present only when the request asked for an import alongside the new definition.

Example:

0

fields
object[] | null

Fields a record of this enumeration is made of. They are the whole of it - a value sent under any other key is dropped, and the reserved record properties (the ones prefixed with a double underscore) cannot be redeclared as a field.

name
string | null

Name of the enumeration, unique within the tenant and used as its identifier wherever it is referenced.

Example:

"priorities"

private
boolean | null

Whether each record belongs to the user who created it. In a private enumeration a caller reaches only their own records and the ones shared with them, and the same values may be stored once per user; in a shared one every record is visible to everybody in the tenant.

sortBy
string | null

Name of the field a client should order the records by when it offers them to a user. It is presentation metadata that the enumeration carries for its consumers - reading the records applies no ordering of its own beyond what the search asks for. Left empty, the manual __order position is what a client falls back to.

Example:

"priority"

succesfull
number

How many records of the imported file were stored. Present only when the request asked for an import alongside the new definition.

Example:

42

system
boolean | null

Whether this is one of the platform's own enumerations. A system enumeration cannot be deleted.

unique
string[] | null

Names of the fields whose values identify a record. Storing the same combination of them twice is refused, and changing one of them replaces the record instead of editing it. It is decided when the enumeration is created and cannot be changed afterwards.

Example: