Portfolios

Set a portfolio custom field

Writes one custom field's value on a portfolio. Send only the value key that matches the field's type; the write replaces whatever was there.

PUT
https://api.portal.magicdoor.com/company-app/portfolios/{portfolioId}/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

portfolioIdstringrequired

Snowflake id of the portfolio, as a decimal string.

example: 1830472847398404096
customFieldIdstringrequired

Snowflake id of the custom field definition, from the list-custom-fields response on this portfolio.

example: 1830472847398404099

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.

stringValuestring

For a string field holding one value.

stringArraystring[]

For a string field with options.multiple set.

numberValuenumber

For a number field.

booleanValueboolean

For a boolean field.

dateTimeValuestring · date-time

For a datetime field. Send a wall clock in the company's timezone with no offset, for example "2029-04-30T00:00:00".

referenceValuestring

For a reference field holding one id. Snowflake id of whatever options.referenceEntityType names.

referenceArraystring[]

For a reference field with options.multiple set.

referenceFileUploadSessionIdstring

For 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.

customFieldIdstring

The custom field this value belongs to.

entityTypeenum<string>

What kind of record the value hangs off.

leaseunitpropertyportfoliocompanytenantvendormaintenanceRequestworkOrderbilltransactionchatchatMessagepropertyManagerunknownrentalApplicationleaseTemplateleaseDocumentassociationViolationownerunitListingfileworkOrderGroup
entityIdstring

The record the value hangs off.

stringValuestring

The 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.

numberValuenumber

The answer, when the field's options.type is number.

booleanValueboolean

The answer, when the field's options.type is boolean.

dateTimeValuestring · date-time

The answer, when the field's options.type is datetime. A wall clock in the company's timezone, with no offset.

referenceValuestring

The 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-time

When the value was first set.

updatedstring · date-time

When the value last changed.

referenceFilesobject[]

The files behind referenceValue and referenceArray, expanded, when the field points at files. Absent otherwise.

400 · The value does not fit the custom field — wrong key for its type, outside its allowed range, or not one of its listed choices. The response carries an `errors` member mapping each rejected field name to its message.

401 · The access token is missing, expired, or not for this company.

404 · No portfolio or no custom field with that id, or one of them belongs to another company.