Metadata

This page provides detailed descriptions of a list of non-indexed fields of face entities.

We offer a metadata field to allow users to store more customized data.

Metadata is a list of at most ten items, each following the format below.

{
  "name": "sample_name",
  "type": "string",
  "value": "sample_string"
}

The name field can be anything you want, except some reserved values, id,instanceId,model,collection,key,createdAt,updatedAt,expiresAt. The name field does not allow duplication. The type field must be mentioned to help our service understand the data type. Currently, we offer 4 self-explanatory data types, sting, integer (int32), boolean, and float (float32). The input value should obey its data type. Otherwise, an error will occur. There is no length limit on the string type, but if the string is over 5 MB, the HTTP code 413 will be returned.

Since the metadata fields are not indexed, they cannot be used as pre-filtering conditions in the list or the search API.

❗️

Updating

Please make sure to include all metadata fields when updating. Otherwise, you might lose your data.

Due to the flexibility of the metadata field, it can only be treated as a whole, meaning that when trying to update the face entity, you should mention all fields in metadata. Suppose you already have four items in a face entity and want to update the age item to "28". Please update as the "Correct update body" to get the ideal update result. If you use the "Wrong update body", you will only keep the age item but lose all other fields.

"metadata": [
   {
     "name": "name",
     "type": "string",
     "value": "John"
   },
   {
     "name": "age",
     "type": "integer",
     "value": 27
   },
   {
     "name": "male",
     "type": "boolean",
     "value": true
   },
   {
     "name": "point",
     "type": "float",
     "value": 10.5
   }
]
"metadata": [
   {
     "name": "name",
     "type": "string",
     "value": "John"
   },
   {
     "name": "age",
     "type": "integer",
     "value": 28
   },
   {
     "name": "male",
     "type": "boolean",
     "value": true
   },
   {
     "name": "point",
     "type": "float",
     "value": 10.5
   }
]
"metadata": [
   {
     "name": "age",
     "type": "integer",
     "value": 28
   }
]