Skip to main content
Question

Access Denied to Service Account Reading/Writing Files (when added as collaborator)

  • May 23, 2025
  • 1 reply
  • 15 views

Forum|alt.badge.img

Hello!

I'm new to Box API and have struggled to find clear answers about how to resolve this particular problem. I have been working with JWTAuth to authenticate a service account that I have previously added as a collaborator in the folders/directories that it needs access to. However, I'm being met with an "access_denied_insufficient_permissions" exception.

 

Any help would be greatly appreciated! Thank you!

Here's the code that I've been using (utilizing Box's Python SDK):

from boxsdk import JWTAuth, Client

config = JWTAuth.from_settings_file('data/auth_config.json')
client = Client(config)

items = client.folder(folder_id='[MY FOLDER ID]').get_items()
for item in items:

... (and so on)

1 reply

Forum|alt.badge.img

Hi Ethan,

From your description this should have worked just fine.

For example I have a Folder named "Shared with JWT", and when I list the collaborators you can see the JWT user

BOX1_D2VnEWX1iTJ3oC3fwuF4Bg.png

When I list this using the API, JWT can see the folder.

For example, who am I:

❯ box users:get --csv --fields type,id,name,login
type,id,name,login
user,20130487697,JWT,AutomationUser_1827756_bs5C1GfCgv@boxdevedition.com

List my root items:

❯ box folders:items 0 --csv --fields type,id,name
type,id,name
folder,172800574368,Shared with JWT
folder,178236212260,100k
folder,198776374510,Folders to be deleted
folder,172760191314,JWT App Folder
folder,198775215357,JWT Folder
folder,198775845609,JWT Folder for UI Sample Apps
folder,172801649008,My Box Notes
folder,169047753928,UI Elements Demo
file,1039371254466,my_new_uploaded_file.py

So the issue must be some sort of configuration.

Can you check if your folder is in fact shared with the correct service account, and it shows up in the collaborators list?