Vendor custom fields

Set a vendor custom field value

Writes one custom field value on a vendor, creating it or replacing what was there. Send exactly the property that matches the field's type — the response tells you which that is.

PUT
https://api.portal.magicdoor.com/company-app/vendors/{vendorId}/custom-fields/{customFieldId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

vendorIdstringrequired

The vendor whose custom fields you are working with. A Snowflake id, sent as a decimal string.

example: 1830472847398404100
customFieldIdstringrequired

The custom field definition. A Snowflake id, sent as a decimal string.

example: 1830472847398404200

Body

application/json

Send only the property that matches the custom field's type. A field marked required in its options refuses an empty value. Look the field's type up with list vendor custom fields.

stringValuestring

Set this when the field's type is string and it holds one value.

stringArraystring[]

Set this when the field's type is string and multiple is true.

numberValuenumber

Set this when the field's type is number.

booleanValueboolean

Set this when the field's type is boolean.

dateTimeValuestring · date-time

Set this when the field's type is datetime.

referenceValuestring

Set this when the field's type is reference and it holds one id.

referenceArraystring[]

Set this when the field's type is reference and multiple is true. Sending this replaces the whole list, so it is also how you remove a reference.

referenceFileUploadSessionIdstring

An upload session to commit and store as the single reference value. Only honoured when the field points at files.

referenceFileUploadSessionIdsstring[]

Upload sessions to commit and append to referenceArray. Combine the two in one call to remove and add files at the same time: referenceArray sets the list to keep, and these are appended to it.

Response

200 · The stored value.

customFieldIdstring

The custom field definition this value belongs to.

entityTypeenum<string>

Always vendor here.

entityIdstring

The record the value is attached to.

stringValuestring

The value, when the field's type is string and it holds one value.

stringArraystring[]

The value, when the field's type is string and multiple is true.

numberValuenumber

The value, when the field's type is number.

booleanValueboolean

The value, when the field's type is boolean.

dateTimeValuestring · date-time

The value, when the field's type is datetime.

referenceValuestring

The id pointed at, when the field's type is reference and it holds one value.

referenceArraystring[]

The ids pointed at, when the field's type is reference and multiple is true.

createdstring · date-time

When the value was first set.

updatedstring · date-time

When the value was last changed.

401 · The access token is missing, expired, or does not belong to a property manager.

404 · No custom field with that id exists for the calling company. A record that belongs to another company is reported the same way as one that does not exist. The id you asked for is in `entityId`; `detail` names only the kind of record.

422 · The value breaks the field's own rules — a required field left empty, a value outside the field's allowed list, a number outside its range, or text longer than its maximum.

When the field's options.referenceEntityType is file, upload the file first and send the resulting session id here rather than a file id.

  1. Call create an upload session to get a session and an upload target.
  2. Upload the file to that target.
  3. Call this endpoint with referenceFileUploadSessionIds set to the session ids.

referenceArray and referenceFileUploadSessionIds combine in one call: referenceArray is the list of existing file ids to keep, and the newly uploaded files are appended to it. Sending referenceArray on its own with a shorter list is how you remove a file.