---
schema_version: "1"
id: 6fbcdcc4c0242899f26f1465d337b43e6291dbd3c21c3cefea0c453c0922c819
title: SharedTo
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_sharedto.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharedto.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: de145e316a41c22dcd771611622fc14ec6e8e991235b169886c0a8146ed5c2b4
description: SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.
---
# SharedTo

SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.

See [Sharing Considerations](https://help.salesforce.com/s/articleView?id=platform.security_sharing_considerations.htm&type=5&language=en_US) and [Public and Personal Groups](https://help.salesforce.com/s/articleView?id=platform.user_groups.htm&type=5&language=en_US) in Salesforce Help.

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

#### Note

[SharedTo](#meta_sharedto "SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.") is included in the metadata for shared and private list views. [SharedTo](#meta_sharedto "SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.") isn’t in the metadata for public list views.

## Declarative Metadata File Suffix and Directory Location

[SharedTo](#meta_sharedto "SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.") is used with [ListView](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_listview.htm "ListView allows you to see a filtered list of records, such as contacts, accounts, or custom objects."), [Folder](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_folder.htm "Represents a folder. This type extends the Metadata metadata type and inherits its fullName field."), and [SharingRules](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingrules.htm "Represents the base container for sharing rules, which can be criteria-based, ownership-based, territory-based, or for guest user access. SharingRules enables you to share records with a set of users, using rules that specify the access level for the target user group.").

## Version

[SharedTo](#meta_sharedto "SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.") is available in API version 17.0 and later.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d861905e142">Field</th>

              <th class="featureTableHeader  " id="d861905e145">Field Type</th>

              <th class="featureTableHeader  " id="d861905e148">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">allCustomerPortalUsers</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string</td>

              <td class="entry" headers="d861905e148" data-title="Description">A group containing all customer portal users.<p class="p">This field is available in API
                  version 24.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">allInternalUsers</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string</td>

              <td class="entry" headers="d861905e148" data-title="Description">A group containing all internal and nonportal users. <p class="p">This field is available
                  in API version 24.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">allPartnerUsers</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string</td>

              <td class="entry" headers="d861905e148" data-title="Description">A group containing all partner users. <p class="p">This field is available in API version
                  24.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">allRestrictedEmployeeUsers</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string</td>

              <td class="entry" headers="d861905e148" data-title="Description">A group containing only employee users with the Unified Employee license. Use
                to extend these users’ access.<p class="p">This field is available in API version 68.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">channelProgramGroup</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string</td>

              <td class="entry" headers="d861905e148" data-title="Description">A system-managed group with sharing access containing all partner members of
                the corresponding channel program or level. <p class="p">This field is available in API
                  version 41.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">channelProgramGroups</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of system-managed groups with sharing access containing all partner
                members of the corresponding channel programs or levels. <p class="p">This field is available
                  in API version 41.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_group"><a name="field_group"><!-- --></a>group</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of groups with sharing access. Use this field instead of the groups<p class="p"> field.This field is available in API
                  version 22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">guestUser</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of guest user nicknames with sharing access. This field can be used only
                with SharingGuestRule.<p class="p">This field is available in API version 47.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_groups"><a name="field_groups"><!-- --></a>groups</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of groups with sharing access. <p class="p">Use the group field instead for API version 22.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">managerSubordinates</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of users whose direct and indirect subordinates receive sharing access.
                This field is available in API version 24.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">managers</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of users whose direct and indirect managers receive sharing access. This
                field is available in API version 24.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">portalRole</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of groups with sharing access containing all users in a portal role.
                <p class="p">This field is available in API version 24.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">portalRoleandSubordinates</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of groups with sharing access containing all users in a portal role or
                any users under that role. <p class="p">This field is available in API version 24.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_role"><a name="field_role"><!-- --></a>role</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of roles with sharing access. Use this field instead of the roles<p class="p"> field.This field is available in API
                  version 22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_roleAndSubordinates"><a name="field_roleAndSubordinates"><!-- --></a>roleAndSubordinates</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of roles with sharing access. All roles below each of these roles in the
                role hierarchy also have sharing access. If portal accounts are enabled, then all
                roles and portal accounts below each of these roles in the role hierarchy also have
                sharing access. Use this field instead of the rolesAndSubordinates<p class="p"> field.This field is
                  available in API version 22.0 and later and is only available when digital
                  experiences is enabled for your org and Experience Cloud site users are created
                  with external account roles other than a shared person account role.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">roleAndSubordinatesInternal</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of roles with sharing access. All roles below each of these roles in the
                role hierarchy also have sharing access.<p class="p">This field is available in API version
                  22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_roles"><a name="field_roles"><!-- --></a>roles</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of roles with sharing access. <p class="p">Use the role field instead for API version 22.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_rolesAndSubordinates"><a name="field_rolesAndSubordinates"><!-- --></a>rolesAndSubordinates</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of roles with sharing access. All roles below each of these roles in the
                role hierarchy also have sharing access. If portal accounts are enabled, then all
                roles and portal accounts below each of these roles in the role hierarchy also have
                sharing access. <p class="p">Use the roleAndSubordinates field instead for API
                  version 22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_territories"><a name="field_territories"><!-- --></a>territories</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of territories with sharing access. <p class="p">Use the territory field instead for API version 22.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_territoriesAndSubordinates"><a name="field_territoriesAndSubordinates"><!-- --></a>territoriesAndSubordinates</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of territories with sharing access. All territories below each of these
                territories in the territory hierarchy also have sharing access. <p class="p">Use the
                  territoryAndSubordinates field instead
                  for API version 22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_territory"><a name="field_territory"><!-- --></a>territory</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of territories with sharing access. Use this field instead of the
                territories<p class="p"> field. If you’re using
                  Sales Territories, use <var class="keyword varname">modelName.territoryName</var> for the
                  shared-to and shared-from <span class="keyword parmname">territory</span> values, where: </p>

                <ul class="ul bulletList">
                  <li class="li">
                    <var class="keyword varname">modelName</var> equals the name of the active territory model in
                    the API.
                  </li>

                  <li class="li">
                    <var class="keyword varname">territoryName</var> equals the territory’s name in the API.
                  </li>

                </ul>
                <p class="p">This field is available in API version 22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname" id="field_territoryAndSubordinates"><a name="field_territoryAndSubordinates"><!-- --></a>territoryAndSubordinates</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of territories with sharing access. All territories below each of these
                territories in the territory hierarchy also have sharing access. Use this field
                instead of the territoriesAndSubordinates<p class="p">
                  field. If you’re using Sales Territories, use
                  <var class="keyword varname">modelName.territoryName</var> for the shared-to and shared-from
                  <span class="keyword parmname">territoryAndSubordinates</span> values, where:
                </p>

                <ul class="ul bulletList">
                  <li class="li">
                    <var class="keyword varname">modelName</var> equals the name of the active territory model in
                    the API.
                  </li>

                  <li class="li">
                    <var class="keyword varname">territoryName</var> equals the territory’s name in the API.
                  </li>

                </ul>
                <p class="p">This field is available in API version 22.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d861905e142" data-title="Field"><span class="keyword parmname">queue</span></td>

              <td class="entry" headers="d861905e145" data-title="Field Type">string[]</td>

              <td class="entry" headers="d861905e148" data-title="Description">A list of queues with sharing access. Applies only to lead, case, and
                CustomObject sharing rules. <p class="p">This field is available in API version 24.0 and
                  later.</p>
              </td>

            </tr>

          </tbody>

        </table>