curl --request PATCH \
--url https://api.example.com/items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"properties": {},
"version": 1,
"force_snapshot": true,
"timestamp": "<string>",
"source_id": "<string>",
"edges": {}
}
'import requests
url = "https://api.example.com/items/{id}"
payload = {
"properties": {},
"version": 1,
"force_snapshot": True,
"timestamp": "<string>",
"source_id": "<string>",
"edges": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
properties: {},
version: 1,
force_snapshot: true,
timestamp: '<string>',
source_id: '<string>',
edges: {}
})
};
fetch('https://api.example.com/items/{id}', 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.example.com/items/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'properties' => [
],
'version' => 1,
'force_snapshot' => true,
'timestamp' => '<string>',
'source_id' => '<string>',
'edges' => [
]
]),
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.example.com/items/{id}"
payload := strings.NewReader("{\n \"properties\": {},\n \"version\": 1,\n \"force_snapshot\": true,\n \"timestamp\": \"<string>\",\n \"source_id\": \"<string>\",\n \"edges\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/items/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"properties\": {},\n \"version\": 1,\n \"force_snapshot\": true,\n \"timestamp\": \"<string>\",\n \"source_id\": \"<string>\",\n \"edges\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/items/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"properties\": {},\n \"version\": 1,\n \"force_snapshot\": true,\n \"timestamp\": \"<string>\",\n \"source_id\": \"<string>\",\n \"edges\": {}\n}"
response = http.request(request)
puts response.read_body{
"item": {
"id": "<string>",
"type": "<string>",
"properties": {},
"state": "active",
"version": 123,
"schema_version": 123,
"source": "<string>",
"timestamp": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"tier": "library",
"tenant_id": "<string>",
"source_id": "<string>",
"device": "<string>",
"capture_latitude": 123,
"capture_longitude": 123,
"edges": {},
"extensions": {}
},
"metadata": {
"item_id": "<string>",
"tags": [
"<string>"
],
"extensions": {}
}
}{
"error": {
"code": "validation_error",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "item_not_found",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "version_conflict",
"status": 409
},
"current": {
"version": 123,
"properties": {}
},
"ancestor": {
"version": 123,
"properties": {}
},
"conflicting_fields": [
"<string>"
],
"merge_policy": {
"fields": {},
"default": "last_writer_wins"
}
}Update an item
Updates an item’s properties, tier, timestamp, or natural-key source_id. Properties shallow-merge into the existing row (unmentioned keys keep their values). The optional version field enables optimistic concurrency — pass the version the caller is editing from; a mismatch returns 409 version_conflict with the three-way context (current, ancestor, conflicting fields, resolved merge policy) the client needs to resolve. See Conflicts and Errors — version_conflict.
The edges block has replace-all-for-specified-types semantics: any edge_type listed wipes existing outbound edges of that type from this item, then creates new edges to each listed target. Empty array for an edge_type deletes all edges of that type. Unmentioned edge types are untouched.
Tier and timestamp updates are last-writer-wins and never produce a version conflict.
The source_id field repoints the item at a new natural key under the item’s source. The (source, source_id) tuple is unique per tenant — collisions with a different existing item return 409 source_id_conflict. PATCHing the value the item already carries is a no-op success. Used by the sync agent to preserve item identity through file renames.
curl --request PATCH \
--url https://api.example.com/items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"properties": {},
"version": 1,
"force_snapshot": true,
"timestamp": "<string>",
"source_id": "<string>",
"edges": {}
}
'import requests
url = "https://api.example.com/items/{id}"
payload = {
"properties": {},
"version": 1,
"force_snapshot": True,
"timestamp": "<string>",
"source_id": "<string>",
"edges": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
properties: {},
version: 1,
force_snapshot: true,
timestamp: '<string>',
source_id: '<string>',
edges: {}
})
};
fetch('https://api.example.com/items/{id}', 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.example.com/items/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'properties' => [
],
'version' => 1,
'force_snapshot' => true,
'timestamp' => '<string>',
'source_id' => '<string>',
'edges' => [
]
]),
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.example.com/items/{id}"
payload := strings.NewReader("{\n \"properties\": {},\n \"version\": 1,\n \"force_snapshot\": true,\n \"timestamp\": \"<string>\",\n \"source_id\": \"<string>\",\n \"edges\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/items/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"properties\": {},\n \"version\": 1,\n \"force_snapshot\": true,\n \"timestamp\": \"<string>\",\n \"source_id\": \"<string>\",\n \"edges\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/items/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"properties\": {},\n \"version\": 1,\n \"force_snapshot\": true,\n \"timestamp\": \"<string>\",\n \"source_id\": \"<string>\",\n \"edges\": {}\n}"
response = http.request(request)
puts response.read_body{
"item": {
"id": "<string>",
"type": "<string>",
"properties": {},
"state": "active",
"version": 123,
"schema_version": 123,
"source": "<string>",
"timestamp": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"tier": "library",
"tenant_id": "<string>",
"source_id": "<string>",
"device": "<string>",
"capture_latitude": 123,
"capture_longitude": 123,
"edges": {},
"extensions": {}
},
"metadata": {
"item_id": "<string>",
"tags": [
"<string>"
],
"extensions": {}
}
}{
"error": {
"code": "validation_error",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "item_not_found",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "version_conflict",
"status": 409
},
"current": {
"version": 123,
"properties": {}
},
"ancestor": {
"version": 123,
"properties": {}
},
"conflicting_fields": [
"<string>"
],
"merge_policy": {
"fields": {},
"default": "last_writer_wins"
}
}Authorizations
Pass an API key (marfa_k1_...) or OAuth access token (marfa_at_...)