
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeNo, you do not need to manually set the _updatedAt value when using the Sanity client API. This field is automatically set by the system.
According to the Sanity document type documentation, every document in Sanity automatically includes several system fields:
_id - A unique identifier for the document_rev - Revision tracking for version control_createdAt - Timestamp of when the document was created_updatedAt - Timestamp of the last modificationThese fields are managed automatically by Sanity's Content Lake. When you create or update a document through mutations (like create, patch, createOrReplace, etc.), Sanity automatically:
_createdAt when the document is first created_updatedAt every time the document is modifiedWhile these timestamps are automatically set by the system, there's an important note from the documentation:
"_createdAt and _updatedAt are automatically set by the system to the current time when the document is created or updated, respectively. It is possible to provide a custom value when the document is initially created via a
create,createIfNotExists, orcreateOrReplacemutation. Since the timestamps can be set by a client, they should never be assumed to be accurate."
This means:
Simply perform your mutations without worrying about _updatedAt or _createdAt - Sanity will handle these system fields automatically for you. The system automatically updates _updatedAt every time you modify a document through any mutation operation.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store