Idempotency and pagination
How to retry without doing anything twice, and how to read long lists.
Idempotency
Automation tools retry when a request times out. Without protection, a retried POST /calls could call someone twice. Send an Idempotency-Key header, with any unique text up to 80 characters, on every request that creates something.
curl https://navaprastha.in/api/v1/calls \
-H "Authorization: Bearer $NAVAPRASTHA_KEY" \
-H "Idempotency-Key: reminder-1042" \
-H "Content-Type: application/json" \
-d '{"phone":"98480 12345","purpose":"reminder","consent":true}'- The first request runs. For 24 hours, a repeat with the same key gets the first answer back, with the header
Idempotent-Replayed: true, and nothing happens twice. - Use something unique to the action, such as your lead or order id.
- A request with
dryRun: trueis never stored for replay.
Pagination
Lists return the newest first, a page at a time.
{ "data": [ ... ], "nextCursor": "MTc5NDEzNTAwMDo5ZjNj..." }limitis 1 to 100. The default is 50.- To get the next page, send
cursorwith thenextCursoryou received. WhennextCursorisnullthere are no more. - New items created while you page do not shift or repeat what you see.
GET /conversations/{id}/messages lists oldest first so you can read a chat in order.
Last updated 13 November 2026. Found something wrong on this page? Email bodavulasiddardha@navaprastha.in and we will correct it.