Operational contract
The rules every integration can rely on.
Pagination
List operations are page-based. Two optional query parameters select a page:
-
page: the page number, starting at 1. -
per_page: records per page. The default is 25 and the maximum is 200. A larger value is treated as 200.
Each list response carries its pagination metadata beside the records: the current page, the per_page in effect, total_records when the total is known, and next_page_url and previous_page_url. Both links keep your other query parameters. To read a whole list, request the first page and follow next_page_url until it is null.
Pages are computed when you request them. A record can move from one page to the next while the data changes under your crawl, so a long crawl can see a record twice or miss one. Keep a crawl short, or treat the result as a set and de-duplicate on id.
Reporting metric operations are not paginated. One request returns the totals and the period buckets for the window you asked for. Narrow the window with the reporting_period filter and choose the bucket size with granularity. Use sections to compute only the metric groups you need.
To report on one program, or on all programs but one, use the program filter. Its values are program IDs: the id of each program that List programs returns for your credentials. For example, {"program":{"op":"is","value":["<program id>"]}} counts one program, and is_not excludes it. A value that is not a program ID, or a program ID that is not among the programs your credentials can read, is 422 Unprocessable Entity with a message that names the value, and no metrics are returned.
Paging parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number for pagination |
| per_page | integer | Records per page |
Pagination metadata: PaginationMetadata
| Parameter | Type | Required | Description |
|---|---|---|---|
| next_page_params | map<string, any> | null | required | Query params for the next page. Merge them into the params of this request. Null on the last page. |
| next_page_url | string | null | required | |
| page | integer | required | |
| per_page | integer | required | |
| previous_page_params | map<string, any> | null | required | Query params for the previous page. Merge them into the params of this request. Null on the first page. |
| previous_page_url | string | null | required | |
| total_records | integer | null | required |
{
"next_page_params": {
"<key>": {}
},
"next_page_url": "<next_page_url>",
"page": 0,
"per_page": 0,
"previous_page_params": {
"<key>": {}
},
"previous_page_url": "<previous_page_url>",
"total_records": 0
}
Rate limits
The gateway limits every client to 30 requests per second and 2,000 requests per hour. Both limits count every request: token requests, successful calls and failed calls alike. The limit applies per client as the gateway sees it, so requests that arrive from the same network address share one budget, whichever credentials they use.
Every response tells you where you stand:
| Header | Meaning |
|---|---|
RateLimit-Limit |
Requests allowed in the window of the limit you are closest to reaching. |
RateLimit-Remaining |
Requests left in that window. |
RateLimit-Reset |
Seconds until that window resets. |
X-RateLimit-Limit-Second and X-RateLimit-Remaining-Second
|
The per-second limit and what is left of it. |
X-RateLimit-Limit-Hour and X-RateLimit-Remaining-Hour
|
The per-hour limit and what is left of it. |
When you exceed either limit, the response is 429 Too Many Requests with a Retry-After header that says how many seconds to wait. The gateway sends this response, so the body is not an Errors object.
Sizing a sync: a job that reads list operations at per_page=200 reads 2,000 pages, or 400,000 records, before it reaches the hourly limit. Spread bursts out so that you stay under 30 requests in any one second.
Network access
BetterUp does not restrict Partner API access by IP address. Your API credential is what grants access, so there is no address to register with BetterUp. If your network restricts outbound traffic, allow HTTPS to api.betterup.co. Requests that leave your network from the same address share one rate-limit budget; see Rate limits above.
Retries and backoff
Retry a request only when the failure is temporary:
-
429: wait the number of seconds in
Retry-After, then retry. - 500, 502, 503, 504, and a connection or read timeout: retry with exponential backoff. Wait 1 second before the first retry, double the wait each time, add random jitter, and cap the wait at 60 seconds. Stop after about five attempts and alert.
-
401 with an
Errorsbody: the access token has expired or is invalid. Request one new token with your client credentials and retry the request once. See Authentication.
Do not retry any other 4xx response, including a 401 with an empty body. The same request fails the same way, so fix the request, or the credential, first. The Errors section below says what each status means.
A request can run for up to 30 seconds before the gateway answers 504 Gateway Timeout. Reporting metric operations answer 503 Service Unavailable when the analytics warehouse cannot answer in time, and a 503 response never carries a partial result. BetterUp already retries the warehouse once inside the request, so wait a few seconds before you try again. If a request fails repeatedly, ask for a narrower window or fewer sections.
Every GET operation is safe to repeat. Starting a member activity export creates a new export on every call. If that request times out, you do not know whether an export was started; wait, then start one again. Exports are independent, so an extra export does no harm. Keep the id of each export you start, so that you poll the right one.
Errors
An error response from BetterUp has a JSON body of type Errors: a list of errors, each with a machine-readable error_type and a human-readable message. Each operation's reference lists the error statuses specific to it.
| Status | Reason | Operations |
|---|---|---|
| 400 | Bad Request | 6 |
| 401 | Unauthorized | 10 |
| 403 | Forbidden | 15 |
| 404 | Not Found | 7 |
| 422 | Unprocessable Content | 6 |
| 503 | Service Unavailable | 5 |
Error body: Errors
| Parameter | Type | Required | Description |
|---|---|---|---|
| errors | Error[] | required | |
| errors[].attribute | string | optional | |
| errors[].error_type | string | required | |
| errors[].message | string | required | |
| errors[].meta | map<string, any> | optional | Machine-readable details about the error, such as the record a uniqueness error conflicts with |
{
"errors": [
{
"attribute": "<attribute>",
"error_type": "<error_type>",
"message": "<message>",
"meta": {
"<key>": "<value>"
}
}
]
}
These statuses come from the gateway, from authentication or from a failure inside BetterUp, so no operation's reference lists them. Any request can get them:
| Status | Meaning | What to do |
|---|---|---|
| 401 Unauthorized | With an Errors body: the access token is missing, expired or invalid. With an empty body: the API credential the token belongs to was revoked or has expired. |
Errors body: request a new token and retry once. Empty body: do not retry; your credential needs attention. |
| 429 Too Many Requests | You exceeded a rate limit. The body comes from the gateway and is not an Errors object. |
Wait for Retry-After, then retry. |
| 500 Internal Server Error | BetterUp failed to process the request. | Retry with backoff. If it persists, report it with the request id. |
| 502 Bad Gateway, 504 Gateway Timeout | The gateway could not reach BetterUp, or the request took longer than 30 seconds. | Retry with backoff. |
| 503 Service Unavailable | A reporting metric operation could not get an answer from the analytics warehouse. | Retry with backoff. |
Every response carries an X-Request-ID header. Quote it when you report a problem; it lets BetterUp find the request in its logs.
Support
- Getting started guide: Getting Started with BetterUp's Partner API
- Status page: status.betterup.co