---
title: Create a Branch Deployment
description: Once you have set your Pipelines (via the Storyblok App or the Management API), you can start to trigger the deployment. The deployment could be triggered via Storyblok UI in the Content section by selecting the pipeline in the Pipelines dropdown.
url: https://storyblok.com/docs/api/management/branch-deployments/create-a-branch-deployment
---

# Create a Branch Deployment

POST

```html
https://mapi.storyblok.com/v1/spaces/:space_id/deployments
```

## Path parameters

-   `:space_id` (required) (number)
    
    Numeric ID of a space
    

## Request body properties

-   `branch_id` (required) (number)
    
    The branch ID to deploy
    
-   `release_uuids` (string\[\])
    
    An array of release UUIDs
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/spaces/288868932106293/deployments/" \
      -X POST \
      -H "Authorization: YOUR_OAUTH_TOKEN" \
      -H "Content-Type: application/json" \
      -d "{\"branch_id\":1,\"release_uuids\":[\"1234-4567\",\"1234-4568\"]}"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",
    });
    
    try {
      const response = await storyblok.post('spaces/288868932106293/deployments/', {
        "branch_id": 1,
        "release_uuids": [
          "1234-4567",
          "1234-4568"
        ]
      })
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $payload = ["branch_id" => 1,"release_uuids" => ["1234-4567","1234-4568"]];
    
    $client->post('spaces/288868932106293/deployments/', $payload)->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.post("https://mapi.storyblok.com/v1/spaces/288868932106293/deployments/")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .body({"branch_id":1,"release_uuids":["1234-4567","1234-4568"]})
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/deployments/");
    var request = new RestRequest(Method.POST);
    
    request.AddHeader("Content-Type", "application/json");
    request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
    request.AddParameter("application/json", "{\"branch_id\":1,\"release_uuids\":[\"1234-4567\",\"1234-4568\"]}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://mapi.storyblok.com/v1/spaces/288868932106293/deployments/"
    
    querystring = {}
    
    payload = {"branch_id":1,"release_uuids":["1234-4567","1234-4568"]}
    headers = {
      'Content-Type': "application/json",
      'Authorization': "YOUR_OAUTH_TOKEN"
    }
    
    response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
    
    print(response.text)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
    
    payload = {"branch_id" => 1,"release_uuids" => ["1234-4567","1234-4568"]}
    
    client.post('spaces/288868932106293/deployments/', payload)
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))
    var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/deployments/")
    request.httpMethod = "POST"
    request.httpBody = try JSONSerialization.data(withJSONObject: [
        "branch_id": 1,
        "release_uuids": [
            "1234-4567",
            "1234-4568",
        ],
    ])
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(MAPI)) {
            accessToken = OAuth("YOUR_OAUTH_TOKEN")
        }
    }
    
    val response = client.post("spaces/288868932106293/deployments/") {
        setBody(buildJsonObject {
            put("branch_id", 1)
            putJsonArray("release_uuids") {
                add("1234-4567")
                add("1234-4568")
            }
        })
    }
    
    println(response.body<JsonElement>())
    ```

## Pagination

-   [Previous: Branch Deployments](/docs/api/management/branch-deployments)
-   [Next: Collaborators](/docs/api/management/collaborators)
