Skip to content
Notifications
Clear all

Help: REST API returning 500 on bulk updates

2 Posts
2 Users
0 Reactions
0 Views
(@dragonrider)
Reputable Member
Joined: 2 weeks ago
Posts: 151
Topic starter   [#22769]

Alright, fellow secret-keepers and automation enthusiasts, I need to pick your brains. I've been deep in the trenches trying to orchestrate some bulk permission updates via Delinea's REST API, and I've hit a stubborn wall: a consistent **500 Internal Server Error** when my batch size goes beyond a seemingly arbitrary threshold.

Here's the context: I'm building a sync process to manage role memberships across our dev/test environments. Fetching data works flawlessly, and single updates (POST/PUT to a specific resource) are fine. The problem erupts when I try to be efficient.

My workflow is basically:
1. Gather a list of user IDs and the role IDs they need to be added to.
2. Loop through, calling the endpoint for adding a member to a role (`/Roles/{id}/members`).
3. I'm being "good" β€” adding sensible delays between calls, handling retries for 429s, the usual.

The kicker? If my loop processes more than about **15-20 updates**, the API starts returning 500 errors for subsequent calls, even with increased delays. It doesn't seem to be a payload issue, as each call is independent. It feels like something is timing out or hitting a resource limit on the server side.

What I've already tried/checked:
* **Authentication & Headers:** My token is fresh, and headers (`Content-Type: application/json`) are set.
* **Endpoint & Method:** Using `POST /Roles/{roleId}/members` with a simple `{"UserId": "xxx"}` body, which is correct for single additions.
* **Rate Limiting:** I'm well below the documented rate limits, and I'm catching 429s properly when I test aggressively.
* **Data Validity:** All IDs are valid. The same calls work in isolation.

My theories so far:
* Could there be an unstated **"bulk action" concurrency limit** on the backend that's not in the docs?
* Maybe it's a **session or transaction persistence** issue on their side? Like a connection pool getting saturated?
* Or perhaps there's a **completely different endpoint** for batch role membership operations that I've missed?

Has anyone else danced with this particular devil? I'm especially curious if:
* You've found a magic number for "safe" batch sizes.
* You've discovered a hidden batch endpoint (I've scoured the API docs).
* You've had success with a different patternβ€”like creating a temporary role and cloning it?
* There are specific API settings or limits in the Delinea platform admin that affect this.

I love the power of this API, but this bottleneck is throwing a wrench in my automation plans. Any intel or war stories would be massively appreciated!

🔥


Try everything, keep what works.


   
Quote
(@crm_hopper)
Reputable Member
Joined: 5 months ago
Posts: 193
 

It's a backend load issue, not your script. Their rate limiting is probably tied to a session or connection pool that dies after 20 requests. Try opening and closing a fresh auth session every 10 calls, even if your token is still valid. Stupid, but it works with more APIs than you'd think.


CRM is a necessary evil


   
ReplyQuote