Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.fluveo.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

All list endpoints return paginated results using cursor-based pagination. This approach provides stable results even when new records are added between page fetches.

Query parameters

ParameterTypeDefaultDescription
limitinteger10Number of results per page. Min: 1, max: 100.
starting_afterstringA cursor for forward pagination. Pass the id of the last item from the previous page.
ending_beforestringA cursor for backward pagination. Pass the id of the first item from the previous page.

Response shape

Every list response includes pagination metadata:
{
  "object": "list",
  "data": [
    { "id": "pi_abc001", "object": "payment_intent", "amount": 1000, ... },
    { "id": "pi_abc002", "object": "payment_intent", "amount": 2500, ... },
    { "id": "pi_abc003", "object": "payment_intent", "amount": 500, ... }
  ],
  "has_more": true,
  "next_cursor": "pi_abc003"
}
FieldTypeDescription
objectstringAlways "list".
dataarrayThe page of results.
has_morebooleantrue if there are more results after this page.
next_cursorstring | nullThe ID to pass as starting_after for the next page. null when has_more is false.

Basic example

Fetch the first page of PaymentIntents with a limit of 3:
# First page
curl "https://api.leanrails.com/v1/payment_intents?limit=3" \
  -u "sk_test_xxx:"

# Next page using the cursor
curl "https://api.leanrails.com/v1/payment_intents?limit=3&starting_after=pi_abc003" \
  -u "sk_test_xxx:"

Iterating through all results

CURSOR=""
PAGE=1

while true; do
  if [ -z "$CURSOR" ]; then
    RESPONSE=$(curl -s "https://api.leanrails.com/v1/payment_intents?limit=100" \
      -u "sk_test_xxx:")
  else
    RESPONSE=$(curl -s "https://api.leanrails.com/v1/payment_intents?limit=100&starting_after=$CURSOR" \
      -u "sk_test_xxx:")
  fi

  COUNT=$(echo "$RESPONSE" | jq '.data | length')
  echo "Page $PAGE: $COUNT results"

  HAS_MORE=$(echo "$RESPONSE" | jq -r '.has_more')
  if [ "$HAS_MORE" = "false" ]; then
    break
  fi

  CURSOR=$(echo "$RESPONSE" | jq -r '.next_cursor')
  PAGE=$((PAGE + 1))
done

Backward pagination

Use ending_before to paginate in reverse. This returns items that come before the given cursor, in reverse chronological order.
curl "https://api.leanrails.com/v1/payment_intents?limit=10&ending_before=pi_abc001" \
  -u "sk_test_xxx:"
Do not combine starting_after and ending_before in the same request. The API will return a 400 error.

Tips

  • Use limit=100 when iterating through all results to minimize the number of API calls.
  • Results are always sorted by creation time in descending order (newest first).
  • Cursors are stable: adding or removing records does not shift the pagination window.