Search code examples
twiliotwilio-conversations

Read multiple conversations resources - ordering?


My question is about the following APIs:

What is the ordering of the conversations returned by the above APIs? Are they ordered by most/least recent activity? Most/least recent creation time? Or is the ordering undefined?


Solution

  • I had to check this with the conversations team, the ordering of conversation resources is undefined and you should not necessarily rely on the order.

    If you want to keep an order of conversations, particularly most recent activity, you could set up webhooks to receive updates when a message is added or updated and store that last updated time against conversation IDs in your own database and use that to order them in the client side.