# Error 500 when sharing a folder to a group via API

**URL:** <https://community.passbolt.com/t/error-500-when-sharing-a-folder-to-a-group-via-api/12841>\
**Category:** API & Customization issues\
**Created:** [April 29, 2025, 8:10pm UTC](https://community.passbolt.com/t/error-500-when-sharing-a-folder-to-a-group-via-api/12841 "2025-04-29T20:10:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicolasPHP](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@NicolasPHP](https://community.passbolt.com/u/NicolasPHP)\
**Post date:** [April 29, 2025, 8:10pm UTC](https://community.passbolt.com/t/error-500-when-sharing-a-folder-to-a-group-via-api/12841/1 "2025-04-29T20:10:48Z")

</div>

Hello, when i try to share a folder to a group, i have an error 500 “Internal server error”.  
The API documentation is not clear how to share a folder.

After login to my instance, i call [https://cloud.passbolt.com/[myOrg]/share/folder/](https://cloud.passbolt.com/%5BmyOrg%5D/share/folder/)[uuid folder].json with this json : {“permissions”:{“type”:1,“aro”:“Group”,“aro\_foreign\_key”:“UUID group”,“is\_new”:true}}

Instance is hosted by Passbolt on their cloud.

Anyone have an idea ?

---

<div class="post-metadata">

**Author:** ![remy](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/remy/32/17_2.png) [@remy](https://community.passbolt.com/u/remy)\
**Post date:** [April 30, 2025, 8:12am UTC](https://community.passbolt.com/t/error-500-when-sharing-a-folder-to-a-group-via-api/12841/2 "2025-04-30T08:12:05Z")

</div>

> [@External Image](https://avatars.discourse-cdn.com/v4/letter/n/da6949/48.png):
>
> Hosted by Passbolt on their cloud.

Hello, you can contact [support@passbolt.com](mailto:support@passbolt.com) and we’ll try to help you out from there since it’s the cloud.

---

<div class="post-metadata">

**Author:** ![pabloelcolombiano](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/pabloelcolombiano/32/5864_2.png) [@pabloelcolombiano](https://community.passbolt.com/u/pabloelcolombiano)\
**Post date:** [April 30, 2025, 9:59am UTC](https://community.passbolt.com/t/error-500-when-sharing-a-folder-to-a-group-via-api/12841/3 "2025-04-30T09:59:50Z")

</div>

Hi @NicolasPHP ,

The payload should be:

`{"permissions":[{"aro":"Group","aro_foreign_key":"778fe87b-dc18-3603-ad7f-af773b5aa879","type":1,"is_new":true}]}`

Does this work for you?

More on sharing using the API [here](https://www.passbolt.com/docs/api/#tag/Shares).

And indeed the 500 is not the right response code from the API. We will work on a fix for that. Thank you for the hint!

Best,  
Juan

---

<div class="post-metadata">

**Author:** ![NicolasPHP](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@NicolasPHP](https://community.passbolt.com/u/NicolasPHP)\
**Post date:** [April 30, 2025, 12:02pm UTC](https://community.passbolt.com/t/error-500-when-sharing-a-folder-to-a-group-via-api/12841/4 "2025-04-30T12:02:37Z")

</div>

Yeah thank you, it works 😀  
I missed the array 😅
