---
schema_version: "1"
id: 2ca02d1751ee85bbd801760e64773c8b087f9aa3b83bae9b8a931a5f07a64a36
title: MetadataContainer
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_metadatacontainer.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_metadatacontainer.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0938cc9db3d188be6ac0bcd1d2d542a9fb5daa4beba7a6817befa050d9025acc
description: Manages working copies of ApexClassMember, ApexTriggerMember, ApexPageMember, and ApexComponentMember objects, including collections of objects to be deployed together.
---
# MetadataContainer

Manages working copies of ApexClassMember, ApexTriggerMember, ApexPageMember, and ApexComponentMember objects, including collections of objects to be deployed together.

## Supported SOAP API Calls

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

## Supported REST API HTTP Methods

Query, GET, POST, PATCH, DELETE

## Special Access Rules

As of the Spring '20 release, to access MetadataContainer you must have the View All Data user permission and either the Author Apex user permission or the Customize Application user permission.

## Fields

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

string

Properties

Create, Filter, Group, Sort, Update

Description

The name of the MetadataContainer. If a container with the same name already exists, an error is reported on create() or POST.

This field is required.





 |

## Usage

Use a MetadataContainer as a package for your tool’s workspace. As a user works in the tool, update the [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."), and [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.") objects in the MetadataContainer and use a [ContainerAsyncRequest](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_containerasyncrequest.htm "Allows you to compile and asynchronously deploy a MetadataContainer object to your organization.") object to save and deploy changes to the current organization.

A MetadataContainer can be reused, but container members can’t.

- When a ContainerAsyncRequest completes successfully, the MetadataContainerId field on all container members is changed from the ID of the MetadataContainer to the ID of the ContainerAsyncRequest. At this point, container members can no longer be modified or deployed, and can’t be queried via the MetadataContainer; you have to query the ContainerAsyncRequest to see what was deployed.
- If the deployment fails, container members remain on the MetadataContainer and can still be modified until they are successfully deployed on another ContainerAsyncRequest. The MetadataContainerId field on the completed (failed deployment) ContainerAsyncRequest is set to the ID of the MetadataContainer, so you can have multiple completed ContainerAsyncRequests on a single MetadataContainer.

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

#### Note

Deleting a MetadataContainer deletes all objects that reference it.

#### See Also

- [Metadata API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/ "Metadata API Developer Guide - HTML (New Window)")