---
schema_version: "1"
id: c99b1ddb371824fd26829184c95bc63af26884e57ff2c0bff06e29c89fe1d3c7
title: Package2VersionCreateRequest
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_package2versioncreaterequest.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_package2versioncreaterequest.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 19381c0a1b043931505e0d27f830e0060a64c542edc8dfd655de0589ce336910
description: Represents a request to create a second-generation managed package or an unlocked package version in a Dev Hub org. Available in API version 41.0 and later.
---
# Package2VersionCreateRequest

Represents a request to create a second-generation managed package or an unlocked package version in a Dev Hub org. 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 |
| --- | --- |
| AsyncValidation | 
Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort

Description

If true, a new package version is created before package validations complete.

The default value is false.

For more information on async validation, see [Create and Update Versions of a Second-Generation Managed Package](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_create_pkg_ver.htm)





 |
| Branch | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The branch to associate with this package version. Can be used to create a tree structure of inheritance. Upon successful creation of a Package2Version, this value is copied to the package version’s Branch field.

The default value is null.





 |
| CalculateCodeCoverage | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort

Description

If true, code coverage is calculated during package version creation. If false, code coverage isn’t calculated.

For second-generation managed packages, a minimum 75% code coverage is required for package version promotion. This field is available in API version 47.0 and later.





 |
| CalcTransitiveDependencies | 

Type

boolean

Properties

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

Description

If true, the calculation of the package version’s indirect dependencies is enabled. A package can have multiple levels of dependencies, where pkgC depends on pkgB, and pkgB depends on pkgA, for example. By default, you list all of a package’s dependencies, including indirect (transitive) dependencies. When CalcTransitiveDependencies is set to true, you specify a package’s direct dependencies only, and the indirect dependencies are calculated for you. See [Create Dependencies Between Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_create_dependencies.htm) in the Second-Generation Managed Packaging Developer Guide.

CalcTransitiveDependencies also enables you to generate a hierarchical graph of a package version’s dependencies. To generate the dependencies graph, run the package version displaydependencies CLI command. See [package version displaydependencies](https://developer.salesforce.com/docs/atlas.en-us.264.0.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_version_displaydependencies_unified) in the Salesforce CLI Command Reference.

The default value is false.



 |
| DependencyGraphJson | 

Type

textarea

Properties

Create, Nillable, Update

Description

If CalcTransitiveDependencies is set to true, DependencyGraphJson is auto-populated with information about the package’s dependencies when you create a new package version.

If CalcTransitiveDependencies is false, the default value is null.



 |
| InstallKey | 

Type

encryptedstring

Properties

Create, Nillable

Description

Installation key for installing a key-protected package. The default is null.

Used only on insert. If you query for this value, null is always returned (for security reasons).

The default value is null.





 |
| IsConversionRequest | 

Type

boolean

Properties

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

Description

If true, this package version is being converted from a first-generation managed package to a second-generation managed package.

The default value is false.

This field is available in API version 64.0 and later.



 |
| IsDevUsePkgZipRequested | 

Type

boolean

Properties

Create, Filter, Group, Sort, Update

Description

If true, a downloadable package zip file containing package metadata is generated when a new package version is created.

The default value is false.



 |
| IsPasswordProtected | 

Type

boolean

Properties

Defaulted on create, Filter, Group, Sort

Description

Specifies whether installation of this package version requires the user to provide an installation key (true) or not (false).

The default value is null.





 |
| Language | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Restricted picklist, Sort

Description

The language for the package. The picklist values match the [Fully Supported Languages](https://help.salesforce.com/s/articleView?id=xcloud.faq_getstart_what_languages_does.htm&type=5&language=en_US) listed in Salesforce Help.

If no language is specified, the language defaults to the language of the Dev Hub user who created the package. This field is available in API version 57.0 and later.





 |
| Package2Id | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

A reference to an ID for the Package2 to create a version of.

The default value is null.





 |
| Package2VersionId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

A reference to an ID for the Package2Version that this request creates (starts with 05i).

The default value is null.





 |
| SkipValidation | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort

Description

If true, validation is skipped during package version creation. Skipping validation reduces the time it takes to create a new package version, but package versions created without validation can’t be promoted to the released state. This field is available in API version 48.0 and later.

The default value is false.

You can't specify both skip validation and code coverage, because code coverage is calculated during validation.





 |
| SourceOrg | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort

Description

The ID of the org whose shape (features, settings, limits, and licenses) information is used for creating scratch orgs used to validate metadata during creation of a second-generation managed package or unlocked package. This field is available in API version 50.0 and later.



 |
| Status | 

Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

The status of the Package2Version creation request. Valid values include:

- Queued
- Initializing
- Verifying Features and Settings
- Verifying Dependencies
- Verifying Metadata
- Finalizing PackageVersion
- Error
- Success

The preceding values are listed in the order they appear during a Package2Version create request. The default value is null.





 |
| Tag | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Optional tags for the package version.

The default value is null.





 |
| VersionInfo | 

Type

base64

Properties

Create

Description

The blob that stores details about the package version.

The default value is null.

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

#### Note

When you query Package2VersionCreateRequest, data from VersionInfo isn’t returned.















 |