API Daily Limit

Hi there meta,

I am using your API for a few neat little tasks which has been really useful.

One problem I’ve run into is that the limit on api requests is very low (a reasonable limit to set initially), but I now want to increase it. I’ve successfully been able to change certain site settings with the API, yet I cannot seem to be able to update the number of API reqs per second OR day using valid credentials.

The following error results:
{"errors":["No setting named 'max_user_api_reqs_per_day' exists"]}

I’ve looked online and found nothing helpful on addressing this particular error. Anyone have examples of how they’ve changed their allowed requests, or any ideas why this doesn’t work?

I’ve used the following scripts to change it:

#!/bin/bash
[[ -z "$1" ]] && echo "need a integer" && exit 1
NUM="$1"
SETTING="max_user_api_reqs_per_day"
source "discourse_lib.inc"
$CURL -X PUT -d "$SETTING=$NUM" $BASE_URL/admin/site_settings/$SETTING?$API_CREDS

The request was constructed from the docs here.

Regardless, nothing seems to have worked. Any help would be greatly appreciated.

Many thanks. Ben.

Bump - would love some response here if anyone has some idea.

Thanks again.

Are you self-hosted or are you on our hosting? If you are on our hosting the limits are fixed. If you are self-hosted then you’ll likely need to set overrides in app.yml; I believe a lot of the rate limiting is in the Nginx so searching here with those keywords should produce results.

Self-hosted. Many thanks - probably a really basic follow-up question, but we’ve also separated the app.yml file into backend.yml / frontend.yml structure in docker (which has worked really well)… so which yaml file do we set?

And just to confirm: we can simply set an env var before running the docker start command and discourse should pick up on the changes and write them out to the yaml file for us etc., right? or is it safer just to adjust the correct yaml before spinning up the docker instance again?

NGINX does indeed add an additional side to this issue. Is the idea with this that we control global per-ip incoming traffic through NGINX? If true, then this might also need to be changed for our API reqs to not get hit by the 429 error too.

Many thanks :slight_smile: