Platform SDK JS: Fetching all queues across multiple divisions

I’m trying to pull queue data for adherence checks across our US/Pacific and US/East divisions. The standard routing.queuesApi.getQueues() only returns queues for the default division. I know I need to loop through divisions first, but the SDK pagination is tripping me up.

Here is what I have:

const divisions = await routing.queuesApi.getQueues({divisionId: 'all'});
// This returns 400 Bad Request

The docs say divisionId is optional, but passing ‘all’ fails. If I omit it, I only get my local division. How do I iterate through every division ID and aggregate the queue lists? The getQueues response has a nextPageToken, but I’m unsure if that handles cross-division pagination or just the current division’s list. I need a clean way to get the full set without hitting rate limits.

The docs state: “divisionId must be a valid division ID or null for the default division.” Passing ‘all’ triggers that 400. You have to call getDivisions() first, then loop through the IDs for getQueues.