Pagination
Every list takes two query parameters and answers the same shape.
| Parameter | Meaning |
|---|---|
limit | How many items to return. The default is 50 and the most is 200. |
cursor | The next_cursor of the previous page. Leave it out for the first page. |
{
"items": [ { "id": "..." } ],
"next_cursor": "eyJwIjo1MH0",
"complete": false
}To read a whole list, call again with cursor set to the next_cursor you were given, until complete is true and next_cursor is null.
cursor=""
while :; do
page=$(curl -s "https://app.konekt.so/api/v1/workspaces/$WS/leads?limit=200&cursor=$cursor" \
-H "Authorization: Bearer $KEY")
echo "$page" | jq -c '.items[]'
cursor=$(echo "$page" | jq -r '.next_cursor // empty')
[ -z "$cursor" ] && break
doneGood to know
- A cursor is opaque. Do not build or change one.
- A cursor belongs to the list and the filters it came from. Using it with another list or other filters is refused with
422and the reasoninvalid_cursor. - Some lists add fields beside the three, for example a
totalor counts. GET /workspaces/{workspace_id}/inbox/conversationsalso takessince, a time, to read only what is new.- The events feed pages in the order things happened. See Events and webhooks.