Guides

Update Addons Settings

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 and content_types are mandatory.
  • For file-data-updated, schema_criteria is also mandatory.
  • For disposition, update_metadata and pass_through_fields are mandatory
ParametersTypeDescription
event_hooksJSONMandatory value for this API
file-savedJSONOptional. 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-updatedJSONOptional. See description of file-saved above for keys and meaning.
file-data-updated.schema_criteriaRequired. 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.
dispositionJSONOptional. Specifies how the result of the addon should be used.
disposition.pass_through_fieldsJSONApplies 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_thresholdnumberApplies 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 empty schema_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. Note schema_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 metadata field1 must have a single value such as "PROCESS_FR" without any spaces.

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!