Update an addon settings by sending below payload. Addons can be obtained using GET /api/v1/user/settings
API.
All addons that support event hooks can be updated using this API
Pre-requisite: Addon must be available for the user account. Contact Support if addon is not available for the account.
REQUEST PAYLOAD
{
"event-hooks": {
"file-saved": {
"enabled": false,
"content_types": [
"image/*"
]
},
"disposition": {
"pass_through_fields": [
],
"confidence_threshold": 0.5
},
"file-data-updated": {
"enabled": false,
"content_types": [
"image/*"
],
"schema_criteria": {
"data_schema_id": 1,
"fields": {
"field1": "value1",
"field2": "value2"
}
}
}
}
}
event_hooks
,file-saved
,file-data-updated
,disposition
are mandatory- For
file-saved
,file-deleted
,file-data-updated
keys,enabled
andcontent_types
are mandatory. - For
file-data-updated
,schema_criteria
is also mandatory. - For
disposition
,update_metadata
andpass_through_fields
are mandatory
Parameters | Type | Description |
---|---|---|
event_hooks | JSON | Mandatory value for this API |
file-saved | JSON | Optional. Set enabled to true or false to activate addon on asset upload. Add asset content mime types to content_types list for which the addon should be activated. Subtype of Mime type can be * to activate for all subtypes. |
file-data-updated | JSON | Optional. See description of file-saved above for keys and meaning. |
file-data-updated .schema_criteria | Required. It may be an empty dict. It can optionally specify data_schema_id and fields to match for the asset to activate the addon. See example scenarios below. | |
disposition | JSON | Optional. Specifies how the result of the addon should be used. |
disposition .pass_through_fields | JSON | Applies only to FACE_RECOGNITION addon. Specifies the metadata fields that should be used for filtering Face search. If no fields are specified, all asset metadata fields will be added for Face search filtering. |
disposition .confidence_threshold | number | Applies only to SCENE_CLASSIFICATION , EMOTION_RECOGNITION addons. Specifies the confidence score that should be met for the labels to be added to the asset metadata. Value can be between 0 and 1. |
Example scenarios and addon settings
- To process Face Recognition addon when an image asset is uploaded, set
file-saved
key value as below
"file-saved": {
"enabled": true,
"content_types": [
"image/*"
]
}
- To process Face Recognition addon when custom data is updated for an image asset, set
file-data-updated
key value as below. Note emptyschema_criteria
which allows asset with any or no data schema to be processed."file-data-updated": { "enabled": true, "content_types": [ "image/*" ], "schema_criteria": { } }
- To process Face Recognition addon when custom data following a certain data schema is updated for an image asset, set
file-data-updated
key value as below. Noteschema_criteria
which allows asset with the specific data to be processed.
"file-data-updated": {
"enabled": true,
"content_types": [
"image/*"
],
"schema_criteria": {
"data_schema_id": 1,
"fields": {
"field1": "value1",
"field2": "value2"
}
}
}
Schema Criteria field value matching
Schema field value for file-data-updated
hook can be multi-valued. The asset's metadata value is compared using OR
condition against each of the addon criteria values. For example, to process addon when the asset's metadatafield1
has ABC
or XYZ
, set schema_criteria
as below:-
"file-data-updated": {
"enabled": true,
"content_types": [
"image/*"
],
"schema_criteria": {
"data_schema_id": 1,
"fields": {
"field1": "ABC XYZ"
}
}
}
schema_criteria
.fields
does not support matching of asset metadata field value with spaces such as "PROCESS FR". Asset metadatafield1
must have a single value such as "PROCESS_FR" without any spaces.