Endpoint
POST https://api.ugc.inc/media/update-tag
Overview
Update tags on one or more media items. Works for both user-uploaded media and social audio. Supports bulk updates with different tags for each item in a single request.
Request Body
Bulk Update (Recommended)
Array of update objects, each containing: The ID of the media item to update
The new tag value for this item
Single Update (Deprecated)
The ID of the media item to update (deprecated - use updates array instead)
The new tag value (deprecated - use updates array instead)
Response
Array of update results, one for each item in the request: Whether the update succeeded
The updated media object (only present if successful)
Error message (only present if failed)
cURL (Bulk)
Python (Bulk)
JavaScript (Bulk)
React (Bulk)
curl -X POST https://api.ugc.inc/media/update-tag \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"updates": [
{ "id": "media_abc123", "tag": "featured" },
{ "id": "media_def456", "tag": "archive" },
{ "id": "media_ghi789", "tag": "featured/videos" }
]
}'
Success Response (All Succeeded)
Partial Success Response
Error Response (All Failed)
{
"ok" : true ,
"code" : 200 ,
"data" : {
"results" : [
{
"id" : "media_abc123" ,
"success" : true ,
"media" : {
"id" : "media_abc123" ,
"org_id" : "org_xyz789" ,
"name" : "video.mp4" ,
"tag" : "featured" ,
"type" : "video" ,
"url" : "https://api.ugc.inc/media/file/media_abc123" ,
"created_at" : "2024-01-15T10:30:00.000Z" ,
"media_type" : "user_media"
}
},
{
"id" : "media_def456" ,
"success" : true ,
"media" : {
"id" : "media_def456" ,
"org_id" : "org_xyz789" ,
"name" : "image.jpg" ,
"tag" : "archive" ,
"type" : "image" ,
"url" : "https://api.ugc.inc/media/file/media_def456" ,
"created_at" : "2024-01-14T09:00:00.000Z" ,
"media_type" : "user_media"
}
}
]
},
"message" : "Successfully updated 2 media item(s)"
}