Post update with API and update date

I use the APIs with NodeJS to update my posts.

apparently I can’t update a post without first GET the post.

I understand that when I update a post, the updated_at parameter is mandatory, but it only works if I use the same date already present in the database.

So I get the last post update date (updated_at) with GET, then I can PUT and in the updated_at parameter I put the same updated_at value that I got with GET.

If I put the current date in the updated_at parameter in the PUT, I get a 409 error.

What am I doing wrong? How do I enter the current update date without using the old one?

You’re not doing anything wrong, that’s the intended behaviour of the API. updated_at can’t be set manually, it’s automatically updated by the server with the current time any time a change is made. The reason you need to supply the last-known date when saving is to avoid overwriting changes made by other users or even the system if a scheduled post had been published for example.

https://ghost.org/docs/admin-api/#updating-a-post

hi @Kevin thanks for confirming.
I read the DOC but it wasn’t clear to me.
Thank you