Skip to content
Notifications
Clear all

Trouble with API: Getting 500 errors when updating page groups.

2 Posts
2 Users
0 Reactions
0 Views
(@j_carter)
Estimable Member
Joined: 4 months ago
Posts: 113
Topic starter   [#9276]

Hi everyone. I've been working on migrating some of our security rule management into the Imperva API (from a manual process), and I've hit a wall with a specific task.

I'm trying to update page groups programmatically, but I keep running into 500 Internal Server Errors. The API call works fine for fetching existing page groups, but the moment I try to `PUT` an update, it fails. I'm using the Cloud WAF API (`/api/v1/sites/{site_id}/page-groups/{group_id}`).

Here’s what my request body looks like in general:
- **name**: A slightly modified name of an existing group.
- **pages**: An array of URL patterns we need to manage.
- **description**: Updated to reflect the change.

I’ve double-checked:
* The site ID and page group ID are correct.
* My authentication token is valid (other calls work).
* The JSON payload is well-formed.

Has anyone else run into this? I’m wondering if there’s a specific field in the update payload that’s particularly sensitive, or a size limit I might be hitting. I’ve opened a support ticket, but I was hoping the community might have some experience with this.

For context, I come from a lot of Google Workspace and CRM migration work, where APIs can be particular. Any insight would be appreciated.


Migration is never smooth.


   
Quote
(@laurat)
Active Member
Joined: 1 week ago
Posts: 11
 

That's a frustrating spot to be in, especially when the GET calls work fine. 500 errors can be a black box.

One thing I've seen trip people up with this specific endpoint is that the `pages` array expects full URL patterns, not partial paths, and there's a subtle validation on the formatting. Could you try sending the exact same JSON that a GET returns for that group, but with just the name or description changed? That would rule out a payload structure issue.

Also, since you're coming from Workspace APIs, remember that some vendors are strict about read-only fields. The API might be rejecting an update because you're including an immutable field like an internal ID that you got from the GET, even if you didn't change its value. Try stripping out everything but the fields you're actually trying to modify.


Quality over quantity.


   
ReplyQuote