> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://help.sigmacomputing.com/docs/programmatically-deploy-content-from-parent-organization-to-tenants/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server. # Programmatically deploy content from a parent organization to tenants > Use the Sigma REST API to deploy documents and folders from a parent organization to one or more tenant organizations. > **Note** > > This is a premium feature. To enable it for your Sigma organization, contact your Sigma Account Executive. You can use the Sigma REST API to deploy content from a parent organization to one or more tenant organizations. This document outlines the required endpoints and follows one example end-to-end. For the equivalent steps in the Sigma UI, and for details about what content gets deployed and other considerations, see [Deploy content from a parent organization to one or more tenants](/docs/deploy-content-from-parent-organization-to-tenant-organizations). An admin in the parent organization can programmatically perform the following steps. For steps that need to be performed in a tenant organization, the admin can [impersonate each tenant for API calls](/docs/impersonate-users#impersonate-users-for-api-calls). ## Example scenario The following steps deploy a `Quarterly sales dashboard` workbook from a parent organization to two tenant organizations, `Acme West` and `Acme East`. Each tenant has its own Snowflake connection that the workbook's parent connection must be swapped to on deployment. ## Steps #### Retrieve connection information For the parent organization and each target tenant, retrieve the connection ID and name information. Use [List connections](/reference/list-connections) (`GET /v2/connections`). ### Request GET [https://api.sigmacomputing.com/v2/connections](https://api.sigmacomputing.com/v2/connections) **`Organization`** ```curl Organization curl https://api.sigmacomputing.com/v2/connections \ -H "Authorization: Bearer " ``` **`Organization`** ```python Organization import requests url = "https://api.sigmacomputing.com/v2/connections" headers = {"Authorization": "."} response = requests.get(url, headers=headers) print(response.json()) ``` **`Organization`** ```javascript Organization const url = 'https://api.sigmacomputing.com/v2/connections'; const options = {method: 'GET', headers: {Authorization: '.'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Organization`** ```go Organization package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/connections" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", ".") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` **`Organization`** ```ruby Organization require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/connections") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '.' response = http.request(request) puts response.read_body ``` **`Organization`** ```java Organization import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.sigmacomputing.com/v2/connections") .header("Authorization", ".") .asString(); ``` **`Organization`** ```php Organization request('GET', 'https://api.sigmacomputing.com/v2/connections', [ 'headers' => [ 'Authorization' => '.', ], ]); echo $response->getBody(); ``` **`Organization`** ```csharp Organization using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/connections"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "."); IRestResponse response = client.Execute(request); ``` **`Organization`** ```swift Organization import Foundation let headers = ["Authorization": "."] let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/connections")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers 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() ``` In this example, the parent organization's connection list includes `Snowflake Example`: ### Response (200) ```json { "entries": [ { "organizationId": "2f6b8e4a-9c1d-4b7a-8e2c-6d3f9a1b5c7e", "connectionId": "9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0", "isSample": false, "isAuditLog": false, "lastActiveAt": "2026-08-20T16:42:00.000Z", "name": "Snowflake Example", "type": "snowflake", "useOauth": false, "createdBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h", "updatedBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h", "createdAt": "2024-02-11T18:05:00.000Z", "updatedAt": "2026-08-20T16:42:00.000Z", "isArchived": false, "friendlyName": true, "isIndependentOAuth": false } ], "nextPage": null, "total": 1, "hasMore": false } ``` [Impersonate](/docs/impersonate-users#impersonate-users-for-api-calls) each tenant and call the endpoint again to retrieve that tenant's connection. In this example, the `Acme West` tenant's connection list includes `Snowflake - Tenant Example`: ### Response (200) ```json { "entries": [ { "organizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b", "connectionId": "3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e", "isSample": false, "isAuditLog": false, "lastActiveAt": "2026-08-19T09:12:00.000Z", "name": "Snowflake - Tenant Example", "type": "snowflake", "useOauth": false, "createdBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h", "updatedBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h", "createdAt": "2025-06-03T14:20:00.000Z", "updatedAt": "2026-08-19T09:12:00.000Z", "isArchived": false, "friendlyName": true, "isIndependentOAuth": false } ], "nextPage": null, "total": 1, "hasMore": false } ``` #### Create a user attribute In the parent organization, [create a user attribute](/reference/create-user-attribute) (`POST /v2/user-attributes`) to hold the tenant connection to swap to. ### Request POST [https://api.sigmacomputing.com/v2/user-attributes](https://api.sigmacomputing.com/v2/user-attributes) **`Tenant deployment swap example`** ```curl Tenant deployment swap example curl -X POST https://api.sigmacomputing.com/v2/user-attributes \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "tenant_snowflake_connection", "description": "Connection ID of the Snowflake connection to swap to when deploying to a tenant." }' ``` **`Tenant deployment swap example`** ```python Tenant deployment swap example import requests url = "https://api.sigmacomputing.com/v2/user-attributes" payload = { "name": "tenant_snowflake_connection", "description": "Connection ID of the Snowflake connection to swap to when deploying to a tenant." } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Tenant deployment swap example`** ```javascript Tenant deployment swap example const url = 'https://api.sigmacomputing.com/v2/user-attributes'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"name":"tenant_snowflake_connection","description":"Connection ID of the Snowflake connection to swap to when deploying to a tenant."}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Tenant deployment swap example`** ```go Tenant deployment swap example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/user-attributes" payload := strings.NewReader("{\n \"name\": \"tenant_snowflake_connection\",\n \"description\": \"Connection ID of the Snowflake connection to swap to when deploying to a tenant.\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Tenant deployment swap example`** ```ruby Tenant deployment swap example require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/user-attributes") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"tenant_snowflake_connection\",\n \"description\": \"Connection ID of the Snowflake connection to swap to when deploying to a tenant.\"\n}" response = http.request(request) puts response.read_body ``` **`Tenant deployment swap example`** ```java Tenant deployment swap example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/user-attributes") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"name\": \"tenant_snowflake_connection\",\n \"description\": \"Connection ID of the Snowflake connection to swap to when deploying to a tenant.\"\n}") .asString(); ``` **`Tenant deployment swap example`** ```php Tenant deployment swap example request('POST', 'https://api.sigmacomputing.com/v2/user-attributes', [ 'body' => '{ "name": "tenant_snowflake_connection", "description": "Connection ID of the Snowflake connection to swap to when deploying to a tenant." }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Tenant deployment swap example`** ```csharp Tenant deployment swap example using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/user-attributes"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"tenant_snowflake_connection\",\n \"description\": \"Connection ID of the Snowflake connection to swap to when deploying to a tenant.\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Tenant deployment swap example`** ```swift Tenant deployment swap example import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = [ "name": "tenant_snowflake_connection", "description": "Connection ID of the Snowflake connection to swap to when deploying to a tenant." ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/user-attributes")! 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() ``` The response returns a `userAttributeId`: ### Response (200) ```json { "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c", "name": "tenant_snowflake_connection", "createdBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h", "updatedBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h", "createdAt": "2026-08-20T16:45:00.000Z", "updatedAt": "2026-08-20T16:45:00.000Z", "description": "Connection ID of the Snowflake connection to swap to when deploying to a tenant." } ``` #### Assign the user attribute to tenants Assign the user attribute to target tenants with the value of the relevant connection ID for each tenant. Use [Set a user attribute for tenants](/reference/set-user-attribute-for-tenants) (`POST /v2/user-attributes/{userAttributeId}/tenants`). ### Request POST [https://api.sigmacomputing.com/v2/user-attributes/\{userAttributeId}/tenants](https://api.sigmacomputing.com/v2/user-attributes/\{userAttributeId}/tenants) **`Tenant connection swap`** ```curl Tenant connection swap curl -X POST https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "assignments": [ { "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b", "value": { "type": "string", "val": "3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e" } }, { "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c", "value": { "type": "string", "val": "7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d" } } ] }' ``` **`Tenant connection swap`** ```python Tenant connection swap import requests url = "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants" payload = { "assignments": [ { "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b", "value": { "type": "string", "val": "3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e" } }, { "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c", "value": { "type": "string", "val": "7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d" } } ] } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Tenant connection swap`** ```javascript Tenant connection swap const url = 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"assignments":[{"tenantOrganizationId":"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b","value":{"type":"string","val":"3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e"}},{"tenantOrganizationId":"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c","value":{"type":"string","val":"7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d"}}]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Tenant connection swap`** ```go Tenant connection swap package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants" payload := strings.NewReader("{\n \"assignments\": [\n {\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e\"\n }\n },\n {\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d\"\n }\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Tenant connection swap`** ```ruby Tenant connection swap require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"assignments\": [\n {\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e\"\n }\n },\n {\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d\"\n }\n }\n ]\n}" response = http.request(request) puts response.read_body ``` **`Tenant connection swap`** ```java Tenant connection swap import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"assignments\": [\n {\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e\"\n }\n },\n {\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d\"\n }\n }\n ]\n}") .asString(); ``` **`Tenant connection swap`** ```php Tenant connection swap request('POST', 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants', [ 'body' => '{ "assignments": [ { "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b", "value": { "type": "string", "val": "3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e" } }, { "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c", "value": { "type": "string", "val": "7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d" } } ] }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Tenant connection swap`** ```csharp Tenant connection swap using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"assignments\": [\n {\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e\"\n }\n },\n {\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\",\n \"value\": {\n \"type\": \"string\",\n \"val\": \"7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d\"\n }\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Tenant connection swap`** ```swift Tenant connection swap import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = ["assignments": [ [ "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b", "value": [ "type": "string", "val": "3d4e8f21-7b6c-4a9d-8e12-5f6a7b8c9d0e" ] ], [ "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c", "value": [ "type": "string", "val": "7c1b9e4a-2f5d-4b8e-9a3c-1e2f3a4b5c6d" ] ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId/tenants")! 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() ``` #### Create a source swap policy [Create a source swap policy](/reference/create-source-swap-policy) with a type of `deployment`. Provide the user attribute as the `toConnection` parameter. ### Request POST [https://api.sigmacomputing.com/v2/sourceSwapPolicies](https://api.sigmacomputing.com/v2/sourceSwapPolicies) **`Swap tenant connections`** ```curl Swap tenant connections curl -X POST https://api.sigmacomputing.com/v2/sourceSwapPolicies \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "fromConnectionId": "9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0", "name": "Tenant Snowflake Swap", "swaps": { "deploymentSwaps": [], "toConnection": { "swapType": "attribute", "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c" } }, "type": "deployment" }' ``` **`Swap tenant connections`** ```python Swap tenant connections import requests url = "https://api.sigmacomputing.com/v2/sourceSwapPolicies" payload = { "fromConnectionId": "9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0", "name": "Tenant Snowflake Swap", "swaps": { "deploymentSwaps": [], "toConnection": { "swapType": "attribute", "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c" } }, "type": "deployment" } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Swap tenant connections`** ```javascript Swap tenant connections const url = 'https://api.sigmacomputing.com/v2/sourceSwapPolicies'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"fromConnectionId":"9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0","name":"Tenant Snowflake Swap","swaps":{"deploymentSwaps":[],"toConnection":{"swapType":"attribute","userAttributeId":"e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c"}},"type":"deployment"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Swap tenant connections`** ```go Swap tenant connections package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/sourceSwapPolicies" payload := strings.NewReader("{\n \"fromConnectionId\": \"9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0\",\n \"name\": \"Tenant Snowflake Swap\",\n \"swaps\": {\n \"deploymentSwaps\": [],\n \"toConnection\": {\n \"swapType\": \"attribute\",\n \"userAttributeId\": \"e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c\"\n }\n },\n \"type\": \"deployment\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Swap tenant connections`** ```ruby Swap tenant connections require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/sourceSwapPolicies") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"fromConnectionId\": \"9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0\",\n \"name\": \"Tenant Snowflake Swap\",\n \"swaps\": {\n \"deploymentSwaps\": [],\n \"toConnection\": {\n \"swapType\": \"attribute\",\n \"userAttributeId\": \"e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c\"\n }\n },\n \"type\": \"deployment\"\n}" response = http.request(request) puts response.read_body ``` **`Swap tenant connections`** ```java Swap tenant connections import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/sourceSwapPolicies") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"fromConnectionId\": \"9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0\",\n \"name\": \"Tenant Snowflake Swap\",\n \"swaps\": {\n \"deploymentSwaps\": [],\n \"toConnection\": {\n \"swapType\": \"attribute\",\n \"userAttributeId\": \"e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c\"\n }\n },\n \"type\": \"deployment\"\n}") .asString(); ``` **`Swap tenant connections`** ```php Swap tenant connections request('POST', 'https://api.sigmacomputing.com/v2/sourceSwapPolicies', [ 'body' => '{ "fromConnectionId": "9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0", "name": "Tenant Snowflake Swap", "swaps": { "deploymentSwaps": [], "toConnection": { "swapType": "attribute", "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c" } }, "type": "deployment" }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Swap tenant connections`** ```csharp Swap tenant connections using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/sourceSwapPolicies"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"fromConnectionId\": \"9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0\",\n \"name\": \"Tenant Snowflake Swap\",\n \"swaps\": {\n \"deploymentSwaps\": [],\n \"toConnection\": {\n \"swapType\": \"attribute\",\n \"userAttributeId\": \"e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c\"\n }\n },\n \"type\": \"deployment\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Swap tenant connections`** ```swift Swap tenant connections import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = [ "fromConnectionId": "9f2a6b1e-4c3d-4a8f-9e21-6d7c8b3a51f0", "name": "Tenant Snowflake Swap", "swaps": [ "deploymentSwaps": [], "toConnection": [ "swapType": "attribute", "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c" ] ], "type": "deployment" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/sourceSwapPolicies")! 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() ``` The response returns a `policyId`: ### Response (200) ```json { "policyId": "2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d" } ``` #### Create a deployment policy In the parent organization, [create a deployment policy](/reference/create-deployment) (`POST /v2/deploymentPolicies`). For the `sourceSwapPolicies` parameter in the request body, provide one or more source swap policies. ### Request POST [https://api.sigmacomputing.com/v2/deploymentPolicies](https://api.sigmacomputing.com/v2/deploymentPolicies) **`Deploy quarterly sales dashboard`** ```curl Deploy quarterly sales dashboard curl -X POST https://api.sigmacomputing.com/v2/deploymentPolicies \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Quarterly Sales Starter Pack", "sourceSwapPolicies": [ "2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d" ] }' ``` **`Deploy quarterly sales dashboard`** ```python Deploy quarterly sales dashboard import requests url = "https://api.sigmacomputing.com/v2/deploymentPolicies" payload = { "name": "Quarterly Sales Starter Pack", "sourceSwapPolicies": ["2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d"] } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Deploy quarterly sales dashboard`** ```javascript Deploy quarterly sales dashboard const url = 'https://api.sigmacomputing.com/v2/deploymentPolicies'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"name":"Quarterly Sales Starter Pack","sourceSwapPolicies":["2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Deploy quarterly sales dashboard`** ```go Deploy quarterly sales dashboard package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/deploymentPolicies" payload := strings.NewReader("{\n \"name\": \"Quarterly Sales Starter Pack\",\n \"sourceSwapPolicies\": [\n \"2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d\"\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Deploy quarterly sales dashboard`** ```ruby Deploy quarterly sales dashboard require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/deploymentPolicies") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"Quarterly Sales Starter Pack\",\n \"sourceSwapPolicies\": [\n \"2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d\"\n ]\n}" response = http.request(request) puts response.read_body ``` **`Deploy quarterly sales dashboard`** ```java Deploy quarterly sales dashboard import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/deploymentPolicies") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"name\": \"Quarterly Sales Starter Pack\",\n \"sourceSwapPolicies\": [\n \"2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d\"\n ]\n}") .asString(); ``` **`Deploy quarterly sales dashboard`** ```php Deploy quarterly sales dashboard request('POST', 'https://api.sigmacomputing.com/v2/deploymentPolicies', [ 'body' => '{ "name": "Quarterly Sales Starter Pack", "sourceSwapPolicies": [ "2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d" ] }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Deploy quarterly sales dashboard`** ```csharp Deploy quarterly sales dashboard using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/deploymentPolicies"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"Quarterly Sales Starter Pack\",\n \"sourceSwapPolicies\": [\n \"2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Deploy quarterly sales dashboard`** ```swift Deploy quarterly sales dashboard import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = [ "name": "Quarterly Sales Starter Pack", "sourceSwapPolicies": ["2a6f8b3d-5c1e-4a9b-8d3f-7e2c4b6a9f1d"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/deploymentPolicies")! 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() ``` The response returns a `deploymentPolicyId`: ### Response (200) ```json { "deploymentPolicyId": "b8e3a7c1-4f2d-4b9e-9a6c-3d5f1e8b2a4c" } ``` #### Add documents and folders to the deployment policy [Add documents and folders to the deployment policy](/reference/add-inodes-to-deployment) (`POST /v2/deploymentPolicies/{deploymentPolicyId}/files`). To identify which documents to add, call the relevant endpoint and use the relevant IDs in the `inodeIds` option: * [List workbooks](/reference/list-workbooks) and use the `workbookId` in the response. * [List reports](/reference/list-reports) and use the `reportId` in the response. * [List data models](/reference/list-data-models) and use the `dataModelId` in the response. * Retrieve folder IDs with the [List files](/reference/list-files) (`GET /v2/files`) endpoint and use the relevant `inodeId` in the response. You can provide up to 100 IDs per request. In this example, the `Quarterly sales dashboard` workbook has a `workbookId` of `6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d`: ### Request POST [https://api.sigmacomputing.com/v2/deploymentPolicies/\{deploymentPolicyId}/files](https://api.sigmacomputing.com/v2/deploymentPolicies/\{deploymentPolicyId}/files) **`Deploy quarterly sales dashboard`** ```curl Deploy quarterly sales dashboard curl -X POST https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "inodeIds": [ "6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d" ] }' ``` **`Deploy quarterly sales dashboard`** ```python Deploy quarterly sales dashboard import requests url = "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files" payload = { "inodeIds": ["6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d"] } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Deploy quarterly sales dashboard`** ```javascript Deploy quarterly sales dashboard const url = 'https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"inodeIds":["6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Deploy quarterly sales dashboard`** ```go Deploy quarterly sales dashboard package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files" payload := strings.NewReader("{\n \"inodeIds\": [\n \"6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d\"\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Deploy quarterly sales dashboard`** ```ruby Deploy quarterly sales dashboard require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"inodeIds\": [\n \"6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d\"\n ]\n}" response = http.request(request) puts response.read_body ``` **`Deploy quarterly sales dashboard`** ```java Deploy quarterly sales dashboard import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"inodeIds\": [\n \"6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d\"\n ]\n}") .asString(); ``` **`Deploy quarterly sales dashboard`** ```php Deploy quarterly sales dashboard request('POST', 'https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files', [ 'body' => '{ "inodeIds": [ "6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d" ] }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Deploy quarterly sales dashboard`** ```csharp Deploy quarterly sales dashboard using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"inodeIds\": [\n \"6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Deploy quarterly sales dashboard`** ```swift Deploy quarterly sales dashboard import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = ["inodeIds": ["6a1d8f3b-2e5c-4b7a-9d1e-4c8b6a3f7e2d"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/files")! 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() ``` #### Add tenants to the deployment policy [Add each tenant to the deployment policy](/reference/add-tenant-to-deployment) (`POST /v2/deploymentPolicies/{deploymentPolicyId}/tenants`). Call the endpoint once per tenant: ### Request POST [https://api.sigmacomputing.com/v2/deploymentPolicies/\{deploymentPolicyId}/tenants](https://api.sigmacomputing.com/v2/deploymentPolicies/\{deploymentPolicyId}/tenants) **`Add Acme West`** ```curl Add Acme West curl -X POST https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b" }' ``` **`Add Acme West`** ```python Add Acme West import requests url = "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants" payload = { "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b" } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Add Acme West`** ```javascript Add Acme West const url = 'https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"tenantOrganizationId":"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Add Acme West`** ```go Add Acme West package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants" payload := strings.NewReader("{\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Add Acme West`** ```ruby Add Acme West require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\"\n}" response = http.request(request) puts response.read_body ``` **`Add Acme West`** ```java Add Acme West import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\"\n}") .asString(); ``` **`Add Acme West`** ```php Add Acme West request('POST', 'https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants', [ 'body' => '{ "tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b" }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Add Acme West`** ```csharp Add Acme West using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"tenantOrganizationId\": \"5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Add Acme West`** ```swift Add Acme West import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = ["tenantOrganizationId": "5e9c2b7a-3f1d-4a8e-9b6c-2d4f8a1e6c3b"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants")! 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() ``` ### Request POST [https://api.sigmacomputing.com/v2/deploymentPolicies/\{deploymentPolicyId}/tenants](https://api.sigmacomputing.com/v2/deploymentPolicies/\{deploymentPolicyId}/tenants) **`Add Acme East`** ```curl Add Acme East curl -X POST https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c" }' ``` **`Add Acme East`** ```python Add Acme East import requests url = "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants" payload = { "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c" } headers = { "Authorization": ".", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` **`Add Acme East`** ```javascript Add Acme East const url = 'https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants'; const options = { method: 'POST', headers: {Authorization: '.', 'Content-Type': 'application/json'}, body: '{"tenantOrganizationId":"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` **`Add Acme East`** ```go Add Acme East package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants" payload := strings.NewReader("{\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", ".") 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)) } ``` **`Add Acme East`** ```ruby Add Acme East require 'uri' require 'net/http' url = URI("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '.' request["Content-Type"] = 'application/json' request.body = "{\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\"\n}" response = http.request(request) puts response.read_body ``` **`Add Acme East`** ```java Add Acme East import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants") .header("Authorization", ".") .header("Content-Type", "application/json") .body("{\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\"\n}") .asString(); ``` **`Add Acme East`** ```php Add Acme East request('POST', 'https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants', [ 'body' => '{ "tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c" }', 'headers' => [ 'Authorization' => '.', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` **`Add Acme East`** ```csharp Add Acme East using RestSharp; var client = new RestClient("https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "."); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"tenantOrganizationId\": \"1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` **`Add Acme East`** ```swift Add Acme East import Foundation let headers = [ "Authorization": ".", "Content-Type": "application/json" ] let parameters = ["tenantOrganizationId": "1f4a8c3e-6d2b-4e9a-8c1f-5b7d3a2e9f6c"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/deploymentPolicies/deploymentPolicyId/tenants")! 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() ``` After both calls succeed, `Quarterly sales dashboard` is deployed to both `Acme West` and `Acme East`, with each tenant's connection swapped in for the parent connection. You cannot retrieve the status of a deployment through the REST API. To review the status, use the Sigma UI. See [Review deployment status and errors](/docs/manage-deployed-content#review-deployment-status-and-errors). ## Related resources * [Deploy content from a parent organization to one or more tenants](/docs/deploy-content-from-parent-organization-to-tenant-organizations) * [Deploy content to tenant organizations](/docs/deploy-content-to-tenant-organizations) * [Manage content deployed in tenant organizations](/docs/manage-deployed-content) > Official documentation and guidance for using Sigma to build AI apps, dashboards, and agents on governed warehouse data.