Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,37 @@ info:
{ "page": 1, "page_size": 10, "page_count": 146, "total_count": 1458, "data": [] }
```

## Rate limits
To keep the API fast for every organisation, calls are limited per minute:

| Who | Limit |
|---|---|
| Each API key, connected app token, or person's email and token | 120 requests a minute |
| All of one Organisation's API keys and connected apps together | 300 requests a minute |

The minute is a fixed clock minute (it resets at :00 seconds). Every response carries headers so an integration can pace itself:

| Header | Meaning |
|---|---|
| `X-RateLimit-Limit` | Requests allowed per minute for this key or token |
| `X-RateLimit-Remaining` | Requests left this minute |
| `X-RateLimit-Reset` | When the minute resets, as a Unix timestamp |

A call over a limit gets `429 Too Many Requests` with a `Retry-After` header (seconds) and this body:
```json
{
"error": "Too many requests: this API key or token has made more than 120 requests in a minute. The limit resets at 17:31:00 UTC, in 23 seconds; try again then. ...",
"scope": "api_key",
"limit": 120,
"retry_after": 23,
"resets_at": "2026-11-25T17:31:00Z",
"documentation": "https://api-docs.makerble.com/#rate-limits"
}
```
`scope` is `api_key` for the key or token's own limit and `organisation` for the Organisation's shared one.

**To stay within the limits:** wait `Retry-After` seconds after a `429` before trying again; space requests out (one every half second keeps a key under its limit); and fetch lists a page at a time with `per_page` up to 200 and `last_synced_datetime` to get only what changed since your last sync, instead of fetching records one by one. For example, 5,000 Survey Responses (Stories) take 25 calls to `GET /stories?per_page=200`, but 5,000 calls to `GET /stories/{id}`.

## Webhooks
Instead of polling, an Organisation's admins can register **webhook endpoints**: HTTPS URLs that Makerble sends a signed JSON `POST` to when records change. Manage them under **Connect > Webhooks** or with the Webhooks endpoints below. An Organisation's admin turns webhooks on by ticking **Turn on Webhooks** in the Organisation's Settings (Preferences) page; until then those endpoints answer `403`.

Expand Down Expand Up @@ -6708,6 +6739,8 @@ paths:
$ref: '#/components/responses/Unauthorized'
"422":
$ref: '#/components/responses/UnprocessableEntity'
"429":
$ref: '#/components/responses/TooManyRequests'

post:
tags: [Stories]
Expand Down Expand Up @@ -6849,6 +6882,8 @@ paths:
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
"429":
$ref: '#/components/responses/TooManyRequests'

/stories/{id}/attachments:
get:
Expand Down Expand Up @@ -22379,6 +22414,39 @@ components:
$ref: '#/components/schemas/Error'
example:
error: "You need to sign in before continuing."
TooManyRequests:
description: Over a rate limit (see Rate limits). Retry after the number of seconds in the Retry-After header.
headers:
Retry-After:
description: Seconds until the limit resets
schema:
type: integer
content:
application/json:
schema:
type: object
properties:
error:
type: string
scope:
type: string
enum: [api_key, organisation]
limit:
type: integer
retry_after:
type: integer
resets_at:
type: string
format: date-time
documentation:
type: string
example:
error: "Too many requests: this API key or token has made more than 120 requests in a minute. The limit resets at 17:31:00 UTC, in 23 seconds; try again then. To stay within it, space your requests out (about 0.5 seconds apart), and fetch lists a page at a time with per_page (up to 200) and last_synced_datetime, to get only what has changed, rather than one record per request. See https://api-docs.makerble.com/#rate-limits"
scope: api_key
limit: 120
retry_after: 23
resets_at: "2026-11-25T17:31:00Z"
documentation: "https://api-docs.makerble.com/#rate-limits"
NotFound:
description: Resource not found
content:
Expand Down
30 changes: 30 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ function buildDocsPage() {
<a href="#introduction" class="nav-link active">Introduction</a>
<a href="#authentication" class="nav-link">Authentication</a>
<a href="#pagination" class="nav-link">Pagination</a>
<a href="#rate-limits" class="nav-link">Rate limits</a>
<a href="#terminology" class="nav-link">Terminology</a>
<a href="#mock-server" class="nav-link">Mock server</a>
</div>
Expand Down Expand Up @@ -1188,6 +1189,35 @@ function buildDocsPage() {
</div>
</section>

<!-- Rate limits -->
<section class="section" id="rate-limits">
<div class="section-eyebrow">Reference</div>
<h2 class="section-title">Rate limits</h2>
<div class="section-desc">
<p>To keep the API fast for every organisation, calls are limited per clock minute. A call over a limit gets <code>429 Too Many Requests</code> with a <code>Retry-After</code> header in seconds, and a message saying when the limit resets.</p>
</div>
<table class="info-table" style="margin-top:20px">
<thead><tr><th>Who</th><th>Limit</th><th><code>scope</code> in a 429</th></tr></thead>
<tbody>
<tr><td>Each API key, connected app token, or person's email and token</td><td>120 requests a minute</td><td>api_key</td></tr>
<tr><td>All of one Organisation's API keys and connected apps together</td><td>300 requests a minute</td><td>organisation</td></tr>
</tbody>
</table>
<table class="info-table" style="margin-top:20px">
<thead><tr><th>Response header</th><th>Meaning</th></tr></thead>
<tbody>
<tr><td>X-RateLimit-Limit</td><td>Requests allowed per minute for this key or token</td></tr>
<tr><td>X-RateLimit-Remaining</td><td>Requests left this minute</td></tr>
<tr><td>X-RateLimit-Reset</td><td>When the minute resets, as a Unix timestamp</td></tr>
<tr><td>Retry-After</td><td>On a 429 only: seconds to wait before trying again</td></tr>
</tbody>
</table>
<div class="callout callout-tip" style="margin-top:20px">
<span class="callout-icon">✓</span>
<span>To stay within the limits, space requests out (one every half second keeps a key under its limit), wait <code>Retry-After</code> seconds after a 429, and fetch lists a page at a time with <code>per_page</code> up to 200 and <code>last_synced_datetime</code> rather than one record at a time: 5,000 Survey Responses take 25 calls to <code>GET /stories?per_page=200</code>, but 5,000 calls to <code>GET /stories/{id}</code>.</span>
</div>
</section>

<!-- Terminology -->
<section class="section" id="terminology">
<div class="section-eyebrow">Reference</div>
Expand Down
Loading