> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

# Determine the state of entries and assets

> This guide explains how to determine if an entity (entries or assets) is in state draft, changed, published or archived.

## Overview

Content entities (entries and assets) can have different states. This article explains what these states are, how to access them and how to determine state by evaluating the `sys` property of payloads.

The four states are:

* **Draft:** A draft entity is not published. Only the Content Management API and Content Preview API can access entities in draft state.
* **Changed:** An updated entity is published but has pending changes. Pending changes are only accessible from the Content Management API and Content Preview API. If the entity is fetched from the Content Delivery API it will be in its last published state.
* **Published:** A published entity is published and has no been modified since. No matter which API is used to fetch it, the same content will be retrieved.
* **Archived:** An archived entity is not published and cannot be edited. Archived entities can be retrieved using the Content Management API when querying for `sys.archivedAt[exists]=true`

![detect-entry-status](/developers/docs/_fern-files/contentful.docs.buildwithfern.com/50e9d20633dd22fb5619d4fbf4e6dc2c0459bf924c0849f1ac2c51d65ed2c5cc/docs/assets/images/detect-entry-status.png)

The picture above shows the different state of entries in the Contentful web app.

## Detecting state

**Note**: This section only applies to the Content Management API.

The `sys` property of entities holds properties which can be used to detect its state.

Detect if an entity is in draft state:

```
function isDraft(entity) {
  return !entity.sys.publishedVersion
}
```

Detect if an entity is in changed state:

```
function isChanged(entity) {
  return !!entity.sys.publishedVersion &&
    entity.sys.version >= entity.sys.publishedVersion + 2
}
```

Detect if an entity is in published state:

```
function isPublished(entity) {
  return !!entity.sys.publishedVersion &&
    entity.sys.version == entity.sys.publishedVersion + 1
}
```

Detect if an entity is in archived state:

```
function isArchived(entity) {
  return !!entity.sys.archivedVersion
}
```

## Conclusion

Understanding the values of certain properties of `entity.sys` allows to detect the state of an entity. The same applies to the App SDK when working with entries: The `sys` property of entries is available as well.

### Related resources

* The `sys` property from the [Content Management API](/references/content-management-api/overview)
* The `sys` property in the [App SDK](/extensibility/app-framework/sdk#getting-the-entry-s-sys-object)