Set a unit custom field
Writes one custom field's value on a unit. Send only the value key that matches the field's type; the write replaces whatever was there.
Authorization
AuthorizationstringrequiredPath parameters
unitIdstringrequiredSnowflake id of the unit, as a decimal string.
customFieldIdstringrequiredSnowflake id of the custom field definition, from the list-custom-fields response on this unit.
Body
application/json
Send exactly the one field that matches the custom field's options.type. Anything you leave out is cleared, so this replaces the stored value rather than merging into it. The value is validated against the field's own options — a string field with values and rejectUnknown refuses anything outside its list, a number field refuses anything outside min and max.
stringValuestringFor a string field holding one value.
stringArraystring[]For a string field with options.multiple set.
numberValuenumberFor a number field.
booleanValuebooleanFor a boolean field.
dateTimeValuestring · date-timeFor a datetime field. Send a wall clock in the company's timezone with no offset, for example "2029-04-30T00:00:00".
referenceValuestringFor a reference field holding one id. Snowflake id of whatever options.referenceEntityType names.
referenceArraystring[]For a reference field with options.multiple set.
referenceFileUploadSessionIdstringFor a file-reference field: the id of one completed upload session, from the upload-sessions endpoint on this same custom field. The uploaded file becomes the field's value.
referenceFileUploadSessionIdsstring[]For a file-reference field holding several files: ids of completed upload sessions. Append-only — the files these name are added to whatever the field already references.
Response
200 · The stored value.
customFieldIdstringThe custom field this value belongs to.
entityTypeenum<string>What kind of record the value hangs off.
entityIdstringThe record the value hangs off.
stringValuestringThe answer, when the field's options.type is string and it holds a single value.
stringArraystring[]The answers, when the field's options.type is string and options.multiple is set.
numberValuenumberThe answer, when the field's options.type is number.
booleanValuebooleanThe answer, when the field's options.type is boolean.
dateTimeValuestring · date-timeThe answer, when the field's options.type is datetime. A wall clock in the company's timezone, with no offset.
referenceValuestringThe id pointed at, when the field's options.type is reference and it holds a single value.
referenceArraystring[]The ids pointed at, when the field's options.type is reference and options.multiple is set.
createdstring · date-timeWhen the value was first set.
updatedstring · date-timeWhen the value last changed.
referenceFilesobject[]The files behind referenceValue and referenceArray, expanded, when the field points at files. Absent otherwise.