Overriding createdAt field

Hello folks,
I am migrating few pages from wordpress to datoCMS, and I was wondering if there was a way to override the createdAt meta field via the Content Management API (or even better by the editor itself).
For now I have created 2 input fields on the respective Model for achieving the said behavior. But it would be great if I can somehow overwrite the createdAt, so as to have minimal fields in my model.

Thank you :slight_smile:

hey @swaroop.sethumadhavan welcome to community!

Unfortunately those meta fields cannot be edited. They are only exposing some internal record state and cannot be updated. So you need to add your fields if you need to change content of those, sorry

Hey @mat_jack1,
Thank you for the reply.

1 Like

I have also started looking into this today.

This original post was made a while ago, so I’m not sure if things have changed?
The reason I ask is that there is another similar post here and indeed it is possible to change this field inside the UI.

Which led me to look again at the API documents.

On this page
it states "meta.created_at string Optional " which seems to confirm that it is possible to update this via the API, however when I try this, I receive a message “Meta is not a permitted key”.

As of February 2023 is it possible to update these using the API? Or is the documentation misleading me?

Happy to drop a support request if it’s possible and I shouldn’t be seeing this error.

Hello @andrew.ravenwood you can change the creator via API. You couldn’t change the createdAt and publishedAt, but we have changed that since.

For the creator, you can do something like this:

client.items.update('record-id',
{
  creator: {
    id: "accoun/user-id",
    type: "account/user/etc"
  }
});

Let me know if you need more info