---
source_url: https://www.pubnub.com/docs/data-storage/structured-data/enable-structured-data
title: Enable DataSync
updated_at: 2026-09-30T07:20:08.000Z
---

# Enable DataSync

## Documentation index

To discover more PubNub resources:

1. Fetch [PubNub's llms.txt](https://www.pubnub.com/llms-full.txt) for a list of available pages in Markdown format.
2. Identify relevant URLs from that index.
3. Fetch the target pages.

Do not assume a path exists, always check the index first.

This guide shows you how to enable DataSync on a PubNub keyset. DataSync requires Access Manager to be active on the same keyset. Once DataSync is on, you can optionally configure which class versions publish real-time events.

As of 2026-09-21, DataSync is available to new accounts and accounts that are not actively using App Context.

## Before you start

* You need admin access to the [Admin Portal](https://admin.pubnub.com).
* The keyset you want to use must exist. To create one, refer to [Set up your account](https://www.pubnub.com/docs/architecture/authentication/set-up-your-account.md).

## Enable Access Manager on the keyset

DataSync requires Access Manager. Every DataSync request fails without it.

1. In the [Admin Portal](https://admin.pubnub.com), go to **Apps & Keysets** and select your app.
2. Select the keyset you want to configure.
3. In the keyset details, find the **Access Manager** section and turn it on.
4. Save the keyset.

## Enable DataSync on the keyset

1. In the keyset details, scroll to the **Configuration** section and open the **DataSync** tab.
2. Turn on **Enable DataSync**.
3. Under **Region**, select a region for your data storage. The region is locked after you save it and can't be changed later.
4. Save the keyset.

## Enable events for a class version

Events are off by default. To receive real-time change notifications for a class, you turn on event publishing per class version, per keyset.

1. In the keyset's **DataSync** tab, find the **Select entities to sync** section.
2. Choose which classes publish events. Only the classes you select emit events.
3. Enable each class version separately. When you add a new version of a class, events are off for it until you add a rule for the new version too.
4. Save.

:::note Enabling a rule isn't retroactive
A rule is read when the write happens and cached for up to five minutes. Turning a rule on can take that long to affect new writes. It never applies to writes that already happened.
:::

## Verify the configuration

To confirm DataSync is active, list the entity classes on your keyset with [Get all entity class entries](https://www.pubnub.com/docs/admin-api/get-all-entity-class-entries.md). You need a Service Integration API key with the **DataSync** permission, as described in [Define an entity class](https://www.pubnub.com/docs/data-storage/structured-data/define-entity-class.md#before-you-start).

```bash
curl 'https://admin-api.pubnub.com/v2/datasync/subkeys/{subKey}/entity-classes' \
  -H 'Authorization: {apiKey}' \
  -H 'PubNub-Version: 2026-09-17'
```

A `200` response lists the classes in `data`. Before you define your own classes, it contains the built-in `User` and `Channel` classes, each with `level` set to `Global` and `version` set to 1.

A `403` response with an empty body means the API key doesn't have the **DataSync** permission for this keyset. If the key is right, check that DataSync and Access Manager are both enabled on the keyset.

Last updated at: 2026-09-30T07:20:08.000Z
