Error "list of permissions should contain at least one permission key" when using /rest/api/3/permissions/check endpoint

Hi all,

I am trying to use the Get Bulk Permissions endpoint /rest/api/3/permissions/check to do a sweep on permissions (doing an internal audit of the environment) and I am getting this error:

{“errorMessages”:,“errors”:{“permissions”:“The list of permissions should contain at least one permission key”}}

Yet my payloads are variations of: {“accountId”: “6140a341eaef340069SANITISED”, “projectPermissions”: [{“permissions”: [“ADD_COMMENTS”]}, {“projects”: [10035]}]}

I have added more elements to the array (from one to literally all of the project permissions) added empty arrays for the missing parameters, added the global permissions, and various other combinations. Otherwise I am admin of that sandbox and able to use other endpoints just fine.
Any thoughts on what could be triggering the error? Fresh pair of eyes much welcomed :slight_smile:
Many thanks!

Hello @juanespasandin

You’ve made a mistake in the JSON structure of the body of the request. The projects array needs to be directly inside a projectPermissions object. You’ve wrapped the projects array with another another set of brackets, which makes it a separate object.

The request body should be:

  “accountId”: “6140a341eaef340069SANITISED”,
  “projectPermissions”: [
      “permissions”: [
      “projects”: [
1 Like

It worked! What an expert pair of eyes can do… I had given up in trying variations of brackets :slight_smile:

(apologies for the delay in coming back, I hadn’t had time to go back to this one, now I will crack on into parsing the results but at least I got through this rather frustrating first bump)

Many thanks , really appreciated!