Asset Relations

Create asset relations by public ID

POST
/v1_1/{cloud_name}/resources/related_assets/{resource_type}/{type}/{public_id}

Relates an asset to other assets by public IDs. This allows you to indicate that the asset is logically related to other assets in some way (e.g., similar content, or a peripheral asset like video/transcript, etc). This is a bidirectional process, meaning that the asset is also added as a related_asset to all the other assets specified. The relation is also a one to many relationship, where the asset is related to all the assets specified, but those assets aren't also related to each other.

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.

resource_type*string

The type of resource (image, video, or raw).

Value in

  • "image"
  • "video"
  • "raw"
type*string

The delivery type of the asset.

Default"upload"

Value in

  • "upload"
  • "private"
  • "authenticated"
public_id*string

The public ID of the asset.

Request Body

application/json

The assets to relate by public ID.

The asset relation request.

assets_to_relate*array<string>

Relates the asset to all the other assets specified in this array of up to 10 assets, specified as resource_type/type/public_id.

Itemsitems <= 10

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/resources/related_assets/image/upload/sample" \  -H "Content-Type: application/json" \  -d '{    "assets_to_relate": [      "string"    ]  }'
{  "failed": [    {      "message": "string",      "code": "rejected_ids",      "asset": "string",      "status": 0    }  ],  "success": [    {      "message": "string",      "code": "rejected_ids",      "asset": "string",      "status": 0    }  ]}