---
schema_version: "1"
id: 2e0d24b34b2b12b2eedd30800fc952a03c6d795fa99edcd0a7c88019c8f2465e
title: ContainerAsyncRequest
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_containerasyncrequest.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_containerasyncrequest.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: f85148839ba0dcbbf0f0fd26e1d99cfc1ce3f9eb659cce17f3997075cd728b96
description: Allows you to compile and asynchronously deploy a MetadataContainer object to your organization.
---
# ContainerAsyncRequest

Allows you to compile and asynchronously deploy a MetadataContainer object to your organization.

## Supported SOAP API Calls

create(), describeSObjects(), query(), retrieve()

## Supported REST API HTTP Methods

Query, GET, POST

## Special Access Rules

As of the Spring '20 release, to access ContainerAsyncRequest you must have both the View All Data and Customize Application user permissions.

## Fields

| Field Name | Details |
| --- | --- |
| DeployDetails | 
Type

[DeployDetails](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_deploydetails.htm "A complex type that contains detailed XML for any compile errors reported in the asynchronous request defined by a ContainerAsyncRequest object. Replaces the JSON field CompilerErrors in Tooling API version 31.0 and later.")

Properties

Nillable

Description

Provides detailed XML for any compile errors reported during an asynchronous request. Includes componentFailures. Replaces the JSON field CompilerErrors in Tooling API version 31.0 and later.



 |
| ErrorMsg | 

Type

textarea

Properties

Nillable

Description

Errors reported during an asynchronous request.



 |
| IsCheckOnly | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort

Description

Indicates whether the asynchronous request compiles the code without making any changes to the organization (true) or compiles and saves the code (false).

This field is required.

You can compile without saving but you can’t save without compiling.





 |
| IsRunTests | 

Type

boolean

Properties

None

Description

Reserved for future use.



 |
| MetadataContainerId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

The ID of a [MetadataContainer](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_metadatacontainer.htm "Manages working copies of ApexClassMember, ApexTriggerMember, ApexPageMember, and ApexComponentMember objects, including collections of objects to be deployed together.") object.

Specify a MetadataContainerId or a MetadataContainerMemberId, but not both.





 |
| MetadataContainerMemberId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort

Description

The ID of an [ApexClassMember](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexclassmember.htm "Represents the working copy of an Apex class for editing, saving, or compiling in a MetadataContainer."), [ApexTriggerMember](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apextriggermember.htm "Represents the working copy of an Apex trigger for editing, saving, or compiling in a MetadataContainer."), [ApexPageMember](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexpagemember.htm "Represents the working copy of a Visualforce page for editing, saving, or compiling in a MetadataContainer.") or [ApexComponentMember](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexcomponentmember.htm "Represents the working copy of a Visualforce component for editing, saving, or compiling in a MetadataContainer.") object.

Specify a MetadataContainerId or a MetadataContainerMemberId, but not both.





 |
| State | 

Type

picklist

Properties

Filter, Group, Restricted picklist, Sort

Description

The state of the request. Valid values are:

- Queued—the job is in the queue.
- Invalidated—Salesforce canceled the job because the results might not be valid. This state occurs if someone changes the container members while IsCheckOnly=true, or if a newer compile request is added to the queue.
- Completed—the compilation or deployment finished. The SymbolTable fields for the specified object(s) were successfully updated. If IsCheckOnly is false, the Body for each object was saved and the MetadataContainerId field for each object was reset from the ID of the deployed [MetadataContainer](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_metadatacontainer.htm "Manages working copies of ApexClassMember, ApexTriggerMember, ApexPageMember, and ApexComponentMember objects, including collections of objects to be deployed together.") to the ID of the corresponding [ContainerAsyncRequest](# "Allows you to compile and asynchronously deploy a MetadataContainer object to your organization.") object.
- Failed—the compilation or deployment failed for the reasons stated in the CompilerError field.
- Error—an unexpected error occurred. The messages in the ErrorMsg field can be provided to Salesforce support if the issue persists.
- Aborted—use this value to delete a queued deployment.

This field is required.





 |

## Usage

When you deploy a ContainerAsyncRequest, you must specify whether to save the compiled entities:

- To compile entities without saving, set the request to IsCheckOnly=true. This option is only supported if a MetadataContainerMember is specified. A single MetadataContainerMemberId can’t be compiled without saving.
- To compile and save entities to your organization, set the request to IsCheckOnly=false.

If the compile succeeds, the SymbolTable field is updated on each object in the specified MetadataContainer. If the save or compile fails and a SymbolTable field cannot be updated, the field is cleared. If there is an outstanding save request, all updates, inserts, and deployments fail.

To terminate a queued deployment, set the State field to Aborted.