Get all contacts API order by addedAt



I’m trying to get all the contacts and I used Get all contacts API. Everything is fine except I cannot find an option to get the latest data first (order by addedAt). Please help!!!


@thethlaing Not sure if the API itself comes with the ability to sort.

Otherwise, perhaps you can deal with it at code level. What I’d do is:

  1. Decode JSON (to array)
  2. Do sorting on the array based on key (addedAt); You can do custom sorting with PHP on datetime (

Hope it helps!


Hi @thethlaing

@jerome.kwek is correct in that the Contacts API doesn’t support sorting, but we do have an endpoint that you can use to get contacts ordered by when they were created:
GET /contacts/v1/lists/all/contacts/recent
For example, this will get you the most recently created contacts from the demo portal:

This endpoint follows the same rules as getting recently updated contacts, so you’ll need to use the 1vid-offsetandtime-offset` to page through the records.