Issue with fetching posts from a channel, limited to timespan

I am trying to fetch all messages that have been sent to a channel in the last 24 hours. According to the documentation the correct endpoint would be:


The explanation for the since-parameter says:

Provide a non-zero value in Unix time milliseconds to select posts modified after that time

So from my understanding I would need to issue a request to the following URL to fetch the range of posts I want (in this case all posts that have been made since June 10th, 12 p.m.):


However this does not return any results at all. I suspected this might be because of an error in the documentation, and instead that I would need to use seconds, not miliseconds:


This time I got the first 1000 results since the beginning of the channel history. But from my understanding this should result in all posts that have been made since that date, not until that date. Does anyone have an idea what my mistake could be?

Unfortunately I don’t have access to the server-side logfiles. I am convinced that I am missing something obvious here, but I can’t for the life of me find the issue on my own. Thank you for your help!

Hi gmmi,

this works for me here on 7.0.1.
I’m querying all posts in the channel and print out the “create_at” attribute for them (most recent posting at the top):

$ curl -sH 'Authorization: Bearer top-secret'  | jq -r .posts[].create_at | sort -r

And when I add the ?since parameter, it filters them out correctly, so when I use ?since=1657891087270 I will only see the two most recent messages (the filter is exclusive):

$ curl -sH 'Authorization: Bearer top-secret'  | jq -r .posts[].create_at | sort -r

How does this simple example look like on your installation and what Mattermost version are you using?