Skip to main content
Question

I want to use the box API to set the tag blank

  • May 22, 2025
  • 3 replies
  • 4 views

Forum|alt.badge.img
I want to use the box API to set the tag blank, but I set the "tags": null or "tags": "" it doesnt work.
curl
-i -X PUT "https://upload.box.com/api/2.0/files/12345" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "tags": null }'

3 replies

Forum|alt.badge.img

Hello Dan, 

Can you please provide some more information about the use case and what you're trying to accomplish here? By default, there won't be any tags, so setting tags to null shouldn't be necessary. Are you trying to remove tags from a file? If so, you can't do that using the file upload endpoint. You'll need to call the update file endpoint instead. 

Best,

Kourtney, Box Developer Advocate


Forum|alt.badge.img

Hello Kourtney,

Thank you for your reply. yes, I want to remove the tag.I used update file endpoint, The parameters are set as follows,but still can't remove tag to null

-d '{

"tags": null

}'

-d '{

"tags": ""

}'


Forum|alt.badge.img

If you want to remove all tags the body of your update file call needs to be: 

{"tags": []}