Skip to content

Create a field

Request

Create a Field resource.

Security
bearerToken
Bodyapplication/jsonrequired
namestringrequired

Human-readable name of the Field

Example:"Folders"
dataTypestringrequired

Defines the format the data can take

  • STRING: Any format
  • DATE: Dates in the ISO date format
  • DATE_TIME: Date Times in the ISO datetime format
Enum:"STRING""DATE""DATE_TIME"
Example:"STRING"
multiValuebooleanrequired

If true an Asset can be assigned multiple values for this Field. If false an Asset can only be assigned a single value for this Field.

e.g. An Asset can only have a single Title but could be assigned multiple Tags.

Example:true
hasFixedOptionsbooleanrequired

If true the possible values for this Field are taken from a fixed set. If false the possible values for this Field are unrestricted.

The set of fixed values for an Field are defined by the FieldOption resource.

If true the values in the Asset.metadata.values map reference an FieldOption.id. If false the values in the Asset.metadata.values map contain the human-readable value.

Example:true
hierarchicalbooleanrequired

Only applicable when Field.hasFixedOptions = true.

If true the fixed set possible values for the Field form a hierarchical tree structure. An optional FieldOption.parent specifies the FieldOption of it's parent in the tree. If FieldOption.parent = null the FieldOption sits at the root of the tree.

Example:true
editControlstringrequired

An indication of the type of edit control would be sensible to use to edit the Field

Enum:"SINGLE_LINE_TEXT""TEXT_AREA""TAGS""CONTROLLED_TAGS""DROPDOWN""CHECKLIST""FOLDER_PICKER""PRODUCT_PICKER""DATE_PICKER""DATE_TIME_PICKER"
Example:"FOLDER_PICKER"
contributorsCanCreateFieldOptionsboolean

If true, admins and contributors can create FieldOption resources for this Field. If false, FieldOption creation uses the existing folder-specific permission logic.

Default:false
Example:true
recommendedbooleanrequired

If true it is recommended for assets to have a value for this Field. Clients should highlight missing recommended values during creation and editing of assets. Clients can also use the FIELD_IS_EMPTY criterion in an AssetSearch to find assets with missing recommended values.

Example:true
defaultSortFieldstring or null

The sort to use when searching for FieldOptions related to this Field if no sort is provided.

Enum:"FIELD_ID""PARENT_ID""VALUE""ID""POSITION"
Example:"FIELD_ID"
browsablebooleanrequired

If true assets with a value for this Field can be browsed in the Browse page.

Example:true
curl -i -X POST \
  https://api-v2.dash.app/fields \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Folders",
    "dataType": "STRING",
    "multiValue": true,
    "hasFixedOptions": true,
    "hierarchical": true,
    "editControl": "FOLDER_PICKER",
    "contributorsCanCreateFieldOptions": true,
    "recommended": true,
    "defaultSortField": "FIELD_ID",
    "browsable": true
  }'

Responses

Success

Bodyapplication/json
resultobjectrequired
permittedActionsArray of objectsrequired
Response
{ "result": { "id": "a52b5315-15b8-417f-b742-d6902108bac1", "accountId": "cfb665ca-ce35-4418-b9d5-70ee815db4bd", "name": "Folders", "dataType": "STRING", "multiValue": true, "hasFixedOptions": true, "hierarchical": true, "editControl": "FOLDER_PICKER", "contributorsCanCreateFieldOptions": true, "indestructible": true, "recommended": true, "defaultSortField": "FIELD_ID", "browsable": true, "entityType": "ASSET", "lookupType": "PRODUCT_VARIANT_CRITERION" }, "permittedActions": [ {} ] }