Object Properties

The following sections describe the possible types of custom properties you can add to an object definition.

Base Property Options

The following base options are available when defining properties, unless otherwise noted. See individual properties for additional property-specific options.

*Bold options are required*

NameTypeDefaultDescription
nameStringAPI name of property.
labelStringProperty label that can be used in UI.
typeStringThe property type. See individual property type details for more info.
descriptionStringProperty description. This can be used for UI or for administrative purposes.
arrayBooleanfalseIf true, this property is an array of this type rather than a single value. This option can only be set when creating the property and cannot be changed.
uniqueValuesBooleanfalseApplies only if array: true. If true, values in array are guaranteed to be unique.
minItemsInteger0Applies only if array: true. The minimum number of items required in the array. Set to 0 for no minimum.
maxItemsInteger100Applies only if array: true. The maximum number of items allowed in the array. Cannot be greater than 1000.
maxShiftBooleanfalseApplies only if array: true. When true, shifts older items off of front of array when max items is reached rather than producing a kMaxAllowed fault.
canPushBooleantrueApplies only if array: true. If true, POST operations on the property can push values into the array.
canPullBooleantrueApplies only if array: true. If true, DELETE operations on property can remove items from the array by value or by array element _id
writeOnCreateBooleantrueApplies only if array: true. Allow values to be written to property array on document create.
readAccessInteger4The access level require to read this property. See Access Control for available values.
writeAccessInteger6The access level require to write to this property. See Access Control for available values.
aclDocument ArrayAllows additional ACL to be specified for property. This acl merges with runtime acl to increase access to this property. Additive only -- these acl entries cannot lessen access to this property.
auditableBooleanfalseWhen true, changes to this property will result in a record in the audit logs.
readableBooleantrueAllow this property to be read. When false, this property is not available through the API and is only available through scripts.
writableBooleantrueWhen true, this property is writable via the API. When false, this property is only writable through scripts.
creatableBooleanfalseWhen true, this property is only writable on document creation.
removableBooleanfalseIf true, this property can be removed from a document using DELETE method. Otherwise, property can only be nullified.
historyBooleanfalseIf true, changes to this property are recorded in a history collection and made available though an audit.history property on the object. Note that the audit.history property is optional and is not returned unless explicitly included with the include option.
optionalBooleanfalseIf true, this property is not included in read operations unless explicitly included with the include option.
indexedBooleanfalseIf true, property is indexed and available for querying. There is a limit of 20 indexed properties per object.
uniqueBooleanfalseIf true, the property will be guaranteed unique. This option can only be set on property definition creation. There is a limit of 5 unique properties per object.
validatorsDocument ArrayA list of validators applied to this property before writing. Failure to validate will result in akValidationError. See Property Validation Options for available validation options.

Property Validation Rules

When defining custom object properties, you can also specify validation rules to apply to your properties in the property definition validators option. You can specify multiple validation rules for a property.

When defined, these rules are evaluated prior to properties being written. Should validation fail for a property, the entire request will fail and a kValidationError fault will be returned for each validation error. When validations faults are returned, property paths are also returned with the faults. This is helpful when relaying validation errors to users in a client UI.

Validation rules take the form:

{
  "name": <validator name>,
  "description": <validator description>,
  "definition": { <validator definition> }
}

*Bold options are required*

NameTypeDescription
nameStringThe name of an available validator for the property. See individual property details for available validators.
descriptionStringA description of the validator
definitionDocumentA document specifying validator options (if available). See individual property validators for available options.