curl --request POST \
--url https://api.orbit.devotel.io/api/v1/cdp/transform-functions \
--header 'Content-Type: application/json' \
--data '
{
"name": "normalize_event_names",
"stage": "source",
"spec": {
"version": 1,
"operations": [
{
"op": "set",
"path": "event",
"value": "order_completed"
},
{
"op": "lowercase",
"path": "properties.sku"
}
]
},
"description": "Snake-case all event names before downstream delivery",
"destination_key": null,
"enabled": true
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/cdp/transform-functions"
payload = {
"name": "normalize_event_names",
"stage": "source",
"spec": {
"version": 1,
"operations": [
{
"op": "set",
"path": "event",
"value": "order_completed"
},
{
"op": "lowercase",
"path": "properties.sku"
}
]
},
"description": "Snake-case all event names before downstream delivery",
"destination_key": None,
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'normalize_event_names',
stage: 'source',
spec: {
version: 1,
operations: [
{op: 'set', path: 'event', value: 'order_completed'},
{op: 'lowercase', path: 'properties.sku'}
]
},
description: 'Snake-case all event names before downstream delivery',
destination_key: null,
enabled: true
})
};
fetch('https://api.orbit.devotel.io/api/v1/cdp/transform-functions', 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.orbit.devotel.io/api/v1/cdp/transform-functions",
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' => 'normalize_event_names',
'stage' => 'source',
'spec' => [
'version' => 1,
'operations' => [
[
'op' => 'set',
'path' => 'event',
'value' => 'order_completed'
],
[
'op' => 'lowercase',
'path' => 'properties.sku'
]
]
],
'description' => 'Snake-case all event names before downstream delivery',
'destination_key' => null,
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"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.orbit.devotel.io/api/v1/cdp/transform-functions"
payload := strings.NewReader("{\n \"name\": \"normalize_event_names\",\n \"stage\": \"source\",\n \"spec\": {\n \"version\": 1,\n \"operations\": [\n {\n \"op\": \"set\",\n \"path\": \"event\",\n \"value\": \"order_completed\"\n },\n {\n \"op\": \"lowercase\",\n \"path\": \"properties.sku\"\n }\n ]\n },\n \"description\": \"Snake-case all event names before downstream delivery\",\n \"destination_key\": null,\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.orbit.devotel.io/api/v1/cdp/transform-functions")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"normalize_event_names\",\n \"stage\": \"source\",\n \"spec\": {\n \"version\": 1,\n \"operations\": [\n {\n \"op\": \"set\",\n \"path\": \"event\",\n \"value\": \"order_completed\"\n },\n {\n \"op\": \"lowercase\",\n \"path\": \"properties.sku\"\n }\n ]\n },\n \"description\": \"Snake-case all event names before downstream delivery\",\n \"destination_key\": null,\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/cdp/transform-functions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"normalize_event_names\",\n \"stage\": \"source\",\n \"spec\": {\n \"version\": 1,\n \"operations\": [\n {\n \"op\": \"set\",\n \"path\": \"event\",\n \"value\": \"order_completed\"\n },\n {\n \"op\": \"lowercase\",\n \"path\": \"properties.sku\"\n }\n ]\n },\n \"description\": \"Snake-case all event names before downstream delivery\",\n \"destination_key\": null,\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"status": 429,
"retry_after": 2
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Create a transform function
Create an event-transform function: a transform-affecting DSL spec (an ordered list of set, default, copy, rename, remove, coalesce, lowercase, uppercase, trim, or drop_event ops over dot-paths) bound to a stage — source (every inbound event after ingest) or destination (a per-destination payload, scoped by destination_key). The spec is schema-validated and budget-audited (op count, path and value depth) before persistence, so a malformed or oversized spec is rejected with 400 rather than stored. Use validate first to check a spec without persisting. Names must be unique per tenant (409 on a clash). Requires an owner, admin, or developer role.
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/cdp/transform-functions \
--header 'Content-Type: application/json' \
--data '
{
"name": "normalize_event_names",
"stage": "source",
"spec": {
"version": 1,
"operations": [
{
"op": "set",
"path": "event",
"value": "order_completed"
},
{
"op": "lowercase",
"path": "properties.sku"
}
]
},
"description": "Snake-case all event names before downstream delivery",
"destination_key": null,
"enabled": true
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/cdp/transform-functions"
payload = {
"name": "normalize_event_names",
"stage": "source",
"spec": {
"version": 1,
"operations": [
{
"op": "set",
"path": "event",
"value": "order_completed"
},
{
"op": "lowercase",
"path": "properties.sku"
}
]
},
"description": "Snake-case all event names before downstream delivery",
"destination_key": None,
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'normalize_event_names',
stage: 'source',
spec: {
version: 1,
operations: [
{op: 'set', path: 'event', value: 'order_completed'},
{op: 'lowercase', path: 'properties.sku'}
]
},
description: 'Snake-case all event names before downstream delivery',
destination_key: null,
enabled: true
})
};
fetch('https://api.orbit.devotel.io/api/v1/cdp/transform-functions', 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.orbit.devotel.io/api/v1/cdp/transform-functions",
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' => 'normalize_event_names',
'stage' => 'source',
'spec' => [
'version' => 1,
'operations' => [
[
'op' => 'set',
'path' => 'event',
'value' => 'order_completed'
],
[
'op' => 'lowercase',
'path' => 'properties.sku'
]
]
],
'description' => 'Snake-case all event names before downstream delivery',
'destination_key' => null,
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"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.orbit.devotel.io/api/v1/cdp/transform-functions"
payload := strings.NewReader("{\n \"name\": \"normalize_event_names\",\n \"stage\": \"source\",\n \"spec\": {\n \"version\": 1,\n \"operations\": [\n {\n \"op\": \"set\",\n \"path\": \"event\",\n \"value\": \"order_completed\"\n },\n {\n \"op\": \"lowercase\",\n \"path\": \"properties.sku\"\n }\n ]\n },\n \"description\": \"Snake-case all event names before downstream delivery\",\n \"destination_key\": null,\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.orbit.devotel.io/api/v1/cdp/transform-functions")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"normalize_event_names\",\n \"stage\": \"source\",\n \"spec\": {\n \"version\": 1,\n \"operations\": [\n {\n \"op\": \"set\",\n \"path\": \"event\",\n \"value\": \"order_completed\"\n },\n {\n \"op\": \"lowercase\",\n \"path\": \"properties.sku\"\n }\n ]\n },\n \"description\": \"Snake-case all event names before downstream delivery\",\n \"destination_key\": null,\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/cdp/transform-functions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"normalize_event_names\",\n \"stage\": \"source\",\n \"spec\": {\n \"version\": 1,\n \"operations\": [\n {\n \"op\": \"set\",\n \"path\": \"event\",\n \"value\": \"order_completed\"\n },\n {\n \"op\": \"lowercase\",\n \"path\": \"properties.sku\"\n }\n ]\n },\n \"description\": \"Snake-case all event names before downstream delivery\",\n \"destination_key\": null,\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"status": 429,
"retry_after": 2
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Body
Lowercase identifier for the function (letters, digits, underscores; must start with a letter). Unique per tenant.
"normalize_event_names"
Where the transform runs: source rewrites every inbound event after ingest; destination rewrites the per-destination payload just before delivery.
source, destination "source"
The declarative transform spec — version (currently 1) plus an ordered operations array of bounded object ops (set, default, copy, rename, remove, coalesce, lowercase, uppercase, trim, drop_event) over dot-paths.
{
"version": 1,
"operations": [
{
"op": "set",
"path": "event",
"value": "order_completed"
},
{
"op": "lowercase",
"path": "properties.sku"
}
]
}
Optional human-readable note (max 500 chars) shown in the rule builder.
"Snake-case all event names before downstream delivery"
Destination binding — required context when stage is destination; null for a source-stage function.
null
Whether the pipeline applies the transform. Defaults to true; set false to author ahead of activation.
true
Response
Successful response.