Printago API
GET /v1/custom-metadata-definitions/coercion-preview

Preview typing a custom field

Dry-run for typing a key: reports how many stored values would not survive the type so the client can name them before anything is written. The report names raw stored values and entity ids, so it carries the same permission as the define it precedes rather than being open to any member.

Requires: routing.manage

Query Parameters

entityType required
string
key required
string
valueType required
string
enumValues optional
string

Response Schema

CustomMetadataCoercionReport
incompatiblerequired
object[]
A capped sample of the offending rows, for naming them in the dialog.
idrequired
string
valuerequired
any
incompatibleTotalrequired
number
How many of those cannot be represented as the target type — counted over every matching row, not over the sample below.
totalrequired
number
Rows of this entity type currently holding a value for the key.

Example Response

200 OK — application/json
{
  "total": 1,
  "incompatibleTotal": 1,
  "incompatible": [
    {
      "id": "string"
    }
  ]
}