Skip to main content
POST
Create data type

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json

Data type definition. The v4 field model adds field types, validations, relations, unique together, column settings and Master Data extensions.

name
string
required

Name of data type. Example: OutletDetail

fields
object[]
required

List of fields to data type . Example: { 'id': 'dataId', 'title': 'Data ID', 'type': 'text', 'optionData': [], 'required': true, 'primaryKey': true }

limitUser
boolean

Setting to limit data source usage by users. Default: false

commonData
boolean

Settings to define the data source to be unique by hub or shared across all hubs. This setting is not changeable after creation. Default: false

provider
enum<string>
default:internal

The data source provider type. Default: internal Available values: internal, external-api (external GET API)

Available options:
internal,
external-api
providerConfig
object

For internal provider

extends
object

Makes this data type the Extended data of a MileApp entity: its records hold the custom fields read back as extendedData with include=extendedData. One extension per entity per organization. An extension keeps its own name; any other type may not take a Master Data name (user, hub, vehicle, role, tasktype and their translations), refused with failedCode dtype-037.

uniqueTogether
string[][]

Combinations of two or more field ids whose values together must not repeat within a hub. primaryKey, hasOne and hasMany fields cannot join one. The same combination twice is refused. Example: [["outlet","product"]]

columnOrder
string[]

Order of the Data Source table columns: _select, _no, field ids, then createdBy, createdTime, updatedTime, hub, limitUser. Unknown ids are dropped on read.

metaColumns
object[]

Visibility of the non-field columns. Example: [{"id":"createdBy","show":true}]

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

data_type
object

Detail of object data type.