# /api/v2/connections returns 504 gateway time out (again)

**URL:** <https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002>\
**Category:** Get Help\
**Tags:** management-api\
**Created:** [April 19, 2018, 7:49am UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002 "2018-04-19T07:49:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.bitard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael.bitard/32/4494_2.png) [@michael.bitard](https://community.auth0.com/u/michael.bitard)\
**Post date:** [April 19, 2018, 7:49am UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002/1 "2018-04-19T07:49:28Z")

</div>

The problem seems to be here again. (Copy/pasted from [/api/v2/connections returns 504 gateway time out](http://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out/10910))

Hi,

We are having some issues since this morning.  
One of our problems is that we can’t retrieve the connections list anymore, an http GET on [https://easymile-sitecc.eu.auth0.com/api/v2/connections](https://easymile-sitecc.eu.auth0.com/api/v2/connections)  
(with a valid bearer token) returns a 504 Gateway Time-out

Anyone experiencing this issue as well?  
Regards,  
Michaël Bitard

---

<div class="post-metadata">

**Author:** ![michael.bitard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael.bitard/32/4494_2.png) [@michael.bitard](https://community.auth0.com/u/michael.bitard)\
**Post date:** [April 20, 2018, 8:25am UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002/2 "2018-04-20T08:25:52Z")

</div>

Are we the only one with this issue? It’s a real problem here, we can’t do anything anymore on our sites

---

<div class="post-metadata">

**Author:** ![michael.bitard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael.bitard/32/4494_2.png) [@michael.bitard](https://community.auth0.com/u/michael.bitard)\
**Post date:** [April 23, 2018, 7:32am UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002/3 "2018-04-23T07:32:21Z")

</div>

We were able to narrow down the issue.

It appears we cannot retrieve all our connections at once. Today, we have ~150 connections, and sometimes we need to list them all. Is this a limitation we didn’t know about?

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [April 23, 2018, 6:35pm UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002/4 "2018-04-23T18:35:18Z")

</div>

👋 @michael.bitard around the time you posted this there was a disruption to the /api/v2/connections endpoint (reference: [Spikes in Response Times for Management API in US • Auth0 Status Page](https://status.auth0.com/incidents/nq4lj9hp25qv)) this could have been why you were experiencing issues.

I can double check if there any specific limitations. I believe the recommended number of connections per page should be 100 or less, so as your connections grow we should try requesting a smaller number of connections per page by using the `per_page parameter` (as we said must be below 100) and then query for the pages using the `page` parameter. Here is an example:

```auto
https://YOUR_DOMAIN.auth0.com/api/v2/connections?per_page=50&page=0
https://YOUR_DOMAIN.auth0.com/api/v2/connections?per_page=50&page=1

```

---

<div class="post-metadata">

**Author:** ![michael.bitard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael.bitard/32/4494_2.png) [@michael.bitard](https://community.auth0.com/u/michael.bitard)\
**Post date:** [April 24, 2018, 7:04am UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002/5 "2018-04-24T07:04:54Z")

</div>

Thanks @kimcodes. Indeed that’s what we are doing now, to circumvent the issue. I have the feeling that this is still an issue because we get a timeout from /api/v2/connections where we should have an error message explaining that we can’t query that much information at once.

From what I see something changed in the auth0 backend, because one day it worked, and since the first issues it stopped working at all, even after manually cleaning a lot of connections.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 17, 2018, 11:15am UTC](https://community.auth0.com/t/api-v2-connections-returns-504-gateway-time-out-again/11002/6 "2018-12-17T11:15:58Z")

</div>


