Hi @Maxwell Moreira
The "504 Gateway Timeout" is a server-side error. This could be caused by various factors, such as network issues, server overload, or request complexity.
One possible solution is to reduce the requested page size. If you are using JSON batching for this endpoint, do not merge other requests yet to reduce workload. If a 504 Gateway Timeout error is still returned, try calling the API individually instead of using batching for that endpoint.
Another possible solution is to retry the request after a certain interval. Sometimes, the 504 error is temporary and can be resolved by resubmitting the request. You could implement a retry logic in your code that checks for the 504 error and waits for a few seconds before trying again.
If the above suggestions don't work, then please open a support ticket on this to get help from the Microsoft support team.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.