curl --request POST \
--url https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_name": "<string>",
"description": "<string>",
"scope": "organization",
"category": "<string>",
"tags": [
"<string>"
],
"is_public": false
}
'import requests
url = "https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}"
payload = {
"template_name": "<string>",
"description": "<string>",
"scope": "organization",
"category": "<string>",
"tags": ["<string>"],
"is_public": False
}
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({
template_name: '<string>',
description: '<string>',
scope: 'organization',
category: '<string>',
tags: ['<string>'],
is_public: false
})
};
fetch('https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}', 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.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}",
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([
'template_name' => '<string>',
'description' => '<string>',
'scope' => 'organization',
'category' => '<string>',
'tags' => [
'<string>'
],
'is_public' => false
]),
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.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}"
payload := strings.NewReader("{\n \"template_name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"organization\",\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false\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.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"organization\",\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}")
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 \"template_name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"organization\",\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false\n}"
response = http.request(request)
puts response.read_body{
"template_id": "<string>",
"template_name": "<string>",
"source_resource_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}Create Cluster Template
Create template from existing cluster.
curl --request POST \
--url https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_name": "<string>",
"description": "<string>",
"scope": "organization",
"category": "<string>",
"tags": [
"<string>"
],
"is_public": false
}
'import requests
url = "https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}"
payload = {
"template_name": "<string>",
"description": "<string>",
"scope": "organization",
"category": "<string>",
"tags": ["<string>"],
"is_public": False
}
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({
template_name: '<string>',
description: '<string>',
scope: 'organization',
category: '<string>',
tags: ['<string>'],
is_public: false
})
};
fetch('https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}', 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.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}",
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([
'template_name' => '<string>',
'description' => '<string>',
'scope' => 'organization',
'category' => '<string>',
'tags' => [
'<string>'
],
'is_public' => false
]),
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.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}"
payload := strings.NewReader("{\n \"template_name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"organization\",\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false\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.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"organization\",\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/templates/clusters/from-cluster/{cluster_id}")
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 \"template_name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"organization\",\n \"category\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false\n}"
response = http.request(request)
puts response.read_body{
"template_id": "<string>",
"template_name": "<string>",
"source_resource_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Cluster ID
Body
Request to create a template from an existing resource.
Name for the new template
1 - 100Description of the template's purpose (OPTIONAL)
1000Template scope: 'organization' (all users in org), 'user' (only you), or 'system' (all organizations - requires Mixpeek admin email)
system, organization, user, public Optional category for organizing templates
50Optional tags for the template
Whether this template should be publicly discoverable
Response
Successful Response
Response after creating a template from a resource.
ID of the created template
Name of the created template
Type of template created
namespace, retriever, cluster, collection, bucket, taxonomy, scaffold Template scope
system, organization, user, public ID of the resource used to create this template
Timestamp when template was created
Was this page helpful?

