---
schema_version: "1"
id: 3e3e8afe9aa9d80dd8bba87b7b17296db29b007747f940e6901a1a46cee7e058
title: Package2
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_package2.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_package2.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 001df19776508723e814f10d65cc69ca94ce60f3d7f79dbb332b16917144fef1
description: Represents a second-generation managed package or an unlocked package in a Dev Hub org. Values for all fields are visible to the subscriber. Available in API version 41.0 and later.
---
# Package2

Represents a second-generation managed package or an unlocked package in a Dev Hub org. Values for all fields are visible to the subscriber. Available in API version 41.0 and later.

## Supported SOAP Calls

create(), query(), retrieve(), update(), upsert()

## Supported REST HTTP Methods

Query, GET, POST

## Fields

| Field | Details |
| --- | --- |
| AppAnalyticsEnabled | 
Type

boolean

Properties

Defaulted on create, Filter, Group, Sort, Update

Description

If true AppExchange App Analytics can access package usage logs and subscriber snapshots.

The default value is false.



 |
| ContainerOptions | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort

Description

Container options for the second-generation package. These options determine the upgrade and editability rules. The default value is Managed.

Valid values include:

- Managed (developer-managed, subscriber-managed)
- Unlocked (developer-controlled, subscriber-editable)







 |
| ConvertedFromPackageId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort

Description

The package ID (starts with 033) for the first-generation managed package that was converted. This field is available in API version 64.0 and later.

This field is a relationship field.

Relationship Name

ConvertedFromPackage

Refers To

SubscriberPackage



 |
| DataCloudPackage | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort

Description

If true, this package contains Data 360 metadata. When creating a managed package with Data 360 metadata, you must isolate the Data 360 metadata from the other Salesforce metadata by creating a separate package that contains only Data 360 metadata.

Then create a package dependency between your dedicated Data 360 package and any related packages.

The default value is false.



 |
| Description | 

Type

string

Properties

Create, Filter, Nillable, Sort, Update

Description

Description of the package.



 |
| IsDeprecated | 

Type

boolean

Properties

Defaulted on create, Filter, Group, Sort, Update

Description

Specifies whether this package has been marked as deprecated (true) or not (false). The default value is false.

If you set IsDeprecated to true for a package, the package and all of its child package versions are deprecated.

If you set IsDeprecated to false for a package, the package and all of its child package versions are undeprecated. However, if IsDeprecated is explicitly set to true for a package version _after_ its parent package is deprecated, the child remains deprecated even if you undeprecate its parent.

If you set IsDeprecated to false for a package version whose parent package is deprecated, the package version’s IsDeprecated value remains true until its parent is undeprecated.

Deprecated package versions that have been installed in subscriber orgs continue to function, but new installations of deprecated package versions are blocked.





 |
| IsOrgDependent | 

Type

boolean

Properties

Filter, Group, Sort

Description

Indicates whether the package depends on unpackaged metadata in the installation org (true) or not (false). This field only applies to unlocked packages. The default value is false. Available in API version 49.0 and later.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Name of the package. Unlike a typical developer name, this value is mutable and can contain special characters.



 |
| NamespacePrefix | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort

Description

Namespace prefix that identifies the components of your package in the subscriber’s org.



 |
| PackageErrorUsername | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The email address for an active user in the Dev Hub org you want to receive email notification regarding package-related errors. You can set the field when creating a package and update it later.



 |
| SubscriberPackageID | 

Type

reference

Properties

Filter, Group, Sort, Unique

Description

ID that identifies this package across all Salesforce instances (starts with 033).

This value is case-sensitive and must be unique.





 |
| WasTransferred | 

Type

boolean

Properties

Defaulted on create, Filter, Group, Sort

Description

Indicates whether the package was previously associated with a different Dev Hub org. For details, see: [Transfer a Second-Generation Managed Package to a Different Dev Hub](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev2gp_package_transfer.htm). This field is available in API version 57.0 and later. The default value is false.



 |

## Usage

Subscribers install package versions ([Package2Version](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_package2version.htm#tooling_api_objects_package2version "Represents a second-generation package version in a Dev Hub org. Values for all fields except for Tag and Branch are visible to the subscriber. Available in API version 41.0 and later.")s) in their orgs.