---
schema_version: "1"
id: b816c3c57e0895883034fdbeadd870d09dd39d0cec670329c3c765556e31033f
title: Retrieve and Update Information
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/security/scoping-rules-dev-guide/guides/scoping-rules/quickstart/scoping-rules-quickstart-tooling-methods.md
canonical_url: https://developer.salesforce.com/docs/platform/scoping-rules-dev-guide/guide/scoping-rules-quickstart-tooling-methods.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 82f260889633472e72b42be70c433c39007bbdf2cd96fbe47627a40d9092bbf0
products:
  - Scoping Rules Developer Guide
  - Security
---

# Retrieve and Update Information

Use the GET, PATCH, and DELETE methods to retrieve, update, and delete scoping rules.

|Required Editions|
|-----------------|
|Available in: Lightning Experience in **Performance** and **Unlimited** Editions|

## Retrieve

To retrieve information about a scoping rule, use the GET method.

Example HTTP Method and URI:

```nolang
GET /services/data/v68.0/tooling/query/?q=SELECT+id,+targetEntity,+enforcementType,+recordFilter,+userCriteria+FROM+RestrictionRule+WHERE+enforcementtype='Scoping'
```

## Update

To update a scoping rule, use the PATCH method.

We recommend that you don’t update the value of `targetEntity` after a scoping rule is created. Instead, delete the scoping rule and create another one with the correct values.

Example HTTP Method and URI:

```nolang
PATCH /services/data/v68.0/tooling/sobjects/RestrictionRule/0eYxxxxxxxxxxxx2AY
```

Replace `0eYxxxxxxxxxxxx2AY` with the ID returned when the scoping rule was created.

Example Request Body:

Include all Metadata fields, even if you aren’t updating them. Specify the `FullName` value only if you’re changing this field.

This example deactivates the scoping rule by setting `active` to `false`.

```nolang
{
    "Metadata": {
        "active": false,
        "description": "sales support associate sees only account records of specified advisor",
        "enforcementType": "Scoping",
        "masterLabel": "Advisor1 Record Set",
        "recordFilter": "SOQL(id, SELECT Account__c FROM Client_Entitlement__c USING SCOPE EVERYTHING
	WHERE Team_Entitlement__c IN (
		SELECT Team_Entitlement__c
		FROM User_Entitlement__c
			USING SCOPE EVERYTHING
		WHERE User__c = $User.id)
	)",
        "targetEntity": "Account",
        "userCriteria": "$User.ProfileId = '00exxxxxxxxxxxx'",
        "version": 1
    }
}
```

## Delete

To delete a scoping rule, use the DELETE method.

Example HTTP Method and URI:

`DELETE /services/data/v68.0/tooling/sobjects/RestrictionRule/0eYxxxxxxxxxxxx2AY`

Replace `0eYxxxxxxxxxxxx2AY` with the ID returned when creating the scoping rule.

**note:** If the `userCriteria` or `recordCriteria` field contains a Salesforce org ID and you’re deploying to a different org than the org you retrieved them from, modify the Salesforce ID first.

