Hygraph
Docs

#Content Freeze API reference

A content freeze pauses content creation, editing, and publishing across an environment or an entire project, while schema changes are promoted. This reference covers the contentFreezes query and the setContentFreeze and liftContentFreeze mutations, so you can read, start, and lift a freeze directly through the Management API.

For information on configuring a freeze from Studio and what editors see while one is active, see Content Freeze.

#Authentication

Use a Permanent Auth Token or App Token with the Management API.

  • contentFreezes: Any project member can read freeze history.
  • setContentFreeze and liftContentFreeze: Require the Allows starting, scheduling, and lifting content freezes permission. The Admin role includes it by default; you can also grant it on custom roles or PATs.

#Retrieve content freeze

Returns every content freeze for the project, past and present, unless you filter the list. Run the contentFreezes query on project.

Parameters
ArgumentTypeDefaultDescription
filterContentFreezeFilterALLPass OPEN to return only freezes that haven't ended yet.

contentFreezes doesn't take pagination arguments. It returns the full list for the project on every call. It also doesn't filter by environment. If you need freezes for a specific environment, filter the returned list on the environment field.

Fields
FieldTypeDescription
idID!Unique identifier for the freeze.
createdAtDateTime!When the freeze record was created.
updatedAtDateTime!When the freeze record last changed.
environmentEnvironmentThe environment this freeze applies to. Null for a project-wide freeze.
startAtDateTime!When the freeze begins.
endAtDateTimeWhen the freeze ends. null for an open-ended freeze (no scheduled end). Set to a future time when you schedule an end, or to the current time when the freeze is lifted early.
messageStringAnnouncement message shown to editors. Null if none was set.
setByCreatedByWho started the freeze: a project member, Permanent Auth Token, or App Token.
liftedByCreatedByWho ended the freeze early: a project member, Permanent Auth Token, or App Token. null if it reached its scheduled end.

#Example query

#Set content freeze

Use the setContentFreeze mutation to start a freeze or reschedule the current freeze. Requires the Allows starting, scheduling, and lifting content freezes permission.

Parameters
ArgumentTypeRequiredDescription
data.projectIdID!YesThe project to freeze.
data.environmentIdIDNoTarget environment. Omit for a project-wide freeze.
data.startAtDateTimeNoWhen the freeze begins. Omit to start immediately.
data.endAtDateTimeNoWhen the freeze ends. Omit for an open-ended freeze.
data.messageStringNoAnnouncement message shown to editors.

Each call applies to a single scope, either one environment or the whole project. To freeze multiple environments, call setContentFreeze once per environment ID. Calling it again for the same scope ends any open freeze for that scope and creates a new one.

startAt and endAt must not be in the past. If you set endAt, it must not be before startAt.

Returns

ContentFreezePayload, containing project. Query contentFreezes to confirm the resulting freeze.

#Examples

  • Set a project-wide freeze, starting immediately, with no end date:

  • Set a freeze scoped to one environment, with a message:

#Lift content freeze

Use the liftContentFreeze mutation to end the current freeze for a scope before its scheduled end. Requires the Allows starting, scheduling, and lifting content freezes permission.

Parameters
ArgumentTypeRequiredDescription
data.projectIdID!YesThe project whose freeze you're lifting.
data.environmentIdIDNoTarget environment. Omit to lift a project-wide freeze.

Lifting a freeze sets its endAt to the current time. The record isn't deleted; it remains queryable through contentFreezes as a record.

Returns

ContentFreezePayload, containing project. Query contentFreezes to confirm the freeze ended.

#Examples

  • Lift a project-wide freeze:

  • Lift an environment-scoped freeze:

  • Content Freeze: Learn what a content freeze does and how to configure it from Studio.
  • Environments: Create and manage the environments a freeze can target.
  • Management API permissions: Confirm who holds the Allows starting, scheduling, and lifting content freezes permission.