1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-11-24 11:52:34 +01:00

Added rate limit section to the API docs

Closes #3423
This commit is contained in:
Dan Brown 2022-05-09 15:12:29 +01:00
parent b4f29a85ab
commit 96436839f1
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 21 additions and 1 deletions

View File

@ -15,6 +15,7 @@
<div class="mb-xs"><a href="#request-format">Request Format</a></div> <div class="mb-xs"><a href="#request-format">Request Format</a></div>
<div class="mb-xs"><a href="#listing-endpoints">Listing Endpoints</a></div> <div class="mb-xs"><a href="#listing-endpoints">Listing Endpoints</a></div>
<div class="mb-xs"><a href="#error-handling">Error Handling</a></div> <div class="mb-xs"><a href="#error-handling">Error Handling</a></div>
<div class="mb-xs"><a href="#rate-limits">Rate Limits</a></div>
</div> </div>
@foreach($docs as $model => $endpoints) @foreach($docs as $model => $endpoints)

View File

@ -161,3 +161,22 @@
} }
} }
</code></pre> </code></pre>
<hr>
<h5 id="rate-limits" class="text-mono mb-m">Rate Limits</h5>
<p>
The API has built-in per-user rate-limiting to prevent potential abuse using the API.
By default, this is set to 180 requests per minute but this can be changed by an administrator
by setting an "API_REQUESTS_PER_MIN" .env option like so:
</p>
<pre><code class="language-bash"># The number of API requests that can be made per minute by a single user.
API_REQUESTS_PER_MIN=180</code></pre>
<p>
When the limit is reached you will receive a 429 "Too Many Attempts." error response.
It's generally good practice to limit requests made from your API client, where possible, to avoid
affecting normal use of the system caused by over-consuming system resources.
Keep in mind there may be other rate-limiting factors such as web-server & firewall controls.
</p>