Skip to main content

Create custom Asset fields with the API

Define custom Asset fields and set their values when you create or update Assets through the Mobaro Public API.

Written by Logan Bowlby

Overview

Use custom fields to store information specific to your Assets, such as a maximum load or an inspection reference. Define each field for your organization, then send its value when you create or update an Asset through the Mobaro Public API.

At a glance

Who can do this

An integration with a write-enabled API key. API keys are created by a Super User or a user with Organization › Administrate.

Where

Public API: /api/customers/custom-fields/Asset and /api/customers/assets

Works on

Public API

Availability

API access, enabled per organization by Mobaro — ask your CSM

Use a key that is not Read-only and send it in the x-api-key header. Keep the key in a secure server-side store. See Get started with the Mobaro API.


Create a custom field

1. Check existing definitions

Send this request to list your organization’s Asset custom field definitions. Use Asset as the resource type.

GET https://app.mobaro.com/api/customers/custom-fields/Asset
x-api-key: YOUR_API_KEY

Choose a new key that is not already in the list. Keys are case-sensitive and must start with a lowercase letter, followed only by letters or numbers. For example, maxLoad is valid. Keep the key stable; you can change its label later.

2. Create the definition

Send one request for each definition. This example creates an optional number field measured in kilograms.

POST https://app.mobaro.com/api/customers/custom-fields/Asset
x-api-key: YOUR_API_KEY
Content-Type: application/json

{
"key": "maxLoad",
"type": "number",
"unit": "kg",
"required": false,
"labels": { "en": "Maximum load" }
}

The response contains the key in id. Send the list request again to check the definition.


Choose field options

Field

What to send

key

A unique, case-sensitive key for the Asset resource type.

type

text, longText, number, date or bool.

unit

Optional; only for number, for example kg.

required

true or false; defaults to false.

labels

An object of supported language codes and labels. Include at least one non-empty label, such as {"en": "Maximum load"}.

The default limit is 100 definitions per resource type; your organization’s configured limit can differ. The available resource type is Asset.


Set values on Assets

Use each definition’s exact key as a property inside customFields. Values must match the defined type. Use JSON strings for text and dates, numbers for number fields, and true or false for boolean fields.

1. Create an Asset with a value

Include customFields in the Asset create request, with a valid Location ID. Include values for every definition marked required.

POST https://app.mobaro.com/api/customers/assets
x-api-key: YOUR_API_KEY
Content-Type: application/json

{
"name": "Example lift motor",
"location": "locations/123456-A",
"customFields": { "maxLoad": 1200 }
}

Replace the example Location ID with your own. A successful create returns the new Asset ID.

2. Update an existing Asset

Send the Asset ID in the path and include only the custom field values you want to change.

PUT https://app.mobaro.com/api/customers/assets/123456-A
x-api-key: YOUR_API_KEY
Content-Type: application/json

{
"customFields": { "maxLoad": 1500 }
}

The update merges the supplied keys. Other custom field values stay as they are. To clear an optional value, send its key with null, for example "maxLoad": null. You cannot clear a required field.

3. Check the saved values

Retrieve the Asset and inspect the customFields object in the response.

GET https://app.mobaro.com/api/customers/assets/123456-A
x-api-key: YOUR_API_KEY

For the complete request schemas, see Create an asset and Update an asset. The Asset API is marked beta and may change.


Change or remove definitions

To change a definition, send PUT /api/customers/custom-fields/Asset/{key} with its full definition settings: type, unit, required and labels. The key is in the path and cannot be renamed through this request. Check existing values before changing a type or making a field required.

To remove a definition, send DELETE /api/customers/custom-fields/Asset/{key}. If an Asset still has a value for that key, the API returns 409 Conflict; clear the values first. Required fields cannot be cleared while they are required.


Best practices

  • Choose stable, descriptive keys and agree on their meaning before other integrations use them.

  • Test the definition and Asset requests with a small set of example Assets before a bulk import.

  • Review the effect on existing values before changing a definition, especially its type or required setting.

  • Use a separate API key for each integration and retry after a rate-limit response.


Frequently asked questions

Why does my custom field request return 400?

Check that the key is defined for Asset, matches the definition’s capitalization, and that the value matches its type. On Asset creation, include all required custom fields.

Can I use a read-only API key to set custom field values?

No. Creating or updating custom field definitions and Asset values requires a key that is not Read-only.

Will updating one custom field erase the others?

No. An Asset update merges the keys you send in customFields. Omitted keys stay unchanged; send null for an optional key to clear it.

Why can’t I delete a custom field definition?

The API returns 409 Conflict if an Asset still holds a value for that custom field. Clear those values first. If the field is required, change its definition before clearing it.

Can I create an Asset custom field in the Backend?

Use the Public API to create Asset custom field definitions and set their values. The API reference lists the available definition and Asset operations.

Did this answer your question?