APIerS methods for Shared Groups in DataDB

62 views
Skip to first unread message

Salvinder Parhar

unread,
May 7, 2026, 10:24:56 AM (9 days ago) May 7
to CGRateS
Hello CGRateS team,

I'm just getting familiar with Shared Groups, and its use cases, and I'm realizing that its still a half baked solution. Only below APIerS methods are available to interact with Shared Groups in StorDB:

APIerSv1.GetTPSharedGroupIds
APIerSv1.GetTPSharedGroups
APIerSv1.SetTPSharedGroups
APIerSv1.RemoveTPSharedGroups
APIerSv1.LoadSharedGroup

APIerSv1.GetSharedGroup (Except for this method to query the Shared Group in DataDB, but one needs to know the ID of the Shared Group to even use this APIerS method)

There is currently no way to GET_IDs/SET/REMOVE Shared Groups in DataDB. Is this by design? Are there plans to complete the Shared Groups implementation?

Thanks,
Sal

Armir Veliaj

unread,
May 11, 2026, 12:02:26 PM (5 days ago) May 11
to CGRateS
Hi Sal,

SharedGroup was the initial approach for handling shared balances in CGRateS. However, after AttributeS was introduced, it became more used in real implementations due to its flexibility and simpler design.

SharedGroup is still functional, but if you haven’t checked it before, you may consider using AttributeS instead.

For a better understanding with examples, this thread might help:
https://groups.google.com/g/cgrates/c/oF4ANRdgzvI/m/IW-vFtarGQAJ

Thanks,
Armir

Salvinder Parhar

unread,
May 11, 2026, 2:09:20 PM (5 days ago) May 11
to CGRateS
Thanks Armir. Yes, I did look into that thread and other related threads where SharedGroups was discussed.
SahredGroup is functional, but I'd say partially functional. For example, right now there is no way to interact with SharedGroups that are already loaded into DataDB. Most critical is no way to delete or update a SharedGroup in DataDB directly, without flushing the complete DataDB. And I also read in one the previous GitHub issues, where Gezim mentioned that the only supported way to set and assign SharedGroups to balances is via CSV files, which completely defeats the purpose in my case where everything is done via APIerS methods.
And even though AttributeS can help achieve the same result when I want to share and debit from the same balance for multiple accounts, by changing the Account field in the incoming event to match the Account ID that holds the shared balance, but this will either require adding a AttributeProfile per account to overwrite the Account field in the event, or one AttributeProfile with multiple filters to catch multiple Accounts and overwrite accordingly. And most critically, no visibility at the Account level that it is using a shared balance via the use of AttributeProfiles. Will easily become a bit messy in the long-term in my opinion.
Whereas SharedGroup IDs are assigned at the balance level, easily visible when an Account is queried.  

Thanks,
Sal

Armir Veliaj

unread,
May 13, 2026, 9:54:38 AM (3 days ago) May 13
to CGRateS
Hi Sal,

You can open an issue on our GitHub by listing some of the APIs that you may think are needed as extra for SharedGroups.

We may consider extending its functionality in the future, if we find a bit of time and more interest is shown in its use.

Thanks,
Armir

Salvinder Parhar

unread,
May 13, 2026, 10:12:01 AM (3 days ago) May 13
to CGRateS
Thanks Armir. I'll open a Github issue for this. 
Reply all
Reply to author
Forward
0 new messages