Metadata Fields

Creates a new structured metadata field in your account

POST
/v1_1/{cloud_name}/metadata_fields

Creates a new metadata field 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 field definition.

type*string

The type of the metadata field.

Value in

  • "string"
  • "integer"
  • "date"
  • "enum"
  • "set"
external_id?string

The external ID of the metadata field.

Lengthlength <= 255
label*string

The label of the metadata field.

Lengthlength <= 255
mandatory?|

Whether the metadata field is mandatory.

default_value?||

The default value of the metadata field.

default_disabled?|

Whether the field is disabled in the UI by default.

validation?|

The validation defined for the metadata field.

restrictions?|

Controls UI visibility and editability of the field. All three keys are always returned; any omitted key on input defaults to false.

group?|

The group used to organize this metadata field into a collapsible section in the UI. Defaults to "default". Purely presentational — it does not affect rules, search, or value validation.

datasource?|

The datasource defined for the metadata field.

allow_dynamic_list_values?|

Whether the metadata field allows adding new options to the datasource dynamically.

alphabetically_sorted?boolean

Whether datasource values are maintained in case-insensitive alphabetical order. When true, values are automatically sorted on insert and update. Default false.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/metadata_fields" \  -H "Content-Type: application/json" \  -d '{}'
{  "type": "string",  "external_id": "string",  "label": "string",  "mandatory": true,  "default_value": "string",  "default_disabled": true,  "validation": {},  "restrictions": {    "readonly_ui": true,    "hidden_ui": true,    "excluded_from_search": true  },  "group": "string",  "datasource": {    "values": [      {        "external_id": "string",        "value": "string",        "position": 0,        "state": "active"      }    ]  },  "allow_dynamic_list_values": true,  "alphabetically_sorted": true}