Filtering Devices by Custom Metadata

When listing devices, you can filter by custom metadata.

When you use List Devicesarrow-up-right, you can filter the list by one or more custom metadataarrow-up-right pairs. Include the custom_metadata_has parameter with a JSON string that specifies the desired key:value pairs.

circle-info

You can use the Update Connected Accountarrow-up-right method with the optional custom_metadata property to add custom metadata for a device.

Request:

const devices = await seam.devices.list({
  custom_metadata_has: {
    "internal_account_id": "user-1"
  }
});

console.log(devices);

Response:

[
  {
    device_id: 'f7a7fb02-9277-4354-8dd1-28e2d016a7a9',
    device_type: 'schlage_lock',
    ...
    is_managed: true,
    custom_metadata: { internal_account_id: 'user-1' }
  },
  ...
]

Last updated

Was this helpful?