Trello Organization requests responding with 504 and 429 errors

While making requests to get the https://api.trello.com/1/members/{id}/organizations?key={key}&token={token} for my member i keep timing out the requests, it can take some time of trying and waiting repeatedly before succeeding.

I know how I’m using it works as we use it in our API while initializing but sometimes it will time out after 30 seconds and then after that show a 429 response with the following headers:

X-Rate-Limit-Api-Token-Interval-Ms 10000
X-Rate-Limit-Api-Token-Max 100
X-Rate-Limit-Api-Token-Remaining 99
X-Rate-Limit-Db-Query-Time-Interval-Ms 600000
X-Rate-Limit-Db-Query-Time-Max 7200000
X-Rate-Limit-Db-Query-Time-Remaining 7199990
X-Rate-Limit-Api-Key-Interval-Ms 10000
X-Rate-Limit-Api-Key-Max 300
X-Rate-Limit-Api-Key-Remaining 299

I’m making the request to get all the users on the organization, which is roughly 300 accounts.

I did also notice this old post about a similar issue, but there was no explanation for what the root cause of the issue was REST API responding with 504 (Gateway Timeout) instead of 429 (API Limit Exceeded) since today

Let me know if missed something or can provide more information

Have you considered turning the task around, and instead of asking each member for orgs, to ask each org for memberships?:

{{BaseUrl}}/organizations/{{orgid}}/memberships?key={{key}}&token={{token}}

The /members/{{id}} endpoints have stricter rate limtes that rest of REST API (Rate Limits)

Thanks for the suggestion. Not sure how i missed the rate limit information, thats my bad. Maybe showing that information in the response headers as well could be helpful.

Had a closer look at the endpoint and noticed the fields parameter. Which seems to default to all despite the example response showing just the ids which may need updating. Expecting :

[   {     "id": "5abbe4b7ddc1b351ef961414"   } ]

But Getting the following is a little frustrating.

