---
title: "Update a guest data extension (legacy)"
slug: "update-a-guest-data-extension--legacy-"
abstract: "Describes how to update a guest data extension using the Sitecore CDP Guest data extension REST API."
---
# Update a guest data extension (legacy)

> [!important]
> [A newer version of this REST API (v2.1) is available](https://doc.sitecore.com/cdp/en/developers/guest-rest-api/index.html). If you're new to the Guest REST API, use the new version. Alternatively, if you're already using the old version, [read about the differences between v2 and v2.1](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/guest-data-extension-rest-api-v2--legacy-/differences-between-v2-and-v2-1-of-the-guest-and-guest-data-extension-rest-apis.html "Differences between v2 and v2.1 of the Guest and Guest data extension REST APIs") so you can upgrade.

`POST /v2/guests/<guestRef>/extext/<dataExtensionRef>`

Updates a guest data extension for a guest. An update replaces all existing attributes.

| Attribute | Type | Description | Example |
| --- | --- | --- | --- |
| `guestRef` | string | The reference of the guest record.<br><br>If you do not know the guest reference, first [retrieve guests](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/guest-data-extension-rest-api-v2--legacy-/retrieve-guests--legacy-.html). | `f7aabbca-1c1b-4fc2-be72-3e16294a4f03` |
| `dataExtensionRef` | string | The reference of the data extension.<br><br>If you do not know the data extension reference, first [create a guest data extension](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/guest-data-extension-rest-api-v2--legacy-/create-a-guest-data-extension--legacy-.html). | `09bfc8cc-3815-5b77-b75a-d3cc6a867c1a` |

In the request body, you must include one object for the data extension. Note the following about the object:

- The object can contain primitive values only. You cannot nest objects. If grouping is required, use common prefixes for the attribute names.
- A guest data extension object has a maximum of 100 attributes.
- You must include the following required attribute in the object: `"key": "default"`.
- The other attributes that you include in the object become the guest data extensions. For example, if you include `"loyaltyTier": "level2"` in the request body, *Loyalty Tier* becomes a guest data extension.

The following is a list of guidelines for using attributes in the data extension:

- The attribute name must be alphanumeric \[A-Z,a-z,0-9\] as per the [JSON RFC 7159](https://www.rfc-editor.org/rfc/rfc7159) specification.
- You must write the attribute name of the data extension in camel case.
- We recommend making the attribute name meaningful.
- An update replaces all existing attributes. Therefore, when you update a guest data extension, you must provide all existing attributes as well as any new ones.

```curl
curl -X POST '<baseURL>/v2/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03/extext/09bfc8cc-3815-5b77-b75a-d3cc6a867c1a' \
-u '<username>:<password>' \
-H 'Accept: application/json' \
--data-raw '
{
    "key": "default",
    "membership": "deactivated"
}'

```

```json
{
    "href": "<baseURL>/v2/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03/extext/09bfc8cc-3815-5b77-b75a-d3cc6a867c1a",
    "ref": "09bfc8cc-3815-5b77-b75a-d3cc6a867c1a",
    "key": "default",
    "createdAt": "2026-12-16T07:`53:19`.253Z",
    "modifiedAt": "2026-12-16T07:`53:41`.572Z",
    "membership": "deactivated",
    "guest": {
        "href": "<baseURL>/v2/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03"
    }
}

```