Asset Types

Definition

Every Asset has an Asset Type, which describes the properties an Asset can have along with the valid values for those properties.
These properties can be simple values like strings, numbers, or dates. They can also be complex values or references to other Assets or other types of things, like Users or videos.

Attributes

Asset Types have the following attributes:

  • id - The Asset Type ID.
  • createdAt - The date and time a User created the Asset Type.
  • updatedAt - The last date and time a User updated the Asset Type.
  • creator - The User who created the Asset Type.
  • account - The Account where this Asset Type is used.
  • name - The name of the Asset Type. This doesn’t need to be unique.
  • fields - This attribute describes the properties of the Asset Type. It is a complex object inspired by JSON schema but with significant differences. It’s primarily for use by Unearth clients because it provides important information and a more convenient format than the schema attribute.
  • schema - This attribute provides a JSON schema which a User can use to validate the properties of an Asset. The value of the schema attribute is used internally when validating the creation or modification of Assets. This is generated from the “fields” attribute.

Asset Type Fields

An Asset Type can have the following fields:

FieldTypeUse
commentstringComment-specific text field
stringstringGeneric text field
booleanbooleanBoolean value
datetimenumbertimestamp in numeric format
datenumertimestamp in numeric format
areanumberArea-specific numeric value
attachmentsobjectattachment-specific object
textstringtext field
numbernumbernumeric field
lengthnumbernumeric field
namestringAsset Name (treated separately from other text fields)
mediaIdstringmedia reference
paragraphstringlonger text field
volumenumbervolume-specific numeric field
geometryobjectasset geometry reference (point/line/ploygon)
objectobjectgeneric object field
objRefstringreference to another Unearth asset
arrayarraygeneric array field
enumstringone of a set of text values

How to use Asset Types

Through the UI

Asset Type names are the only thing that can be edited through the UI, via the Data Center you can see all your asset types and modify the name.

Through the API

While creating Asset Types isn’t exposed publicly, you can retrieve Asset Types from the API directly, as an attribute on an Asset, or on an Asset’s form.