DeployRequest

Uses file representations of metadata components to create, update, or delete those components in a Salesforce org. This object is available in API version 49.0 and later.

Supported SOAP Calls

describeSObjects(), query(), retrieve().

Supported REST HTTP Methods

GET, HEAD, Query

Special Access Rules

Your client application must be logged in with the Modify Metadata Through Metadata API Functions OR Modify All Data permission.

If a user requires access to metadata but not to data, enable the Modify Metadata Through Metadata API Functions permission. Otherwise, enable the Modify All Data permission.

Note

Fields

Field Details
AllowMissingFiles
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If files that are specified in package.xml are not in the .zip file, specifies whether a deployment can still succeed (true) or not (false).Do not set this argument to true for deployment to production orgs.
The default value is false.
AutoUpdatePackage
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If a file is in the .zip file but not specified in package.xml, specifies whether the file is automatically added to the package (true) or not (false). A retrieve() is issued with the updated package.xml that includes the .zip file. Do not set this argument to true for deployment to production orgs.
The default value is false.
CanceledById
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the user who canceled the deployment. This is a relationship field.
Relationship Name
CanceledBy
Relationship Type
Lookup
ChangeSetName
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Specifies the name of the change set for the deployment.
CheckOnly
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether this deployment is being used to check the validity of the deployed files without making any changes in the organization (true) or not (false). A check-only deployment does not deploy any components or change the organization in any way.
The default value is false.
CompletedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Timestamp for when the deployment process ended.
DeployTestResults
Type
QueryResult
Properties
Filter, Nillable, Sort
Description
Specifies the deployment test result.
ErrorMessage
Type
string
Properties
Filter, Nillable, Sort
Description
Message corresponding to the values in the ErrorStatusCode field, if any.
ErrorStatusCode
Type
QueryResult
Properties
Filter, Group, Nillable, Sort
Description
If an error occurred during the deploy() call, a status code is returned, and the message corresponding to the status code is returned in the ErrorMessagefield.For a description of each StatusCode value, see “StatusCode” in the SOAP API Developer Guide.
IgnoreWarnings
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Specifies whether a deployment should continue even if the deployment generates warnings (true) or not (false).Do not set this argument to true for deployments to production organizations.
The default value is false.
NumberComponentErrors
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of components that generated errors during this deployment.
NumberComponentsDeployed
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of components deployed in the deployment process. Use this value with the NumberComponentsTotal value to get an estimate of the deployment’s progress.
NumberComponentsTotal
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The total number of components in the deployment. Use this value with the NumberComponentsDeployed value to get an estimate of the deployment’s progress.
NumberTestErrors
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of Apex tests that have generated errors during this deployment.
NumberTestsCompleted
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of completed Apex tests for this deployment. Use this value with the NumberTestsTotal value to get an estimate of the deployment’s test progress.
NumberTestsTotal
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The total number of Apex tests for this deployment. Use this value with the NumberTestsCompleted value to get an estimate of the deployment’s test progress. The value in this field is not accurate until the deployment has started running tests for the components being deployed.
PurgeOnDelete
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether to purge on delete (true) or not (false).
The default value is false.
RollbackOnError
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether any failure causes a complete rollback (true) or not (false). If false, whatever set of actions can be performed without errors are performed, and errors are returned for the remaining actions.
This parameter must be set to true if you are deploying to a production organization.
The default value is false.
RunTestsEnabled
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether Apex tests were run as part of this deployment (true) or not (false). Tests are either automatically run as part of a deployment or can be set to run in DeployOptions for the deploy() call. For information on when tests are automatically run, see Running Tests in a Deployment.
The default value is false.
SinglePackage
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether to deploy as a single package (true) or not (false)
The default value is false.
StartDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Timestamp for when the deployment process began.
StateDetail
Type
string
Properties
Filter, Nillable, Sort
Description
Indicates which component is being deployed or which Apex test class is running.
Status
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The current state of the deployment. Possible values are: 
  • Canceled
  • Canceling
  • Failed
  • InProgress
  • Pending
  • Succeeded
  • SucceededPartial
TestLevel
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Indicates which tests to run. Possible values are:
  • NoTestRun
  • RunAllTestsInOrg
  • RunLocalTests
  • RunSpecifiedTests
Type
Type
picklist
Properties
Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
The type of deployment to perform. Possible values are:
  • Api (default)
  • Changeset