Create a query endpoint
curl --request POST \
--url https://api.withsplendor.com/v1/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
--data '
{
"name": "<string>",
"sql": "<string>",
"description": "<string>",
"parameters": [
{
"name": "<string>",
"default": "<string>",
"required": true
}
]
}
'import requests
url = "https://api.withsplendor.com/v1/endpoints"
payload = {
"name": "<string>",
"sql": "<string>",
"description": "<string>",
"parameters": [
{
"name": "<string>",
"default": "<string>",
"required": True
}
]
}
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({
name: '<string>',
sql: '<string>',
description: '<string>',
parameters: [{name: '<string>', default: '<string>', required: true}]
})
};
fetch('https://api.withsplendor.com/v1/endpoints', 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/endpoints",
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' => '<string>',
'sql' => '<string>',
'description' => '<string>',
'parameters' => [
[
'name' => '<string>',
'default' => '<string>',
'required' => true
]
]
]),
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/endpoints"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sql\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"default\": \"<string>\",\n \"required\": true\n }\n ]\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/endpoints")
.header("x-splendor-tenant-id", "<x-splendor-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sql\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"default\": \"<string>\",\n \"required\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withsplendor.com/v1/endpoints")
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 \"name\": \"<string>\",\n \"sql\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"default\": \"<string>\",\n \"required\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-01-15T09:30:00Z",
"description": "Orders in a region, newest first.",
"endpoint_id": "qe_01H8Z3",
"latest_version": 2,
"name": "orders_by_region",
"updated_at": "2026-01-15T09:30:00Z"
}{
"detail": "Dataset not found"
}{
"detail": "Dataset not found"
}{
"detail": "Dataset not found"
}{
"detail": "Dataset not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Query Endpoints
Create a query endpoint
Creates a named, versioned SQL query with typed parameters (the durable counterpart to an ad-hoc SQL search). The SQL uses :name placeholders, each declared as a typed parameter; values are bound safely at execute time.
POST
/
v1
/
endpoints
Create a query endpoint
curl --request POST \
--url https://api.withsplendor.com/v1/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
--data '
{
"name": "<string>",
"sql": "<string>",
"description": "<string>",
"parameters": [
{
"name": "<string>",
"default": "<string>",
"required": true
}
]
}
'import requests
url = "https://api.withsplendor.com/v1/endpoints"
payload = {
"name": "<string>",
"sql": "<string>",
"description": "<string>",
"parameters": [
{
"name": "<string>",
"default": "<string>",
"required": True
}
]
}
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({
name: '<string>',
sql: '<string>',
description: '<string>',
parameters: [{name: '<string>', default: '<string>', required: true}]
})
};
fetch('https://api.withsplendor.com/v1/endpoints', 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/endpoints",
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' => '<string>',
'sql' => '<string>',
'description' => '<string>',
'parameters' => [
[
'name' => '<string>',
'default' => '<string>',
'required' => true
]
]
]),
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/endpoints"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sql\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"default\": \"<string>\",\n \"required\": true\n }\n ]\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/endpoints")
.header("x-splendor-tenant-id", "<x-splendor-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sql\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"default\": \"<string>\",\n \"required\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withsplendor.com/v1/endpoints")
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 \"name\": \"<string>\",\n \"sql\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"default\": \"<string>\",\n \"required\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-01-15T09:30:00Z",
"description": "Orders in a region, newest first.",
"endpoint_id": "qe_01H8Z3",
"latest_version": 2,
"name": "orders_by_region",
"updated_at": "2026-01-15T09:30:00Z"
}{
"detail": "Dataset not found"
}{
"detail": "Dataset not found"
}{
"detail": "Dataset not found"
}{
"detail": "Dataset not found"
}{
"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