Skip to main content

Errors and pagination

This guide describes how the Rently API communicates errors (JSON structure and codes), what the most common HTTP status codes mean, and how to walk through paginated responses with the offset and limit parameters.

All examples assume you have already obtained a Bearer token. See the authentication guide for the detail of the flow. The authorization header is sent on every call:

Authorization: Bearer {token}

Error format

When a request cannot be completed due to a business or validation error, the API responds with a JSON body with the following structure:

FieldTypeDescription
ErrorMessagestring (nullable)Human-readable message describing the error.
ErrorCodeintegerNumeric code identifying the error type (see codes table).
Idstring (nullable)Correlation identifier to trace the error in support.
note

ErrorCode is always serialized as an integer, not as text. For example, 1 corresponds to CustomerNotFound.

Error response example

{
"ErrorMessage": "The requested resource was not found",
"ErrorCode": 1,
"Id": "0HMVB9A2K3C4D-00000001"
}
tip

Store the value of Id in your logs. It is the correlation identifier that lets Rently support locate the exact trace of the request that failed.

Error codes (ErrorCode)

The following table lists all the error codes the API can return:

warning

The numeric values are not contiguous: the enumeration skips positions (for example, from 15 to 21). Map your retries and messages from the exact value and do not assume sequential ranges.

HTTP status codes

The API uses a limited set of status codes. Note that authentication failures are reported as 403 (the API does not return 401).

StatusMeaningBody
200 OKThe request was processed successfully.Resource payload or paginated result.
400 Bad RequestBusiness or validation error (Api Error).JSON with ErrorMessage, ErrorCode and Id.
403 ForbiddenUser not authenticated or without permissions for the endpoint.No body.
404 Not FoundThe requested resource does not exist.No body.
note

A 403 can mean either that the token is invalid or missing or that the authenticated user does not have the required permission for that endpoint. Check the Authorization header first and then the user's permissions.

How to handle errors

  • 200 → process the response normally.
  • 400 → read ErrorCode to decide the action (fix data, re-quote, etc.) and show ErrorMessage to the operator.
  • 403 → check that the token is valid, current and matches the same tenant; confirm that the user has permissions.
  • 404 → the identifier used does not correspond to any resource; validate the IDs before retrying.

Pagination

Endpoints that return lists (for example GET /api/bookings/list, GET /api/customers or GET /api/cars) use offset and limit pagination.

Query parameters

ParameterTypeDefaultDescription
offsetinteger0Page starting point. Must be >= 0.
limitinteger30Maximum number of items per page. Capped at a maximum of 100.
note

If you send a limit greater than 100, the API automatically caps it at 100. A negative offset is normalized to 0.

Result shape

Paginated responses share the same PagedResult structure:

FieldTypeDescription
OffsetintegerOffset applied to this page.
LimitintegerLimit applied to this page.
TotalintegerTotal of available items across all pages.
Resultsarray (nullable)Items of the current page.
NextOffsetintegerOffset to use to request the next page.

Paginated response example

{
"Offset": 0,
"Limit": 30,
"Total": 2,
"Results": [
{ "Id": 1 },
{ "Id": 2 }
],
"NextOffset": 0
}

Request example

curl "https://{tenant}.rently.com.ar/api/customers?offset=0&limit=30&language=es-AR" \
-H "Authorization: Bearer {token}"

How to walk through all the pages

To iterate the entirety of a listing, use the NextOffset from each response as the offset of the next request. The iteration ends when Results returns fewer items than Limit.

# Page 1
curl "https://{tenant}.rently.com.ar/api/bookings/list?offset=0&limit=30&language=es-AR" \
-H "Authorization: Bearer {token}"

# Page 2: use the NextOffset returned by the previous page
curl "https://{tenant}.rently.com.ar/api/bookings/list?offset={NextOffset}&limit=30&language=es-AR" \
-H "Authorization: Bearer {token}"
tip

For the iteration, check Results.Count < Limit as the end condition instead of comparing against Total. This works consistently with both pagination styles of the API.

warning

In GET /api/bookings/list the offset parameter works as a cursor by Id, not as a number of records to skip. Always pass 0 on the first call (regardless of the sort direction) and, on the following ones, the NextOffset value returned by the previous response. Do not build the offset manually by adding page sizes.