Create a SQL trait definition
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/cdp/sql-traitsimport requests
url = "https://api.orbit.devotel.io/api/v1/cdp/sql-traits"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.orbit.devotel.io/api/v1/cdp/sql-traits', 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/sql-traits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/cdp/sql-traits"
req, _ := http.NewRequest("POST", url, nil)
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/sql-traits")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/cdp/sql-traits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"id": "sqltrait_9f2c1d4a7b3e9f2c1d4a7b3e9f2c1d4a7b3e",
"name": "high_value_segment",
"description": "LTV over the 90-day window",
"warehouse": "bigquery",
"sql": "select user_id, sum(o.gmv) as trait_value from orders o group by 1",
"connection_configured": true,
"schedule_minutes": 1440,
"enabled": true,
"created_by": "user_2hGfK9dTsbJ1Q7c",
"created_at": "2026-08-07T12:00:00.000Z",
"updated_at": "2026-08-07T12:00:00.000Z",
"last_run_at": null,
"last_run_status": null,
"last_run_rows": null,
"last_error": null,
"last_error_at": null
},
"meta": {
"request_id": "req_01J8Z9K3P4Q5R6S7T8U9V0W1X2",
"timestamp": "2026-08-07T12:00:00.000Z"
}
}{
"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>"
}
}CDP
Create a SQL trait definition
Stores a new warehouse-SQL trait definition. Body: name (lowercase identifier — becomes the contacts.traits[<name>] key), warehouse (bigquery / snowflake / redshift), a read-only SELECT / WITH sql projecting user_id + trait_value, a JSON connection credential blob (stored encrypted, never returned), optional schedule_minutes (default 1440) and enabled (default true). 400 when the SQL or the credential shape fails the read-only guard; 409 on a duplicate name. 201 with the public projection.
POST
/
api
/
v1
/
cdp
/
sql-traits
Create a SQL trait definition
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/cdp/sql-traitsimport requests
url = "https://api.orbit.devotel.io/api/v1/cdp/sql-traits"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.orbit.devotel.io/api/v1/cdp/sql-traits', 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/sql-traits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/cdp/sql-traits"
req, _ := http.NewRequest("POST", url, nil)
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/sql-traits")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/cdp/sql-traits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"id": "sqltrait_9f2c1d4a7b3e9f2c1d4a7b3e9f2c1d4a7b3e",
"name": "high_value_segment",
"description": "LTV over the 90-day window",
"warehouse": "bigquery",
"sql": "select user_id, sum(o.gmv) as trait_value from orders o group by 1",
"connection_configured": true,
"schedule_minutes": 1440,
"enabled": true,
"created_by": "user_2hGfK9dTsbJ1Q7c",
"created_at": "2026-08-07T12:00:00.000Z",
"updated_at": "2026-08-07T12:00:00.000Z",
"last_run_at": null,
"last_run_status": null,
"last_run_rows": null,
"last_error": null,
"last_error_at": null
},
"meta": {
"request_id": "req_01J8Z9K3P4Q5R6S7T8U9V0W1X2",
"timestamp": "2026-08-07T12:00:00.000Z"
}
}{
"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>"
}
}Response
The created SQL trait definition; connection_configured replaces the credential blob.
The created SQL trait definition; connection_configured replaces the credential blob.