> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Create a Deployment

POST https://api.bigcommerce.com/stores/{store_hash}/v3/infrastructure/deployments
Content-Type: application/json

Creates a new deployment for an infrastructure hosting project. You must first generate an upload signature and upload your deployment artifact before creating a deployment.

Only one deployment can be in progress per project at a time. If a deployment is already in progress, the API returns a `409 Conflict` response.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/management/infrastructure-hosting/deployments/create-deployment

## Authentication

- `X-Auth-Token` header (required) — ### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Infrastructure Deployments | read-only | `store_infrastructure_deployments_read_only` | | Infrastructure Deployments | create preview | `store_infrastructure_deployments_create_preview` | | Infrastructure Deployments | manage | `store_infrastructure_deployments_manage` | | Infrastructure Projects | read-only | `store_infrastructure_projects_read_only` | | Infrastructure Projects | manage | `store_infrastructure_projects_manage` | | Infrastructure Logs | read-only | `store_infrastructure_logs_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

## Request

### Path parameters

- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

### Body (application/json)

This endpoint expects a CreateDeploymentRequest.

- `upload_uuid` (string, required) — The UUID of the uploaded deployment artifact, obtained from the Generate Upload Signature endpoint.
- `project_uuid` (string, required) — The UUID of the project to deploy to.
- `environment_variables` (list of EnvironmentVariable, optional, nullable) — Optional environment variables to set for this deployment.

## Response

### 201

The deployment was created successfully.

- `data` (CreateDeploymentResponse, optional)
- `meta` (EmptyMeta, optional) — Empty meta object.

## Errors

### 409 Conflict Error

A deployment is already in progress for this project.

- `status` (integer, optional) — The HTTP status code.
- `title` (string, optional) — A description of the error.
- `type` (string, optional) — A URL identifying the error type.
- `errors` (ErrorResponseErrors, optional) — Additional error details.
- `meta` (map from string to any, optional) — Additional structured context for the error, such as the ownership-verification TXT record to publish, the conflicting `project_uuid`, or the domain `limit` and `current` count.

## Types

### EnvironmentVariable

- `type` (enum, required) — The type of environment variable. - `plain_text`: A regular environment variable visible in responses. - `secret`: A sensitive environment variable that is encrypted and not returned in responses.
  - Allowed values: `plain_text`, `secret`
- `key` (string, required) — The name of the environment variable.
- `value` (string, required) — The value of the environment variable.

### CreateDeploymentResponse

- `deployment_uuid` (string, optional) — The unique identifier of the newly created deployment.

### EmptyMeta

Empty meta object.

### ErrorResponseErrors

Additional error details.

## Examples

**Request**

```json
{
  "upload_uuid": "0194fd2b-2ac6-72de-b73f-d83f2d626a74",
  "project_uuid": "01956ca2-72dd-7968-9484-469ce291d38f",
  "environment_variables": [
    {
      "type": "plain_text",
      "key": "API_URL",
      "value": "https://api.example.com"
    },
    {
      "type": "secret",
      "key": "API_SECRET",
      "value": "s3cret"
    }
  ]
}
```

**Response**

```json
{
  "data": {
    "deployment_uuid": "019500e2-933d-7057-8e81-090dd7240795"
  },
  "meta": {}
}
```

**SDK Code**

```python Create a deployment
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments"

payload = {
    "upload_uuid": "0194fd2b-2ac6-72de-b73f-d83f2d626a74",
    "project_uuid": "01956ca2-72dd-7968-9484-469ce291d38f",
    "environment_variables": [
        {
            "type": "plain_text",
            "key": "API_URL",
            "value": "https://api.example.com"
        },
        {
            "type": "secret",
            "key": "API_SECRET",
            "value": "s3cret"
        }
    ]
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a deployment
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments';
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"upload_uuid":"0194fd2b-2ac6-72de-b73f-d83f2d626a74","project_uuid":"01956ca2-72dd-7968-9484-469ce291d38f","environment_variables":[{"type":"plain_text","key":"API_URL","value":"https://api.example.com"},{"type":"secret","key":"API_SECRET","value":"s3cret"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a deployment
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments"

	payload := strings.NewReader("{\n  \"upload_uuid\": \"0194fd2b-2ac6-72de-b73f-d83f2d626a74\",\n  \"project_uuid\": \"01956ca2-72dd-7968-9484-469ce291d38f\",\n  \"environment_variables\": [\n    {\n      \"type\": \"plain_text\",\n      \"key\": \"API_URL\",\n      \"value\": \"https://api.example.com\"\n    },\n    {\n      \"type\": \"secret\",\n      \"key\": \"API_SECRET\",\n      \"value\": \"s3cret\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a deployment
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"upload_uuid\": \"0194fd2b-2ac6-72de-b73f-d83f2d626a74\",\n  \"project_uuid\": \"01956ca2-72dd-7968-9484-469ce291d38f\",\n  \"environment_variables\": [\n    {\n      \"type\": \"plain_text\",\n      \"key\": \"API_URL\",\n      \"value\": \"https://api.example.com\"\n    },\n    {\n      \"type\": \"secret\",\n      \"key\": \"API_SECRET\",\n      \"value\": \"s3cret\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Create a deployment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"upload_uuid\": \"0194fd2b-2ac6-72de-b73f-d83f2d626a74\",\n  \"project_uuid\": \"01956ca2-72dd-7968-9484-469ce291d38f\",\n  \"environment_variables\": [\n    {\n      \"type\": \"plain_text\",\n      \"key\": \"API_URL\",\n      \"value\": \"https://api.example.com\"\n    },\n    {\n      \"type\": \"secret\",\n      \"key\": \"API_SECRET\",\n      \"value\": \"s3cret\"\n    }\n  ]\n}")
  .asString();
```

```php Create a deployment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments', [
  'body' => '{
  "upload_uuid": "0194fd2b-2ac6-72de-b73f-d83f2d626a74",
  "project_uuid": "01956ca2-72dd-7968-9484-469ce291d38f",
  "environment_variables": [
    {
      "type": "plain_text",
      "key": "API_URL",
      "value": "https://api.example.com"
    },
    {
      "type": "secret",
      "key": "API_SECRET",
      "value": "s3cret"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Create a deployment
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"upload_uuid\": \"0194fd2b-2ac6-72de-b73f-d83f2d626a74\",\n  \"project_uuid\": \"01956ca2-72dd-7968-9484-469ce291d38f\",\n  \"environment_variables\": [\n    {\n      \"type\": \"plain_text\",\n      \"key\": \"API_URL\",\n      \"value\": \"https://api.example.com\"\n    },\n    {\n      \"type\": \"secret\",\n      \"key\": \"API_SECRET\",\n      \"value\": \"s3cret\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a deployment
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "upload_uuid": "0194fd2b-2ac6-72de-b73f-d83f2d626a74",
  "project_uuid": "01956ca2-72dd-7968-9484-469ce291d38f",
  "environment_variables": [
    [
      "type": "plain_text",
      "key": "API_URL",
      "value": "https://api.example.com"
    ],
    [
      "type": "secret",
      "key": "API_SECRET",
      "value": "s3cret"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/infrastructure/deployments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```