curl --request POST \
--url https://api.example.com/dimensions/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "all",
"labels": [
{
"name": "environment",
"columnsMerged": [
{
"name": "env",
"type": "label"
},
{
"name": "Environment",
"type": "label"
}
],
"maps": [
{
"value": "prd",
"to": "production"
}
]
}
]
}
'import requests
url = "https://api.example.com/dimensions/publish"
payload = {
"scope": "all",
"labels": [
{
"name": "environment",
"columnsMerged": [
{
"name": "env",
"type": "label"
},
{
"name": "Environment",
"type": "label"
}
],
"maps": [
{
"value": "prd",
"to": "production"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'all',
labels: [
{
name: 'environment',
columnsMerged: [{name: 'env', type: 'label'}, {name: 'Environment', type: 'label'}],
maps: [{value: 'prd', to: 'production'}]
}
]
})
};
fetch('https://api.example.com/dimensions/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/dimensions/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'scope' => 'all',
'labels' => [
[
'name' => 'environment',
'columnsMerged' => [
[
'name' => 'env',
'type' => 'label'
],
[
'name' => 'Environment',
'type' => 'label'
]
],
'maps' => [
[
'value' => 'prd',
'to' => 'production'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/dimensions/publish"
payload := strings.NewReader("{\n \"scope\": \"all\",\n \"labels\": [\n {\n \"name\": \"environment\",\n \"columnsMerged\": [\n {\n \"name\": \"env\",\n \"type\": \"label\"\n },\n {\n \"name\": \"Environment\",\n \"type\": \"label\"\n }\n ],\n \"maps\": [\n {\n \"value\": \"prd\",\n \"to\": \"production\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/dimensions/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"all\",\n \"labels\": [\n {\n \"name\": \"environment\",\n \"columnsMerged\": [\n {\n \"name\": \"env\",\n \"type\": \"label\"\n },\n {\n \"name\": \"Environment\",\n \"type\": \"label\"\n }\n ],\n \"maps\": [\n {\n \"value\": \"prd\",\n \"to\": \"production\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/dimensions/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"all\",\n \"labels\": [\n {\n \"name\": \"environment\",\n \"columnsMerged\": [\n {\n \"name\": \"env\",\n \"type\": \"label\"\n },\n {\n \"name\": \"Environment\",\n \"type\": \"label\"\n }\n ],\n \"maps\": [\n {\n \"value\": \"prd\",\n \"to\": \"production\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"publishedLabels": true,
"publishedVdimIds": [
"<string>"
],
"unpublished": [
{
"kind": "label",
"errors": [
{
"kind": "label",
"message": "<string>"
}
]
}
]
}{
"ok": false,
"errors": [
{
"kind": "label",
"message": "<string>"
}
]
}{
"error": "<string>"
}Publish pending dimension changes
Promotes pending dimension changes: the label configuration supplied inline in labels, and every pending virtual-dimension draft in the organization. scope narrows the publish to labels or virtual dimensions only.
Each draft is validated on its own and the valid set is promoted atomically. A 200 therefore does not mean everything was published: unpublished[] lists the drafts that failed validation, with per-draft error messages, while publishedLabels and publishedVdimIds report what did go live. A 400 means the request as a whole was rejected and nothing was promoted.
A successful publish enqueues an asynchronous BigQuery refresh (a full feature-engineering refresh when labels changed, a lighter update otherwise), so newly published dimensions are not immediately queryable.
curl --request POST \
--url https://api.example.com/dimensions/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "all",
"labels": [
{
"name": "environment",
"columnsMerged": [
{
"name": "env",
"type": "label"
},
{
"name": "Environment",
"type": "label"
}
],
"maps": [
{
"value": "prd",
"to": "production"
}
]
}
]
}
'import requests
url = "https://api.example.com/dimensions/publish"
payload = {
"scope": "all",
"labels": [
{
"name": "environment",
"columnsMerged": [
{
"name": "env",
"type": "label"
},
{
"name": "Environment",
"type": "label"
}
],
"maps": [
{
"value": "prd",
"to": "production"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'all',
labels: [
{
name: 'environment',
columnsMerged: [{name: 'env', type: 'label'}, {name: 'Environment', type: 'label'}],
maps: [{value: 'prd', to: 'production'}]
}
]
})
};
fetch('https://api.example.com/dimensions/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/dimensions/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'scope' => 'all',
'labels' => [
[
'name' => 'environment',
'columnsMerged' => [
[
'name' => 'env',
'type' => 'label'
],
[
'name' => 'Environment',
'type' => 'label'
]
],
'maps' => [
[
'value' => 'prd',
'to' => 'production'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/dimensions/publish"
payload := strings.NewReader("{\n \"scope\": \"all\",\n \"labels\": [\n {\n \"name\": \"environment\",\n \"columnsMerged\": [\n {\n \"name\": \"env\",\n \"type\": \"label\"\n },\n {\n \"name\": \"Environment\",\n \"type\": \"label\"\n }\n ],\n \"maps\": [\n {\n \"value\": \"prd\",\n \"to\": \"production\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/dimensions/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"all\",\n \"labels\": [\n {\n \"name\": \"environment\",\n \"columnsMerged\": [\n {\n \"name\": \"env\",\n \"type\": \"label\"\n },\n {\n \"name\": \"Environment\",\n \"type\": \"label\"\n }\n ],\n \"maps\": [\n {\n \"value\": \"prd\",\n \"to\": \"production\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/dimensions/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"all\",\n \"labels\": [\n {\n \"name\": \"environment\",\n \"columnsMerged\": [\n {\n \"name\": \"env\",\n \"type\": \"label\"\n },\n {\n \"name\": \"Environment\",\n \"type\": \"label\"\n }\n ],\n \"maps\": [\n {\n \"value\": \"prd\",\n \"to\": \"production\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"publishedLabels": true,
"publishedVdimIds": [
"<string>"
],
"unpublished": [
{
"kind": "label",
"errors": [
{
"kind": "label",
"message": "<string>"
}
]
}
]
}{
"ok": false,
"errors": [
{
"kind": "label",
"message": "<string>"
}
]
}{
"error": "<string>"
}Authorizations
Send Authorization: Bearer <credential> using either a Clerk session JWT or a Clerk API key (ak_*). API keys may identify a user (user_*) or organization (org_*) principal and are generated in the Clerk Dashboard under API keys.
Body
Was this page helpful?
