Mirza
01/26/2026, 12:23 PMjson
{
"level": "WARN",
"timestamp": "2026-01-25T09:51:45.528Z",
"msg": "User rate limited",
"limit": 6000000,
"used": 310585,
"msToReset": 530,
"enabled": true,
"projectId": "9f724bc4-84a2-473e-b1d2-3d0eb09a845c",
"profile": "Bot/be8c14fd-4fa4-4884-8b87-9c35b6fa3030",
"requestId": "bb8aff12-3614-4961-af1b-325b1de851d9",
"traceId": "1-6975e7b1-327ed3ca10d5727b64c03dca"
}
It looks like the limit is set correctly to 6.000.000 but we only used 310.585 points before an error is raised. The bots are triggered from subscriptions.
Any idea on how to prevent the rate limit errors?Maddy
01/26/2026, 6:35 PMMaddy
01/26/2026, 6:36 PMGonzalo
01/26/2026, 8:05 PMAP
01/26/2026, 8:36 PMGonzalo
01/26/2026, 8:51 PMUserConfiguration resource with the FHIR quota option, e.g.:
{
"resourceType": "UserConfiguration",
"id": "yyy",
"option": [
{
"id": "fhirQuota",
"valueInteger": 6000000
}
]
}
and then set it then ProjectMembership that links the Bot to the `Project`:
{
"resourceType": "ProjectMembership",
"profile": {
"reference": "Bot/xxx",
},
"userConfiguration": {
"reference": "UserConfiguration/yyy"
},
"project": {
"reference": "Project/zzz",
},
"user": {
"reference": "Bot/xxx",
}
}AP
01/26/2026, 8:52 PMMaddy
01/26/2026, 9:20 PMAP
01/26/2026, 9:21 PMAP
01/26/2026, 9:21 PMMaddy
01/26/2026, 9:23 PMAP
01/26/2026, 9:26 PMAP
01/26/2026, 9:26 PMMaddy
01/26/2026, 9:28 PMdefaultFhirQuota parameter
Project level: set the systemSetting array as the screenshot below, which must be done via the super admin console
User level: set the UserConfiguration and add it to the ProjectMembership
https://cdn.discordapp.com/attachments/1465321110634627102/1465458295853809932/Screenshot_2026-01-26_at_1.26.27_PM.png?ex=69792de4&is=6977dc64&hm=8ccac2c2f23c7df71cbc34adfe552bc41fdd5033d52b39e8cb1eef44829a665c&Maddy
01/26/2026, 9:29 PMAP
01/26/2026, 9:30 PMAP
01/26/2026, 9:31 PMAP
01/26/2026, 9:34 PM_msBeforeNext number of seconds (this is given to be whenever medplum ran into 429) before retrying because the fhir quota wasn't increasing so maybe thats why the system stopped giving 429? And can this timeout be the reason why my bot gives failed to fetch?Maddy
01/26/2026, 9:34 PMAP
01/26/2026, 9:38 PMMaddy
01/26/2026, 9:39 PM_msBeforeNext so that you only use the information in that header if you get a 429? Successful requests also have an _msBeforeNext header in the response, even if the rate limit has not been hit yetMaddy
01/26/2026, 9:40 PMAP
01/26/2026, 9:44 PMAP
01/26/2026, 9:44 PMAP
01/26/2026, 9:45 PMAP
01/26/2026, 9:46 PMMaddy
01/26/2026, 9:54 PMAP
01/26/2026, 9:54 PMMaddy
01/26/2026, 9:55 PMMaddy
01/26/2026, 9:56 PMuserFhirQuota here. If the userFhirQuota is set, you shouldn't need to add a userConfiguration, so it might be worth removing it here and testing at that levelAP
01/26/2026, 9:57 PM{
"resourceType": "UserConfiguration",
"name": "Bot High Quota Config",
"option": [
{
"id": "fhirQuota",
"valueInteger": 50000000
}
],
...
}
And then found the project membership for the bot, and added the user config to itAP
01/26/2026, 9:58 PMAP
01/26/2026, 10:00 PMAP
01/26/2026, 10:01 PMMaddy
01/26/2026, 10:04 PMAP
01/26/2026, 10:04 PMAP
01/26/2026, 10:05 PMAP
01/26/2026, 10:06 PMMaddy
01/26/2026, 10:13 PMtotalFhirQuota and userFhirQuota in this case. The server one is not relevantMaddy
01/26/2026, 10:13 PMtotalFhirQuota and userFhirQuota being set on the Project that the Bot resides in, or on the super admin project itself?AP
01/26/2026, 10:14 PMMaddy
01/26/2026, 10:15 PMAP
01/26/2026, 10:15 PMAP
01/26/2026, 10:21 PMAP
01/26/2026, 10:22 PMAP
01/26/2026, 10:23 PMAP
01/26/2026, 10:24 PMMaddy
01/26/2026, 10:31 PMAP
01/26/2026, 10:33 PMAP
01/26/2026, 10:34 PMMaddy
01/26/2026, 10:34 PMAP
01/26/2026, 10:35 PMAP
01/26/2026, 10:36 PMAP
01/26/2026, 10:37 PMAP
01/26/2026, 10:37 PMMaddy
01/26/2026, 10:37 PMAP
01/26/2026, 10:42 PMAP
01/26/2026, 10:43 PMAP
01/26/2026, 10:44 PMMaddy
01/26/2026, 10:49 PMAP
01/26/2026, 10:50 PMAP
01/26/2026, 10:50 PMMaddy
01/26/2026, 10:51 PMAP
01/26/2026, 10:52 PMAP
01/26/2026, 10:53 PMMaddy
01/26/2026, 10:53 PMAP
01/26/2026, 10:56 PMAP
01/26/2026, 10:57 PMAP
01/26/2026, 10:57 PMMaddy
01/26/2026, 11:19 PMMirza
01/27/2026, 12:41 PMAP
01/27/2026, 3:57 PMAP
01/27/2026, 4:27 PM