---
schema_version: "1"
id: 29c87d9aa368f74e00c251f994ccec92ba48a897e11a98132451e50969179f64
title: Deploy Metadata with REST API in Salesforce CLI
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_rest_deploy_enable_cli.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_rest_deploy_enable_cli.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5f1040bdb5adbef373030735855576e503b4c8cee6de6ec2fc0efbd5cd994b90
description: By default, the Salesforce CLI project deploy start command uses the Metadata SOAP API to deploy source to your org. You can use the Metadata REST API instead by setting a CLI configuration value or environment variable. Compared with SOAP API, REST API offers faster deployment.
---
# Deploy Metadata with REST API in Salesforce CLI

By default, the Salesforce CLI project deploy start command uses the Metadata SOAP API to deploy source to your org. You can use the Metadata REST API instead by setting a CLI configuration value or environment variable. Compared with SOAP API, REST API offers faster deployment.

  
<table class="permTable sort_table" border="0" summary="Permissions needed for the documented functionality" width="100%">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="permTableHeader  " colspan="2" id="d1061107e51">User
                Permissions Needed</th>

              <th class="permTableHeader  " colspan="2" id="d1061107e54"></th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="permRowLeft" headers="d1061107e51" data-title="User Permissions Needed">To work with Metadata API from Salesforce CLI:</td>

              <td class="permRowRight" headers="d1061107e54" data-title="">
                <p class="p">Modify Metadata Through Metadata API Functions</p>

                <p class="p">Or</p>

                <p class="p">Modify All Data</p>

              </td>

            </tr>

          </tbody>

        </table>

Use the org-metadata-rest-deploy Salesforce CLI runtime configuration variable or SF\_ORG\_METADATA\_REST\_DEPLOY environment variable to set REST API as the default. For more information, see the Salesforce DX Setup Guide.

This example uses the configuration value to set the default for your current project:

sf config set org-metadata-rest-deploy true

To set the default globally for all your projects, use the \--global flag:

sf config set org-metadata-rest-deploy true --global

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

#### Note

Only commands that deploy source, such as **project deploy start**, support REST API. Commands that retrieve source, such as **project retrieve start**, always use SOAP API.

Here are the deploy limits. Limits can change without notice.

| Feature | Limit |
| --- | --- |
| Maximum compressed .zip folder size1 (SOAP API) | Approximately 39 MB |
| Maximum uncompressed folder size2 (SOAP API) | Approximately 600 MB |
| Maximum number of files in AppExchange packages (REST and SOAP API) | 35,000 |
| Maximum number of files in packages (REST and SOAP API) | 10,000 |

1 Metadata API base-64 encodes components after they’re compressed. The resulting .zip file can't exceed 50 MB. Base-64 encoding increases the size of the payload by approximately 22%, so your compressed payload can't exceed approximately 39 MB before encoding.

2 When deploying an unzipped project, all files in the project are compressed first. The maximum size of uncompressed components in an uncompressed project is 600 MB or less, depending on the files’ compression ratio. If the files have a high compression ratio, you can migrate a total of approximately 600 MB because the compressed size would be under 39 MB. However, if the components can't be compressed much, like binary static resources, you can migrate less than 600 MB.