user-restrictions Open Cloud API Often Returns 504's

When using the UserRestriction Open Cloud API to list our restrictions under our Universe for our game, Oaklands, we run into an annoying issue where the API will often return a 504 after going through about 10 pages.

This has been very problematic as we are looking to do a mass unban-wave specifically for previous exploiters, but due to the nature of this API constantly throwing errors, we’re unable to actually use it.

We have attempted to lower the page size from 100 → 25 → 10, in all scenarios this results in a 504 upstream error after paging a few times.


image

Below is some reproduction code to recreate the issue. API_KEY needs to be assigned. The Universe Id for Oaklands is 3666294218, you may need to change this as well. This can be ran locally in the console of a Roblox.com website in the browser.

const API_KEY = '';

async function getRestrictions(cursor = '') {
  const url = new URL(`/cloud/v2/universes/3666294218/user-restrictions`, 'https://apis.roblox.com');
  url.searchParams.set('maxPageSize', '100');
  url.searchParams.set('pageToken', cursor);

  const resp = await fetch(url, {
    headers: {
      'Content-Type': 'application/json',
      'X-API-KEY': API_KEY
    },
  });

  if (!resp.ok) {
    console.log(resp.status);
    return;
  }

  const res = await resp.json();
  console.log(res.nextPageToken);

  return await getRestrictions(res.nextPageToken);
}

(async () => await getRestrictions())();

Expected behavior

The Open Cloud /user-restrictions universe list API to not throw a 504 error.

Hi @HooferBevelops! We have raised the timeout here which should alleviate the issue. Let us know if you continue to see further issues. Thanks for reporting this!

1 Like

Thanks so much! We were able to query everything we needed.