Pagination
All list endpoints (GET /api/v1/workspaces, GET /api/v1/records, etc.) return a shared response envelope containing the page of results, a flag indicating whether more pages exist, and the total count of matching resources.
Query Parameters
Control pagination by passing the following query parameters on any list request:The page number to retrieve. Pages are 1-indexed. The first page is
page=1. Omit this parameter to start from the beginning.The number of items to return per page. Must be between 1 and 10000 (inclusive). Defaults to
100 if not specified.Example Paginated Request
The following request fetches the second page of records, with 50 results per page:Pagination Response Envelope
Every list response wraps results in the same top-level envelope:The array of resource objects for the current page. The shape of each item depends on the endpoint (Workspace, Record, Submission, etc.).
true when there are additional pages beyond the current one. When false, the current page is the last page of results.The total number of resources matching the request’s filters, across all pages, not just the current page. Use this to calculate the total number of pages:
ceil(total_count / limit).Errors
When a request fails, the API returns an appropriate HTTP status code and a JSON body containing a singleerror object. The structure is identical regardless of the error type, making it easy to write a single error-handling function for your entire integration.
Error Envelope
Error Response Fields
The top-level error container. All error details are nested inside this object.
Error Types Reference
| Type | HTTP Status | Description |
|---|---|---|
invalid_request_error | 422 | The request was understood but a value is invalid, out of range, or fails a validation rule. Check the param field to identify the offending input. (A genuinely missing required parameter returns 400.) |
authentication_error | 401 | The API key is missing, incorrectly formatted, or has been revoked. See Authentication for guidance. |
authorization_error | 403 | The API key is valid but does not have permission to access the requested resource. Verify the key belongs to an account with the necessary access. |
not_found_error | 404 | The requested resource does not exist. Verify the ID in the URL is correct and belongs to a resource your key can access. |
rate_limit_error | 429 | Too many requests have been made in a short period. Back off and retry after the delay in the Retry-After header. |
plan_limit_exceeded | 422 | The request needs a feature or exceeds a limit not included in your current plan. Check param for the feature or resource, then upgrade to proceed. |
api_error | 500 | An unexpected error occurred on the Terminus Hub server. These are rare. If they persist, contact Terminus Hub support. |
Your integration should always check the HTTP status code first, then inspect
error.type for branching logic, and error.code for fine-grained handling. Do not rely solely on error.message, as message text may change between API versions.Handling Errors: Example
The snippet below demonstrates a simple, robust error-handling pattern in JavaScript:Rate limiting
Requests are rate limited per API key. Each key may make up to 100 requests per minute. (Unauthenticated requests are limited to 20 per minute per IP.) When you exceed the limit, the API responds with429 and a rate_limit_error:
429 includes headers to help you back off:
| Header | Meaning |
|---|---|
Retry-After | Seconds to wait before retrying |
X-RateLimit-Limit | The request ceiling for the window |
X-RateLimit-Remaining | Requests left in the current window |
X-RateLimit-Reset | Unix time when the window resets |
Retry-After and implement exponential back-off for resilient integrations.