Metadata Rules

Creates a new conditional metadata rule

POST
/v1_1/{cloud_name}/metadata_rules

Creates a new metadata rule with the specified properties and configuration.

Authorization

AuthorizationBasic <token>

Basic authentication using Cloudinary API Key and API Secret.

In: header

Path Parameters

cloud_name*string

The cloud name of your product environment.

Request Body

application/json

The metadata rule to create.

metadata_field_id*string

The ID of the metadata field this rule applies to.

name*string

A descriptive name for the metadata rule.

condition*

The condition that triggers this rule. Ensure it adheres to the metadata rule condition schema.

result*

The result to apply when the rule's condition is met. At least one property must be set.

Properties1 <= properties
state?state_enum

The state of the rule.

Value in

  • "active"
  • "inactive"
position?integer

The position/order of this rule relative to other rules.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/metadata_rules" \  -H "Content-Type: application/json" \  -d '{}'
{  "metadata_field_id": "string",  "name": "string",  "condition": {},  "result": {    "apply_value": {      "value": "string",      "mode": "default"    },    "disable": true,    "enable": true,    "hide": true,    "activate_values": "all",    "set_mandatory": true  },  "state": "active",  "position": 0,  "external_id": "string",  "condition_signature": "string"}