Publish a variable catalog version
curl --request POST \
--url https://api.craftkit.dev/v1/embed/catalogs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "crm-fields",
"catalog": {
"allowCustom": false,
"namespaces": [
{
"key": "customer",
"label": "Customer",
"fields": [
{
"key": "name",
"label": "Name",
"dataType": "text"
}
]
}
],
"loops": []
}
}
'import requests
url = "https://api.craftkit.dev/v1/embed/catalogs"
payload = {
"name": "crm-fields",
"catalog": {
"allowCustom": False,
"namespaces": [
{
"key": "customer",
"label": "Customer",
"fields": [
{
"key": "name",
"label": "Name",
"dataType": "text"
}
]
}
],
"loops": []
}
}
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({
name: 'crm-fields',
catalog: {
allowCustom: false,
namespaces: [
{
key: 'customer',
label: 'Customer',
fields: [{key: 'name', label: 'Name', dataType: 'text'}]
}
],
loops: []
}
})
};
fetch('https://api.craftkit.dev/v1/embed/catalogs', 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.craftkit.dev/v1/embed/catalogs",
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([
'name' => 'crm-fields',
'catalog' => [
'allowCustom' => false,
'namespaces' => [
[
'key' => 'customer',
'label' => 'Customer',
'fields' => [
[
'key' => 'name',
'label' => 'Name',
'dataType' => 'text'
]
]
]
],
'loops' => [
]
]
]),
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.craftkit.dev/v1/embed/catalogs"
payload := strings.NewReader("{\n \"name\": \"crm-fields\",\n \"catalog\": {\n \"allowCustom\": false,\n \"namespaces\": [\n {\n \"key\": \"customer\",\n \"label\": \"Customer\",\n \"fields\": [\n {\n \"key\": \"name\",\n \"label\": \"Name\",\n \"dataType\": \"text\"\n }\n ]\n }\n ],\n \"loops\": []\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.craftkit.dev/v1/embed/catalogs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"crm-fields\",\n \"catalog\": {\n \"allowCustom\": false,\n \"namespaces\": [\n {\n \"key\": \"customer\",\n \"label\": \"Customer\",\n \"fields\": [\n {\n \"key\": \"name\",\n \"label\": \"Name\",\n \"dataType\": \"text\"\n }\n ]\n }\n ],\n \"loops\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craftkit.dev/v1/embed/catalogs")
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 \"name\": \"crm-fields\",\n \"catalog\": {\n \"allowCustom\": false,\n \"namespaces\": [\n {\n \"key\": \"customer\",\n \"label\": \"Customer\",\n \"fields\": [\n {\n \"key\": \"name\",\n \"label\": \"Name\",\n \"dataType\": \"text\"\n }\n ]\n }\n ],\n \"loops\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "c1a2b3c4-d5e6-f708-9a0b-1c2d3e4f5061",
"name": "crm-fields",
"version": 2
}{
"error": "<string>",
"message": "<string>",
"issues": "<unknown>",
"detail": "<string>"
}{
"error": "invalid_credentials"
}{
"error": "invalid_request",
"issues": []
}{
"error": {
"code": "invalid_request",
"message": "Request body did not match expected shape."
}
}Embed
Publish a variable catalog version
Publish a named variable catalog version using the partner secret key. Calling with the same name creates the next version and marks it current; previous versions are archived, never deleted.
POST
/
v1
/
embed
/
catalogs
Publish a variable catalog version
curl --request POST \
--url https://api.craftkit.dev/v1/embed/catalogs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "crm-fields",
"catalog": {
"allowCustom": false,
"namespaces": [
{
"key": "customer",
"label": "Customer",
"fields": [
{
"key": "name",
"label": "Name",
"dataType": "text"
}
]
}
],
"loops": []
}
}
'import requests
url = "https://api.craftkit.dev/v1/embed/catalogs"
payload = {
"name": "crm-fields",
"catalog": {
"allowCustom": False,
"namespaces": [
{
"key": "customer",
"label": "Customer",
"fields": [
{
"key": "name",
"label": "Name",
"dataType": "text"
}
]
}
],
"loops": []
}
}
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({
name: 'crm-fields',
catalog: {
allowCustom: false,
namespaces: [
{
key: 'customer',
label: 'Customer',
fields: [{key: 'name', label: 'Name', dataType: 'text'}]
}
],
loops: []
}
})
};
fetch('https://api.craftkit.dev/v1/embed/catalogs', 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.craftkit.dev/v1/embed/catalogs",
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([
'name' => 'crm-fields',
'catalog' => [
'allowCustom' => false,
'namespaces' => [
[
'key' => 'customer',
'label' => 'Customer',
'fields' => [
[
'key' => 'name',
'label' => 'Name',
'dataType' => 'text'
]
]
]
],
'loops' => [
]
]
]),
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.craftkit.dev/v1/embed/catalogs"
payload := strings.NewReader("{\n \"name\": \"crm-fields\",\n \"catalog\": {\n \"allowCustom\": false,\n \"namespaces\": [\n {\n \"key\": \"customer\",\n \"label\": \"Customer\",\n \"fields\": [\n {\n \"key\": \"name\",\n \"label\": \"Name\",\n \"dataType\": \"text\"\n }\n ]\n }\n ],\n \"loops\": []\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.craftkit.dev/v1/embed/catalogs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"crm-fields\",\n \"catalog\": {\n \"allowCustom\": false,\n \"namespaces\": [\n {\n \"key\": \"customer\",\n \"label\": \"Customer\",\n \"fields\": [\n {\n \"key\": \"name\",\n \"label\": \"Name\",\n \"dataType\": \"text\"\n }\n ]\n }\n ],\n \"loops\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craftkit.dev/v1/embed/catalogs")
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 \"name\": \"crm-fields\",\n \"catalog\": {\n \"allowCustom\": false,\n \"namespaces\": [\n {\n \"key\": \"customer\",\n \"label\": \"Customer\",\n \"fields\": [\n {\n \"key\": \"name\",\n \"label\": \"Name\",\n \"dataType\": \"text\"\n }\n ]\n }\n ],\n \"loops\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "c1a2b3c4-d5e6-f708-9a0b-1c2d3e4f5061",
"name": "crm-fields",
"version": 2
}{
"error": "<string>",
"message": "<string>",
"issues": "<unknown>",
"detail": "<string>"
}{
"error": "invalid_credentials"
}{
"error": "invalid_request",
"issues": []
}{
"error": {
"code": "invalid_request",
"message": "Request body did not match expected shape."
}
}Authorizations
Project API key (ck_live_… or ck_test_…) presented as a bearer token.
For embed partner endpoints this is the partner secret key, which is the
same credential type.
Body
application/json
⌘I