---
schema_version: "1"
id: 5e0eb40bda4fdd3fbc768ff894575789e635c90799d894cf8b64660cd736027a
title: Territory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_territory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_territory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3248c159762be03f22e333c9b2ef73e54a8a050039aae2b6f8dd9acf3091a05b
description: Represents a territory.
---
# Territory

Represents a territory.

## Declarative Metadata File Suffix and Directory Location

The file suffix for territory components is .territory and components are stored in the territories directory of the corresponding package directory.

## Version

Territory components are available in API version 24.0 and later.

## Fields

This metadata type extends to subtype [RoleOrTerritory](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_roleorterritory.htm#meta_roleorterritory "Represents the common base type and valid values for role or territory.").

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



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

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

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

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d894876e93" data-title="Field Name"><span class="keyword parmname">accountAccessLevel</span></td>

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

              <td class="entry" headers="d894876e99" data-title="Description">
                <span class="ph" id="accountAccessLevel_desc1"><a name="accountAccessLevel_desc1"><!-- --></a>Specifies whether users in this
                  territory can access accounts that are assigned to this
                  territory and are otherwise inaccessible. Valid values
                  are:</span><a name="accountAccessLevel_desc2"><!-- --></a>
                <ul class="ul bulletList" id="accountAccessLevel_desc2">
                  <li class="li"><samp class="codeph apex_code">Read</samp></li>

                  <li class="li"><samp class="codeph apex_code">Edit</samp></li>

                  <li class="li"><samp class="codeph apex_code">All</samp></li>

                </ul>
                <p class="p" id="accountAccessLevel_desc3"><a name="accountAccessLevel_desc3"><!-- --></a>If your organization’s
                  sharing model for accounts is Public Read/Write, valid values
                  are only <samp class="codeph apex_code">Edit</samp> and
                  <samp class="codeph apex_code">All</samp>.
                </p>
                <p class="p">If no
                  value is set for this field, this field value uses the default
                  access level that is specified in the Manage Territory page in
                  Setup.</p>
                <p class="p">This field is available in API version 31.0 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d894876e93" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

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

              <td class="entry" headers="d894876e99" data-title="Description">The unique identifier for API access. The
                <span class="keyword parmname">fullName</span> can contain only underscores and
                alphanumeric characters. It must be unique, begin with a letter, not
                include spaces, not end with an underscore, and not contain two
                consecutive underscores. This field is inherited from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a>
                component. Corresponds to <strong class="ph uicontrol">Territory Name</strong> in
                the user interface.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d894876e93" data-title="Field Name"><span class="keyword parmname">parentTerritory</span></td>

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

              <td class="entry" headers="d894876e99" data-title="Description">The territory above this territory in the territory
                hierarchy.</td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is the definition of a territory.

<?xml version="1.0" encoding="UTF-8"?>
<Territory xmlns="http://soap.sforce.com/2006/04/metadata">
    <accountAccessLevel\>Edit</accountAccessLevel\>
    <caseAccessLevel\>Edit</caseAccessLevel\>
    <contactAccessLevel\>Edit</contactAccessLevel\>
    <description\>Sample Territory</description\>
    <mayForecastManagerShare\>false</mayForecastManagerShare\>
    <name\>T22name</name\>
    <opportunityAccessLevel\>Read</opportunityAccessLevel\>
</Territory\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).