EnsureDatasetAPI creates, reuses, or explicitly adopts the one dataset for a
curl --request POST \
--url https://api.erdo.ai/v1/datasets-ensure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"declared_schema": {
"columns": [
{
"description": "<string>",
"name": "<string>",
"required": true,
"semantic_role": "<string>",
"type": "<string>"
}
]
},
"description": "<string>",
"email_column": "<string>",
"instructions": "<string>",
"name": "<string>",
"phone_column": "<string>",
"preferred_dataset": "<string>",
"purpose": "<string>",
"purpose_description": "<string>"
}
'import requests
url = "https://api.erdo.ai/v1/datasets-ensure"
payload = {
"declared_schema": { "columns": [
{
"description": "<string>",
"name": "<string>",
"required": True,
"semantic_role": "<string>",
"type": "<string>"
}
] },
"description": "<string>",
"email_column": "<string>",
"instructions": "<string>",
"name": "<string>",
"phone_column": "<string>",
"preferred_dataset": "<string>",
"purpose": "<string>",
"purpose_description": "<string>"
}
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({
declared_schema: {
columns: [
{
description: '<string>',
name: '<string>',
required: true,
semantic_role: '<string>',
type: '<string>'
}
]
},
description: '<string>',
email_column: '<string>',
instructions: '<string>',
name: '<string>',
phone_column: '<string>',
preferred_dataset: '<string>',
purpose: '<string>',
purpose_description: '<string>'
})
};
fetch('https://api.erdo.ai/v1/datasets-ensure', 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.erdo.ai/v1/datasets-ensure",
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([
'declared_schema' => [
'columns' => [
[
'description' => '<string>',
'name' => '<string>',
'required' => true,
'semantic_role' => '<string>',
'type' => '<string>'
]
]
],
'description' => '<string>',
'email_column' => '<string>',
'instructions' => '<string>',
'name' => '<string>',
'phone_column' => '<string>',
'preferred_dataset' => '<string>',
'purpose' => '<string>',
'purpose_description' => '<string>'
]),
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.erdo.ai/v1/datasets-ensure"
payload := strings.NewReader("{\n \"declared_schema\": {\n \"columns\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"required\": true,\n \"semantic_role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"description\": \"<string>\",\n \"email_column\": \"<string>\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_column\": \"<string>\",\n \"preferred_dataset\": \"<string>\",\n \"purpose\": \"<string>\",\n \"purpose_description\": \"<string>\"\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.erdo.ai/v1/datasets-ensure")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"declared_schema\": {\n \"columns\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"required\": true,\n \"semantic_role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"description\": \"<string>\",\n \"email_column\": \"<string>\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_column\": \"<string>\",\n \"preferred_dataset\": \"<string>\",\n \"purpose\": \"<string>\",\n \"purpose_description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erdo.ai/v1/datasets-ensure")
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 \"declared_schema\": {\n \"columns\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"required\": true,\n \"semantic_role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"description\": \"<string>\",\n \"email_column\": \"<string>\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_column\": \"<string>\",\n \"preferred_dataset\": \"<string>\",\n \"purpose\": \"<string>\",\n \"purpose_description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created": true,
"declared_schema": {
"columns": [
{
"description": "<string>",
"name": "<string>",
"required": true,
"semantic_role": "<string>",
"type": "<string>"
}
]
},
"id": "<string>",
"name": "<string>",
"purpose": "<string>",
"slug": "<string>"
}{
"code": "not_found",
"details": {},
"message": "<string>"
}API Reference
EnsureDatasetAPI creates, reuses, or explicitly adopts the one dataset for a
purpose, and refuses to return until its declared producer contract matches.
POST
/
v1
/
datasets-ensure
EnsureDatasetAPI creates, reuses, or explicitly adopts the one dataset for a
curl --request POST \
--url https://api.erdo.ai/v1/datasets-ensure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"declared_schema": {
"columns": [
{
"description": "<string>",
"name": "<string>",
"required": true,
"semantic_role": "<string>",
"type": "<string>"
}
]
},
"description": "<string>",
"email_column": "<string>",
"instructions": "<string>",
"name": "<string>",
"phone_column": "<string>",
"preferred_dataset": "<string>",
"purpose": "<string>",
"purpose_description": "<string>"
}
'import requests
url = "https://api.erdo.ai/v1/datasets-ensure"
payload = {
"declared_schema": { "columns": [
{
"description": "<string>",
"name": "<string>",
"required": True,
"semantic_role": "<string>",
"type": "<string>"
}
] },
"description": "<string>",
"email_column": "<string>",
"instructions": "<string>",
"name": "<string>",
"phone_column": "<string>",
"preferred_dataset": "<string>",
"purpose": "<string>",
"purpose_description": "<string>"
}
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({
declared_schema: {
columns: [
{
description: '<string>',
name: '<string>',
required: true,
semantic_role: '<string>',
type: '<string>'
}
]
},
description: '<string>',
email_column: '<string>',
instructions: '<string>',
name: '<string>',
phone_column: '<string>',
preferred_dataset: '<string>',
purpose: '<string>',
purpose_description: '<string>'
})
};
fetch('https://api.erdo.ai/v1/datasets-ensure', 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.erdo.ai/v1/datasets-ensure",
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([
'declared_schema' => [
'columns' => [
[
'description' => '<string>',
'name' => '<string>',
'required' => true,
'semantic_role' => '<string>',
'type' => '<string>'
]
]
],
'description' => '<string>',
'email_column' => '<string>',
'instructions' => '<string>',
'name' => '<string>',
'phone_column' => '<string>',
'preferred_dataset' => '<string>',
'purpose' => '<string>',
'purpose_description' => '<string>'
]),
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.erdo.ai/v1/datasets-ensure"
payload := strings.NewReader("{\n \"declared_schema\": {\n \"columns\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"required\": true,\n \"semantic_role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"description\": \"<string>\",\n \"email_column\": \"<string>\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_column\": \"<string>\",\n \"preferred_dataset\": \"<string>\",\n \"purpose\": \"<string>\",\n \"purpose_description\": \"<string>\"\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.erdo.ai/v1/datasets-ensure")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"declared_schema\": {\n \"columns\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"required\": true,\n \"semantic_role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"description\": \"<string>\",\n \"email_column\": \"<string>\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_column\": \"<string>\",\n \"preferred_dataset\": \"<string>\",\n \"purpose\": \"<string>\",\n \"purpose_description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erdo.ai/v1/datasets-ensure")
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 \"declared_schema\": {\n \"columns\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"required\": true,\n \"semantic_role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"description\": \"<string>\",\n \"email_column\": \"<string>\",\n \"instructions\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_column\": \"<string>\",\n \"preferred_dataset\": \"<string>\",\n \"purpose\": \"<string>\",\n \"purpose_description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created": true,
"declared_schema": {
"columns": [
{
"description": "<string>",
"name": "<string>",
"required": true,
"semantic_role": "<string>",
"type": "<string>"
}
]
},
"id": "<string>",
"name": "<string>",
"purpose": "<string>",
"slug": "<string>"
}{
"code": "not_found",
"details": {},
"message": "<string>"
}Authorizations
An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).
Body
application/json