{
    "type": "object",
    "required": [
        "activeMembershipCount",
        "aiEligible",
        "availableLicenseCount",
        "billableCollaboratorCount",
        "billableMemberCount",
        "boardCounts",
        "creationMethod",
        "credits",
        "dateLastActivity",
        "desc",
        "descData",
        "displayName",
        "domainName",
        "enterpriseJoinRequest",
        "id",
        "idActiveAdmins",
        "idBoards",
        "idEnterprise",
        "idEntitlement",
        "idMemberCreator",
        "invitations",
        "invited",
        "ixUpdate",
        "jwmLink",
        "limits",
        "logoHash",
        "logoUrl",
        "maximumLicenseCount",
        "membersCount",
        "memberships",
        "name",
        "nodeId",
        "offering",
        "powerUps",
        "prefs",
        "premiumFeatures",
        "products",
        "promotions",
        "standardVariation",
        "teamType",
        "type",
        "url",
        "website"
    ],
    "properties": {
        "id": {
            "type": "string"
        },
        "creationMethod": {
            "type": "null"
        },
        "name": {
            "type": "string"
        },
        "credits": {
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "applied",
                    "count",
                    "id",
                    "reward",
                    "type",
                    "via"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "applied": {
                        "type": "boolean"
                    },
                    "reward": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer"
                    },
                    "via": {
                        "type": "string"
                    }
                }
            }
        },
        "displayName": {
            "type": "string"
        },
        "desc": {
            "type": "string"
        },
        "descData": {
            "type": "object",
            "required": [
                "emoji"
            ],
            "properties": {
                "emoji": {
                    "type": "object"
                }
            }
        },
        "domainName": {
            "type": "string"
        },
        "idBoards": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "idEnterprise": {
            "type": "null"
        },
        "idEntitlement": {
            "type": "null"
        },
        "idMemberCreator": {
            "type": "null"
        },
        "invited": {
            "type": "boolean"
        },
        "invitations": {
            "type": "array"
        },
        "limits": {
            "type": "object",
            "required": [
                "orgs"
            ],
            "properties": {
                "orgs": {
                    "type": "object",
                    "required": [
                        "freeBoardsPerOrg",
                        "totalMembersPerOrg",
                        "usersPerFreeOrg"
                    ],
                    "properties": {
                        "totalMembersPerOrg": {
                            "type": "object",
                            "required": [
                                "disableAt",
                                "status",
                                "warnAt"
                            ],
                            "properties": {
                                "status": {
                                    "type": "string"
                                },
                                "disableAt": {
                                    "type": "integer"
                                },
                                "warnAt": {
                                    "type": "integer"
                                }
                            }
                        },
                        "freeBoardsPerOrg": {
                            "type": "object",
                            "required": [
                                "disableAt",
                                "status",
                                "warnAt"
                            ],
                            "properties": {
                                "status": {
                                    "type": "string"
                                },
                                "disableAt": {
                                    "type": "integer"
                                },
                                "warnAt": {
                                    "type": "integer"
                                }
                            }
                        },
                        "usersPerFreeOrg": {
                            "type": "object",
                            "required": [
                                "count",
                                "disableAt",
                                "status",
                                "warnAt"
                            ],
                            "properties": {
                                "status": {
                                    "type": "string"
                                },
                                "disableAt": {
                                    "type": "integer"
                                },
                                "warnAt": {
                                    "type": "integer"
                                },
                                "count": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        },
        "membersCount": {
            "type": "integer"
        },
        "nodeId": {
            "type": "string"
        },
        "prefs": {
            "type": "object",
            "required": [
                "archiveCleanupCutOff",
                "associatedDomain",
                "atlassianIntelligenceEnabled",
                "attachmentRestrictions",
                "boardDeleteRestrict",
                "boardInviteRestrict",
                "boardVisibilityRestrict",
                "externalMembersDisabled",
                "googleAppsVersion",
                "newLicenseInviteRestrict",
                "newLicenseInviteRestrictUrl",
                "orgInviteRestrict",
                "permissionLevel"
            ],
            "properties": {
                "permissionLevel": {
                    "type": "string"
                },
                "orgInviteRestrict": {
                    "type": "array"
                },
                "boardInviteRestrict": {
                    "type": "string"
                },
                "externalMembersDisabled": {
                    "type": "boolean"
                },
                "associatedDomain": {
                    "type": "null"
                },
                "googleAppsVersion": {
                    "type": "integer"
                },
                "boardVisibilityRestrict": {
                    "type": "object",
                    "required": [
                        "enterprise",
                        "org",
                        "private",
                        "public"
                    ],
                    "properties": {
                        "private": {
                            "type": "string"
                        },
                        "org": {
                            "type": "string"
                        },
                        "enterprise": {
                            "type": "string"
                        },
                        "public": {
                            "type": "string"
                        }
                    }
                },
                "boardDeleteRestrict": {
                    "type": "object",
                    "required": [
                        "enterprise",
                        "org",
                        "private",
                        "public"
                    ],
                    "properties": {
                        "private": {
                            "type": "string"
                        },
                        "org": {
                            "type": "string"
                        },
                        "enterprise": {
                            "type": "string"
                        },
                        "public": {
                            "type": "string"
                        }
                    }
                },
                "attachmentRestrictions": {
                    "type": "null"
                },
                "newLicenseInviteRestrict": {
                    "type": "null"
                },
                "newLicenseInviteRestrictUrl": {
                    "type": "null"
                },
                "atlassianIntelligenceEnabled": {
                    "type": "boolean"
                },
                "archiveCleanupCutOff": {
                    "type": "null"
                }
            }
        },
        "powerUps": {
            "type": "array",
            "items": {
                "type": "integer"
            }
        },
        "offering": {
            "type": "string"
        },
        "products": {
            "type": "array",
            "items": {
                "type": "integer"
            }
        },
        "billableMemberCount": {
            "type": "integer"
        },
        "billableCollaboratorCount": {
            "type": "integer"
        },
        "url": {
            "type": "string"
        },
        "website": {
            "type": "null"
        },
        "logoHash": {
            "type": "null"
        },
        "logoUrl": {
            "type": "null"
        },
        "aiEligible": {
            "type": "boolean"
        },
        "premiumFeatures": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "promotions": {
            "type": "array"
        },
        "enterpriseJoinRequest": {
            "type": "object"
        },
        "standardVariation": {
            "type": "null"
        },
        "availableLicenseCount": {
            "type": "null"
        },
        "maximumLicenseCount": {
            "type": "null"
        },
        "ixUpdate": {
            "type": "string"
        },
        "teamType": {
            "type": "null"
        },
        "dateLastActivity": {
            "type": "string"
        },
        "jwmLink": {
            "type": "null"
        },
        "activeMembershipCount": {
            "type": "null"
        },
        "idActiveAdmins": {
            "type": "null"
        },
        "boardCounts": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "idMember": {
                        "type": "string"
                    },
                    "boardCount": {
                        "type": "integer"
                    }
                },
                "required": [
                    "boardCount",
                    "idMember"
                ]
            }
        },
        "type": {
            "type": "null"
        },
        "memberships": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "idMember": {
                        "type": "string"
                    },
                    "memberType": {
                        "type": "string"
                    },
                    "unconfirmed": {
                        "type": "boolean"
                    },
                    "deactivated": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "deactivated",
                    "id",
                    "idMember",
                    "memberType",
                    "unconfirmed"
                ]
            }
        }
    }
}

@RasmusWulffJensen we are actually using your NuGet package (thank you very much btw), so just adding those fields solved the issue.

1 Like