---
title: "Manage scoped Context IDs"
slug: "manage-scoped-context-ids"
abstract: "Describes how to create and edit a scoped Context ID."
---
# Manage scoped Context IDs

A [Context ID](urn:resource:component:1484894) enables your application to access your organization's resources such as Personalize, CDP, and Experience Edge. When you create a SitecoreAI environment, [two Context IDs are created automatically](https://doc.sitecore.com/xmc/en/developers/xm-cloud/en/context-id-environment-variables.html) to simplify set up and configuration, but you can create additional scoped Context IDs to grant access to specific resources.

Another strong use case for scoped contexts is secret rotation without downtime. You can create a new scoped context that references the same resources, update your applications to use the new scoped context, and then safely revoke (delete) the old one.

> [!note]
> **Before you begin**
> -   To manage Context IDs, you must be an *Organization Admin* or *Organization Owner* in your Sitecore Cloud Portal organization.

## Create a scoped Context ID

A scoped Context ID is a child of a Context ID and grants access to a subset of the parent Context ID's resources. When creating a scoped Context ID, you still specify which resources it will grant access to, but can only select resources that have been added to the parent Context ID.

Scoped Context IDs allow you to assign more granular, customized access to a Context ID's resources.

> [!important]
> You must always create 2 scoped Context IDs: a server-side one (*Live*) and a client-side one (*Preview*).

To create a scoped Context ID:

1. Open the [Context IDs](https://portal.sitecorecloud.io/admin/context-ids) page in the organization where you want to create a scoped Context ID.
2. On the **Context IDs** page, click the Context ID where you want to create a scoped Context ID.
3. On the Context ID page, click **Create scoped Context ID**.
4. In the **Create scoped Context ID** dialog, select the resources that you want to add to the scoped Context ID:

    > [!note]
    > Some resources have dependencies on other resources. When you select a resource with dependencies, its required resources are automatically selected.

    - `Personalize` - grants access to a Personalize instance. If you have CDP in your Sitecore Cloud Portal organization, it also grants access to the associated CDP instance.
    - `Forms` - grants access to the [Forms app](https://doc.sitecore.com/xmc/en/users/xm-cloud/en/forms.html) of a SitecoreAI environment.
    - `Files` - grants access to files that are needed for the Component builder, Design studio, and other key features.
    - `Edge` - grants access to either the Experience Edge [Delivery API](https://doc.sitecore.com/xmc/en/developers/xm-cloud/en/delivery-api.html) (Live) or the [Preview API](https://doc.sitecore.com/xmc/en/developers/xm-cloud/en/set-up-the-graphql-ides-to-test-content.html) (Preview) of a SitecoreAI environment.
    - `Site Analytics (identifier)` - grants access to the [analytics identifier of a site](https://doc.sitecore.com/xmc/en/users/xm-cloud/en/manage-personalization-and-analytics-for-sites.html).
5. Optionally, in the **Name (optional)** field, enter a name for your Context ID.
6. Click **Save**.

Now you can use the new scoped Context ID with your app, service, or SDK.

## Edit a scoped Context ID

You can edit the resources and name of a scoped Context ID.

To edit a scoped Context ID:

1. On the **Context IDs** page, click the Context ID that contains the scoped Context ID you want to edit.
2. On the Context ID page, locate the scoped Context ID you want to edit, then click **Actions** ![actions-menu-horizontal-icon.png](https://doc.sitecore.com/api/markdown-image/portal/en/developers/sitecore-cloud-portal/images/actions-menu-horizontal-icon.png) > **Edit**.
3. In the **Edit scoped context** dialog, make your desired changes, then click **Save**.

## Delete a scoped Context ID

> [!note]
> You cannot delete Context IDs that were automatically generated when your SitecoreAI environment was created (these Context IDs have the **Master** tag), but you can [regenerate them in the Sitecore AI Deploy app](https://doc.sitecore.com/xmc/en/developers/xm-cloud/en/context-id-environment-variables.html#UUID-4b330ed0-5e30-92ed-e1eb-b75385e8e9c1_section-idm234496801778428).

To delete a scoped Context ID:

1. On the **Context IDs** page, click the Context ID that contains the scoped Context ID you want to delete.
2. On the Context ID page, locate the scoped Context ID you want to delete, then click **Actions** ![actions-menu-horizontal-icon.png](https://doc.sitecore.com/api/markdown-image/portal/en/developers/sitecore-cloud-portal/images/actions-menu-horizontal-icon.png) > **Delete**.
3. In the **Delete scoped context** dialog, enter `delete`, then click **Delete**.