Newer Version Available

This content describes an older version of this product. View Latest

Use the Metadata REST API with the Salesforce CLI

You can use the Metadata REST API with all deployments, either via the deployRequest REST resource or via the Salesforce CLI. You can enable the Salesforce CLI to use Metadata REST API deployments by using a CLI runtime configuration value.

You must have the Modify Metadata Through Metadata API Functions permission or the Modify All Data permission to perform deployments. This requirement includes deployments using Metadata REST API for Deploy.

By default, the Salesforce CLI uses SOAP for deployments. Deployments using REST aren’t bound by the 39 MB .zip file size limit that applies to SOAP deployments. The limit for the number of components that are uncompressed into an unzipped folder after upload is the same for both SOAP and REST deployments.

You enable the Metadata REST API for Deploy in the Salesforce CLI by using a CLI runtime configuration value. For more about setting CLI runtime configuration values, see the Salesforce DX Developer Guide.

Set the Salesforce CLI to use the Metadata REST API for all deployments in the current project:
After Metadata REST API for Deploy is enabled for the Salesforce CLI, deployments initiated using the mdapi:deploy or source:push commands use REST.