curl --request POST \
--url https://api.vectorshift.ai/v1/object-model/actions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"action_id": "<string>",
"approving_decision_id": "<string>",
"citations_json": "<string>",
"confirm_lockout": true,
"dry_run": true,
"field_writes": {},
"instance_id": "<string>",
"note": "<string>",
"params": {},
"preview_definitions": [
"<string>"
],
"record_edit_baselines": [
{
"record_id": "<string>",
"values": {}
}
],
"resume": true,
"subject_id": "<string>",
"world_id": "<string>"
}
]
}
'import requests
url = "https://api.vectorshift.ai/v1/object-model/actions/batch"
payload = { "items": [
{
"action_id": "<string>",
"approving_decision_id": "<string>",
"citations_json": "<string>",
"confirm_lockout": True,
"dry_run": True,
"field_writes": {},
"instance_id": "<string>",
"note": "<string>",
"params": {},
"preview_definitions": ["<string>"],
"record_edit_baselines": [
{
"record_id": "<string>",
"values": {}
}
],
"resume": True,
"subject_id": "<string>",
"world_id": "<string>"
}
] }
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({
items: [
{
action_id: '<string>',
approving_decision_id: '<string>',
citations_json: '<string>',
confirm_lockout: true,
dry_run: true,
field_writes: {},
instance_id: '<string>',
note: '<string>',
params: {},
preview_definitions: ['<string>'],
record_edit_baselines: [{record_id: '<string>', values: {}}],
resume: true,
subject_id: '<string>',
world_id: '<string>'
}
]
})
};
fetch('https://api.vectorshift.ai/v1/object-model/actions/batch', 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/actions/batch",
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([
'items' => [
[
'action_id' => '<string>',
'approving_decision_id' => '<string>',
'citations_json' => '<string>',
'confirm_lockout' => true,
'dry_run' => true,
'field_writes' => [
],
'instance_id' => '<string>',
'note' => '<string>',
'params' => [
],
'preview_definitions' => [
'<string>'
],
'record_edit_baselines' => [
[
'record_id' => '<string>',
'values' => [
]
]
],
'resume' => true,
'subject_id' => '<string>',
'world_id' => '<string>'
]
]
]),
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/actions/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"action_id\": \"<string>\",\n \"approving_decision_id\": \"<string>\",\n \"citations_json\": \"<string>\",\n \"confirm_lockout\": true,\n \"dry_run\": true,\n \"field_writes\": {},\n \"instance_id\": \"<string>\",\n \"note\": \"<string>\",\n \"params\": {},\n \"preview_definitions\": [\n \"<string>\"\n ],\n \"record_edit_baselines\": [\n {\n \"record_id\": \"<string>\",\n \"values\": {}\n }\n ],\n \"resume\": true,\n \"subject_id\": \"<string>\",\n \"world_id\": \"<string>\"\n }\n ]\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/actions/batch")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"action_id\": \"<string>\",\n \"approving_decision_id\": \"<string>\",\n \"citations_json\": \"<string>\",\n \"confirm_lockout\": true,\n \"dry_run\": true,\n \"field_writes\": {},\n \"instance_id\": \"<string>\",\n \"note\": \"<string>\",\n \"params\": {},\n \"preview_definitions\": [\n \"<string>\"\n ],\n \"record_edit_baselines\": [\n {\n \"record_id\": \"<string>\",\n \"values\": {}\n }\n ],\n \"resume\": true,\n \"subject_id\": \"<string>\",\n \"world_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vectorshift.ai/v1/object-model/actions/batch")
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 \"items\": [\n {\n \"action_id\": \"<string>\",\n \"approving_decision_id\": \"<string>\",\n \"citations_json\": \"<string>\",\n \"confirm_lockout\": true,\n \"dry_run\": true,\n \"field_writes\": {},\n \"instance_id\": \"<string>\",\n \"note\": \"<string>\",\n \"params\": {},\n \"preview_definitions\": [\n \"<string>\"\n ],\n \"record_edit_baselines\": [\n {\n \"record_id\": \"<string>\",\n \"values\": {}\n }\n ],\n \"resume\": true,\n \"subject_id\": \"<string>\",\n \"world_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"error": "<string>",
"result": {
"created": [
{
"binding": "<string>",
"entity_id": "<string>",
"type_id": "<string>"
}
],
"decision_id": "<string>",
"diagnostics": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"fact_ids": [
"<string>"
],
"field_outcomes": [
{
"attribute": "<string>",
"outcome": {
"outcome": "<string>",
"reason": "<string>",
"standing": {
"actor": "<string>",
"as_of_ms": "<string>",
"by_person": true,
"kind": "<string>",
"observation_id": "<string>",
"reference": "<string>",
"title": "<string>"
}
},
"record_id": "<string>"
}
],
"instance_id": "<string>",
"invalidated_definitions": [
"<string>"
],
"lockout": {
"own": 123,
"records": 123,
"wall_id": "<string>",
"wall_label": "<string>"
},
"previews": [
{
"as_of": "2023-11-07T05:31:56Z",
"as_of_earliest": "2023-11-07T05:31:56Z",
"at": "2023-11-07T05:31:56Z",
"basis": 123,
"change": 123,
"change_ratio": 123,
"coverage": {
"included": "<string>",
"subject_type_id": "<string>",
"total": "<string>"
},
"definition_id": "<string>",
"derived": true,
"error": "<string>",
"group_key": "<string>",
"index_key": "<string>",
"measure_kind": "<string>",
"not_applicable": "<string>",
"not_computable": "<string>",
"share": 123,
"source": {
"kind": "<string>",
"verified": true
},
"subject_id": "<string>",
"unit": "<string>",
"value": 123
}
],
"record_edit_baselines_checked": "<string>",
"refusal": "<string>",
"status": "<string>"
}
}
]
}Run actions in a batch
Up to 200 independent action runs, in order, one answer each.
Re-sent under the same Idempotency-Key: Each item’s instance_id names its run: re-sent, a finished item answers replayed, and an item that ended partial answers its partial result again unless it says resume: true.
curl --request POST \
--url https://api.vectorshift.ai/v1/object-model/actions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"action_id": "<string>",
"approving_decision_id": "<string>",
"citations_json": "<string>",
"confirm_lockout": true,
"dry_run": true,
"field_writes": {},
"instance_id": "<string>",
"note": "<string>",
"params": {},
"preview_definitions": [
"<string>"
],
"record_edit_baselines": [
{
"record_id": "<string>",
"values": {}
}
],
"resume": true,
"subject_id": "<string>",
"world_id": "<string>"
}
]
}
'import requests
url = "https://api.vectorshift.ai/v1/object-model/actions/batch"
payload = { "items": [
{
"action_id": "<string>",
"approving_decision_id": "<string>",
"citations_json": "<string>",
"confirm_lockout": True,
"dry_run": True,
"field_writes": {},
"instance_id": "<string>",
"note": "<string>",
"params": {},
"preview_definitions": ["<string>"],
"record_edit_baselines": [
{
"record_id": "<string>",
"values": {}
}
],
"resume": True,
"subject_id": "<string>",
"world_id": "<string>"
}
] }
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({
items: [
{
action_id: '<string>',
approving_decision_id: '<string>',
citations_json: '<string>',
confirm_lockout: true,
dry_run: true,
field_writes: {},
instance_id: '<string>',
note: '<string>',
params: {},
preview_definitions: ['<string>'],
record_edit_baselines: [{record_id: '<string>', values: {}}],
resume: true,
subject_id: '<string>',
world_id: '<string>'
}
]
})
};
fetch('https://api.vectorshift.ai/v1/object-model/actions/batch', 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/actions/batch",
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([
'items' => [
[
'action_id' => '<string>',
'approving_decision_id' => '<string>',
'citations_json' => '<string>',
'confirm_lockout' => true,
'dry_run' => true,
'field_writes' => [
],
'instance_id' => '<string>',
'note' => '<string>',
'params' => [
],
'preview_definitions' => [
'<string>'
],
'record_edit_baselines' => [
[
'record_id' => '<string>',
'values' => [
]
]
],
'resume' => true,
'subject_id' => '<string>',
'world_id' => '<string>'
]
]
]),
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/actions/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"action_id\": \"<string>\",\n \"approving_decision_id\": \"<string>\",\n \"citations_json\": \"<string>\",\n \"confirm_lockout\": true,\n \"dry_run\": true,\n \"field_writes\": {},\n \"instance_id\": \"<string>\",\n \"note\": \"<string>\",\n \"params\": {},\n \"preview_definitions\": [\n \"<string>\"\n ],\n \"record_edit_baselines\": [\n {\n \"record_id\": \"<string>\",\n \"values\": {}\n }\n ],\n \"resume\": true,\n \"subject_id\": \"<string>\",\n \"world_id\": \"<string>\"\n }\n ]\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/actions/batch")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"action_id\": \"<string>\",\n \"approving_decision_id\": \"<string>\",\n \"citations_json\": \"<string>\",\n \"confirm_lockout\": true,\n \"dry_run\": true,\n \"field_writes\": {},\n \"instance_id\": \"<string>\",\n \"note\": \"<string>\",\n \"params\": {},\n \"preview_definitions\": [\n \"<string>\"\n ],\n \"record_edit_baselines\": [\n {\n \"record_id\": \"<string>\",\n \"values\": {}\n }\n ],\n \"resume\": true,\n \"subject_id\": \"<string>\",\n \"world_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vectorshift.ai/v1/object-model/actions/batch")
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 \"items\": [\n {\n \"action_id\": \"<string>\",\n \"approving_decision_id\": \"<string>\",\n \"citations_json\": \"<string>\",\n \"confirm_lockout\": true,\n \"dry_run\": true,\n \"field_writes\": {},\n \"instance_id\": \"<string>\",\n \"note\": \"<string>\",\n \"params\": {},\n \"preview_definitions\": [\n \"<string>\"\n ],\n \"record_edit_baselines\": [\n {\n \"record_id\": \"<string>\",\n \"values\": {}\n }\n ],\n \"resume\": true,\n \"subject_id\": \"<string>\",\n \"world_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"error": "<string>",
"result": {
"created": [
{
"binding": "<string>",
"entity_id": "<string>",
"type_id": "<string>"
}
],
"decision_id": "<string>",
"diagnostics": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"fact_ids": [
"<string>"
],
"field_outcomes": [
{
"attribute": "<string>",
"outcome": {
"outcome": "<string>",
"reason": "<string>",
"standing": {
"actor": "<string>",
"as_of_ms": "<string>",
"by_person": true,
"kind": "<string>",
"observation_id": "<string>",
"reference": "<string>",
"title": "<string>"
}
},
"record_id": "<string>"
}
],
"instance_id": "<string>",
"invalidated_definitions": [
"<string>"
],
"lockout": {
"own": 123,
"records": 123,
"wall_id": "<string>",
"wall_label": "<string>"
},
"previews": [
{
"as_of": "2023-11-07T05:31:56Z",
"as_of_earliest": "2023-11-07T05:31:56Z",
"at": "2023-11-07T05:31:56Z",
"basis": 123,
"change": 123,
"change_ratio": 123,
"coverage": {
"included": "<string>",
"subject_type_id": "<string>",
"total": "<string>"
},
"definition_id": "<string>",
"derived": true,
"error": "<string>",
"group_key": "<string>",
"index_key": "<string>",
"measure_kind": "<string>",
"not_applicable": "<string>",
"not_computable": "<string>",
"share": 123,
"source": {
"kind": "<string>",
"verified": true
},
"subject_id": "<string>",
"unit": "<string>",
"value": 123
}
],
"record_edit_baselines_checked": "<string>",
"refusal": "<string>",
"status": "<string>"
}
}
]
}Authorizations
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]+$