Skip to main content
Question

Trying to delete some folders created by the API

  • May 21, 2025
  • 3 replies
  • 19 views

Forum|alt.badge.img

Hi 

 

I created some test folders last week whilst I was figuting out JWT auth etc. (eventually Successful)

I now have about 4 folders in my box system that were created during this process that I want to delete.

I cannot delete them in the UI - dont get the option

We have a "Business" account not business + or Higer so I cannto delete them in the admin console.

I have tried deleting them using the API with vartiations of the Enterprise token, the App User token as well as using the "As-User" param but I keep getting an "insufficient permissions" 403 error.

 Conld someone point me in the right direction so I can delete a one of these folders?

 

By way of further info, I am including the Fiddler Call and Response.


DELETE https://api.box.com/2.0/folders/***number removed for privacy***06?recursive=true \ HTTP/1.1
Authorization: Bearer jpu25Szl5q0d8Tm6iWpvnfeT9yITYHSf
As-User: ***number removed for privacy***
Host: api.box.com
Connection: Keep-Alive



HTTP/1.1 403 Forbidden
Server: ATS
Date: Mon, 13 Feb 20***phone number removed for privacy***:25:56 GMT
Content-Type: application/json
Content-Length: 224
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-cache, no-store
Vary: Accept-Encoding
Age: 7
Connection: keep-alive

{"type":"error","status":403,"code":"access_denied_insufficient_permissions","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Access denied - insufficient permission","request_id":"***number removed for privacy***258a1d004e1e4b"}

Folder Info:

 

 

3 replies

Forum|alt.badge.img

 

"Access denied - insufficient permission"

 

You probably don't have the right permissions to delete that folder. 

 

1) Check your scopes and

2) Collaborate the service account into that folder and then try again. 


Forum|alt.badge.img

Thanks for the reply, 

 

Can you point me at instructions on how to check scopes?

I have an users identiefed by Enterprise tokens, App User tokens and i can alsu use the "as-user" option, which of these is the "service account"?

 

Regards


Forum|alt.badge.img