curl --request POST \
--url https://api.vectorshift.ai/v1/object-model/model/configure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"confirm_plan_hash": "<string>",
"dry_run": true,
"edits": [
{
"declaration_id": "<string>",
"kind": "<string>",
"member": "<string>",
"op": "<string>",
"source": "<string>"
}
],
"expected_version": "<string>",
"migration_spec_json": "<string>",
"note": "<string>",
"source": "<string>",
"version_must_match": true
}
'import requests
url = "https://api.vectorshift.ai/v1/object-model/model/configure"
payload = {
"confirm_plan_hash": "<string>",
"dry_run": True,
"edits": [
{
"declaration_id": "<string>",
"kind": "<string>",
"member": "<string>",
"op": "<string>",
"source": "<string>"
}
],
"expected_version": "<string>",
"migration_spec_json": "<string>",
"note": "<string>",
"source": "<string>",
"version_must_match": True
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
confirm_plan_hash: '<string>',
dry_run: true,
edits: [
{
declaration_id: '<string>',
kind: '<string>',
member: '<string>',
op: '<string>',
source: '<string>'
}
],
expected_version: '<string>',
migration_spec_json: '<string>',
note: '<string>',
source: '<string>',
version_must_match: true
})
};
fetch('https://api.vectorshift.ai/v1/object-model/model/configure', 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.vectorshift.ai/v1/object-model/model/configure",
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([
'confirm_plan_hash' => '<string>',
'dry_run' => true,
'edits' => [
[
'declaration_id' => '<string>',
'kind' => '<string>',
'member' => '<string>',
'op' => '<string>',
'source' => '<string>'
]
],
'expected_version' => '<string>',
'migration_spec_json' => '<string>',
'note' => '<string>',
'source' => '<string>',
'version_must_match' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.vectorshift.ai/v1/object-model/model/configure"
payload := strings.NewReader("{\n \"confirm_plan_hash\": \"<string>\",\n \"dry_run\": true,\n \"edits\": [\n {\n \"declaration_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"member\": \"<string>\",\n \"op\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expected_version\": \"<string>\",\n \"migration_spec_json\": \"<string>\",\n \"note\": \"<string>\",\n \"source\": \"<string>\",\n \"version_must_match\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.vectorshift.ai/v1/object-model/model/configure")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"confirm_plan_hash\": \"<string>\",\n \"dry_run\": true,\n \"edits\": [\n {\n \"declaration_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"member\": \"<string>\",\n \"op\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expected_version\": \"<string>\",\n \"migration_spec_json\": \"<string>\",\n \"note\": \"<string>\",\n \"source\": \"<string>\",\n \"version_must_match\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vectorshift.ai/v1/object-model/model/configure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"confirm_plan_hash\": \"<string>\",\n \"dry_run\": true,\n \"edits\": [\n {\n \"declaration_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"member\": \"<string>\",\n \"op\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expected_version\": \"<string>\",\n \"migration_spec_json\": \"<string>\",\n \"note\": \"<string>\",\n \"source\": \"<string>\",\n \"version_must_match\": true\n}"
response = http.request(request)
puts response.read_bodyConfigure the ontology
Change the model. dry_run checks it; If-Match names the version it was read at, and a version that is no longer current is refused with 412 and the current version.
Re-sent under the same Idempotency-Key: With If-Match, exactly once: re-sent after it applied, the version has moved, so it is refused (412). Without If-Match the key is not recognized past the replay window: re-sent, it applies again as a new version with the same declarations. Send If-Match to make every re-send safe.
curl --request POST \
--url https://api.vectorshift.ai/v1/object-model/model/configure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"confirm_plan_hash": "<string>",
"dry_run": true,
"edits": [
{
"declaration_id": "<string>",
"kind": "<string>",
"member": "<string>",
"op": "<string>",
"source": "<string>"
}
],
"expected_version": "<string>",
"migration_spec_json": "<string>",
"note": "<string>",
"source": "<string>",
"version_must_match": true
}
'import requests
url = "https://api.vectorshift.ai/v1/object-model/model/configure"
payload = {
"confirm_plan_hash": "<string>",
"dry_run": True,
"edits": [
{
"declaration_id": "<string>",
"kind": "<string>",
"member": "<string>",
"op": "<string>",
"source": "<string>"
}
],
"expected_version": "<string>",
"migration_spec_json": "<string>",
"note": "<string>",
"source": "<string>",
"version_must_match": True
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
confirm_plan_hash: '<string>',
dry_run: true,
edits: [
{
declaration_id: '<string>',
kind: '<string>',
member: '<string>',
op: '<string>',
source: '<string>'
}
],
expected_version: '<string>',
migration_spec_json: '<string>',
note: '<string>',
source: '<string>',
version_must_match: true
})
};
fetch('https://api.vectorshift.ai/v1/object-model/model/configure', 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.vectorshift.ai/v1/object-model/model/configure",
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([
'confirm_plan_hash' => '<string>',
'dry_run' => true,
'edits' => [
[
'declaration_id' => '<string>',
'kind' => '<string>',
'member' => '<string>',
'op' => '<string>',
'source' => '<string>'
]
],
'expected_version' => '<string>',
'migration_spec_json' => '<string>',
'note' => '<string>',
'source' => '<string>',
'version_must_match' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.vectorshift.ai/v1/object-model/model/configure"
payload := strings.NewReader("{\n \"confirm_plan_hash\": \"<string>\",\n \"dry_run\": true,\n \"edits\": [\n {\n \"declaration_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"member\": \"<string>\",\n \"op\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expected_version\": \"<string>\",\n \"migration_spec_json\": \"<string>\",\n \"note\": \"<string>\",\n \"source\": \"<string>\",\n \"version_must_match\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.vectorshift.ai/v1/object-model/model/configure")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"confirm_plan_hash\": \"<string>\",\n \"dry_run\": true,\n \"edits\": [\n {\n \"declaration_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"member\": \"<string>\",\n \"op\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expected_version\": \"<string>\",\n \"migration_spec_json\": \"<string>\",\n \"note\": \"<string>\",\n \"source\": \"<string>\",\n \"version_must_match\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vectorshift.ai/v1/object-model/model/configure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"confirm_plan_hash\": \"<string>\",\n \"dry_run\": true,\n \"edits\": [\n {\n \"declaration_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"member\": \"<string>\",\n \"op\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expected_version\": \"<string>\",\n \"migration_spec_json\": \"<string>\",\n \"note\": \"<string>\",\n \"source\": \"<string>\",\n \"version_must_match\": true\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
An API key issued with object_model scopes: Authorization: Bearer sk_…. The scopes: object_model:records:read, object_model:records:write, object_model:facts:read, object_model:facts:write, object_model:model:read, object_model:model:configure, object_model:actions:run, object_model:changes:read. An operation's security lists the scopes it needs; several entries mean any one of them will do. A person field (ref(user), ref_list(user)) holds a user id: look people up by email or id with GET /v1/users, outside this API, with a key that also has users:read.
Headers
Required on every write: one key per logical write, sent again unchanged on every retry. A finished request replays its answer for 24 hours; the same key on a different request is refused (409 idempotency_key_reused). A dry run (dry_run: true) needs none, and is not recorded under one it carries.
1 - 255^[\x20-\x7E]+$Body
The version the change was written against. If it is no longer current, the change is refused (412) and nothing is applied. Send it as the If-Match header (If-Match: 42, quotes allowed) or as expected_version in the body; the header wins when both are sent.
Response
Answered.
