---
schema_version: "1"
id: 53727ba13160d2bde21e53807a4b1d7c0b93fe0c4e1cdf893412a7ac49574f53
title: AccountTerritorySharingRule
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_accountterritorysharingrule.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_accountterritorysharingrule.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8cdf9a262eda9adb24364db3c8b5d9723d24be0547bac61e6afd9a90136e906e
description: Represents the rules for sharing an Account within a territory.
---
# AccountTerritorySharingRule

Represents the rules for sharing an Account within a territory.

## Supported Calls

create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update(), upsert()

## Special Access Rules

Customer Portal users can’t access this object.

## Fields

| Field | Details |
| --- | --- |
| AccountAccessLevel | 
Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

A value that represents the type of sharing being allowed. The possible values are:

- Read
- Edit
- All





 |
| CaseAccessLevel | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

A value that represents the type of access granted to the target group for all child cases of the account. The possible values are:

- None
- Read
- Edit





 |
| ContactAccessLevel | 

Type

picklist

Properties

Filter, Group, Restricted picklist, Sort

Description

A value that represents the type of access granted to the target group for all related contacts on the account. The possible values are:

- None
- Read
- Edit

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

This field is read only.















 |
| Description | 

Type

textarea

Properties

Create, Filter, Nillable, Sort, Update

Description

A description of the sharing rule. Maximum size is 1000 characters. This field is available in API version 29.0 and later.



 |
| DeveloperName | 

Type

string

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization. Corresponds to **Rule Name** in the user interface.

This field is available in API version 24.0 and later.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance may slow while Salesforce generates one for each record.















 |
| GroupId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

The ID representing the source group. Accounts owned by users in the source territory trigger the rule to give access.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, Sort, Update

Description

Label of the sharing rule as it appears in the user interface. Limited to 80 characters. Corresponds to **Label** on the user interface.



 |
| OpportunityAccessLevel | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

A value that represents the type of access granted to the target group for all opportunities associated with the account. The possible values are:

- None
- Read
- Edit





 |
| UserOrGroupId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

The ID representing the user or group being given access, or, if a territory ID, the users assigned to that territory.



 |

## Usage

Use this object to manage the sharing rules for a particular object. General sharing and territory-related sharing use this object.

#### See Also

- [Account](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm "Represents an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).")
- [AccountShare](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_accountshare.htm "Represents a sharing entry on an account.")