Promote a field
curl --request POST \
--url https://api.withsplendor.com/v1/admin/fields/promote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
--data '
{
"dataset_id": "<string>",
"field_path": "<string>",
"tenant_id": "<string>"
}
'import requests
url = "https://api.withsplendor.com/v1/admin/fields/promote"
payload = {
"dataset_id": "<string>",
"field_path": "<string>",
"tenant_id": "<string>"
}
headers = {
"x-splendor-tenant-id": "<x-splendor-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-splendor-tenant-id': '<x-splendor-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({dataset_id: '<string>', field_path: '<string>', tenant_id: '<string>'})
};
fetch('https://api.withsplendor.com/v1/admin/fields/promote', 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.withsplendor.com/v1/admin/fields/promote",
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([
'dataset_id' => '<string>',
'field_path' => '<string>',
'tenant_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-splendor-tenant-id: <x-splendor-tenant-id>"
],
]);
$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.withsplendor.com/v1/admin/fields/promote"
payload := strings.NewReader("{\n \"dataset_id\": \"<string>\",\n \"field_path\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-splendor-tenant-id", "<x-splendor-tenant-id>")
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.withsplendor.com/v1/admin/fields/promote")
.header("x-splendor-tenant-id", "<x-splendor-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_id\": \"<string>\",\n \"field_path\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withsplendor.com/v1/admin/fields/promote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-splendor-tenant-id"] = '<x-splendor-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_id\": \"<string>\",\n \"field_path\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"field": {
"dataset_id": "app-logs",
"fast": true,
"field_path": "latency_ms",
"indexed": true,
"seen_count": 1240000,
"stored": true,
"tenant_id": "acme",
"type": "i64",
"variants": [
{
"dataset_id": "app-logs",
"fast": true,
"field_path": "latency_ms",
"indexed": true,
"physical_field": "latency_ms_i64",
"sample_value": "42",
"seen_count": 1240000,
"stored": true,
"tenant_id": "acme",
"value_type": "i64"
}
]
},
"index_id": "acme__app-logs",
"index_response": {},
"promotion_id": "prom_1",
"reindex_required": true,
"status": "reindex_required",
"target_generation_id": 5
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Fields
Promote a field
Promotes a field to a fast, indexed field so it can be used efficiently in filters and aggregations. Requires an admin role.
POST
/
v1
/
admin
/
fields
/
promote
Promote a field
curl --request POST \
--url https://api.withsplendor.com/v1/admin/fields/promote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
--data '
{
"dataset_id": "<string>",
"field_path": "<string>",
"tenant_id": "<string>"
}
'import requests
url = "https://api.withsplendor.com/v1/admin/fields/promote"
payload = {
"dataset_id": "<string>",
"field_path": "<string>",
"tenant_id": "<string>"
}
headers = {
"x-splendor-tenant-id": "<x-splendor-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-splendor-tenant-id': '<x-splendor-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({dataset_id: '<string>', field_path: '<string>', tenant_id: '<string>'})
};
fetch('https://api.withsplendor.com/v1/admin/fields/promote', 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.withsplendor.com/v1/admin/fields/promote",
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([
'dataset_id' => '<string>',
'field_path' => '<string>',
'tenant_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-splendor-tenant-id: <x-splendor-tenant-id>"
],
]);
$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.withsplendor.com/v1/admin/fields/promote"
payload := strings.NewReader("{\n \"dataset_id\": \"<string>\",\n \"field_path\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-splendor-tenant-id", "<x-splendor-tenant-id>")
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.withsplendor.com/v1/admin/fields/promote")
.header("x-splendor-tenant-id", "<x-splendor-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_id\": \"<string>\",\n \"field_path\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withsplendor.com/v1/admin/fields/promote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-splendor-tenant-id"] = '<x-splendor-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_id\": \"<string>\",\n \"field_path\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"field": {
"dataset_id": "app-logs",
"fast": true,
"field_path": "latency_ms",
"indexed": true,
"seen_count": 1240000,
"stored": true,
"tenant_id": "acme",
"type": "i64",
"variants": [
{
"dataset_id": "app-logs",
"fast": true,
"field_path": "latency_ms",
"indexed": true,
"physical_field": "latency_ms_i64",
"sample_value": "42",
"seen_count": 1240000,
"stored": true,
"tenant_id": "acme",
"value_type": "i64"
}
]
},
"index_id": "acme__app-logs",
"index_response": {},
"promotion_id": "prom_1",
"reindex_required": true,
"status": "reindex_required",
"target_generation_id": 5
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
API token issued from the Splendor console.
Headers
Selects the tenant (workspace) the request acts within.
Body
application/json
⌘I