Correct a past version's stored values
curl --request POST \
--url https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"close": 12.5
},
"reason": "Wrong close copied from the sheet"
}
'import requests
url = "https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend"
payload = {
"data": { "close": 12.5 },
"reason": "Wrong close copied from the sheet"
}
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({data: {close: 12.5}, reason: 'Wrong close copied from the sheet'})
};
fetch('https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend', 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.quiva.ai/records/{config_id}/{id}/history/{version}/amend",
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([
'data' => [
'close' => 12.5
],
'reason' => 'Wrong close copied from the sheet'
]),
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.quiva.ai/records/{config_id}/{id}/history/{version}/amend"
payload := strings.NewReader("{\n \"data\": {\n \"close\": 12.5\n },\n \"reason\": \"Wrong close copied from the sheet\"\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.quiva.ai/records/{config_id}/{id}/history/{version}/amend")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"close\": 12.5\n },\n \"reason\": \"Wrong close copied from the sheet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend")
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 \"data\": {\n \"close\": 12.5\n },\n \"reason\": \"Wrong close copied from the sheet\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 123,
"body": {
"sequence": 123,
"time": "2023-11-07T05:31:56Z",
"config_id": "<string>",
"record_id": "<string>",
"version": 123,
"op": "put",
"mode": "audit",
"actor": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"config_updated_at": "<string>",
"snapshot": {},
"reconstructed": true,
"restored_from": 123,
"hidden": true,
"erased": true,
"hidden_by": "<string>",
"hidden_at": "2023-11-07T05:31:56Z",
"hidden_reason": "<string>",
"amended_by": "<string>",
"amended_at": "2023-11-07T05:31:56Z",
"amend_reason": "<string>",
"original_snapshot": {}
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}Record History
Correct a past version's stored values
Amends one put version without changing the record: data is materialised against the target’s folded snapshot, validated against the current schema, and published as an amendment the fold applies on every future read. Refuses the record’s current version (edit the record itself instead) and a hidden version. A merge that leaves the snapshot byte-identical is a no-op — 200 with the existing entry, nothing published.
POST
/
records
/
{config_id}
/
{id}
/
history
/
{version}
/
amend
Correct a past version's stored values
curl --request POST \
--url https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"close": 12.5
},
"reason": "Wrong close copied from the sheet"
}
'import requests
url = "https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend"
payload = {
"data": { "close": 12.5 },
"reason": "Wrong close copied from the sheet"
}
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({data: {close: 12.5}, reason: 'Wrong close copied from the sheet'})
};
fetch('https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend', 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.quiva.ai/records/{config_id}/{id}/history/{version}/amend",
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([
'data' => [
'close' => 12.5
],
'reason' => 'Wrong close copied from the sheet'
]),
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.quiva.ai/records/{config_id}/{id}/history/{version}/amend"
payload := strings.NewReader("{\n \"data\": {\n \"close\": 12.5\n },\n \"reason\": \"Wrong close copied from the sheet\"\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.quiva.ai/records/{config_id}/{id}/history/{version}/amend")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"close\": 12.5\n },\n \"reason\": \"Wrong close copied from the sheet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/records/{config_id}/{id}/history/{version}/amend")
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 \"data\": {\n \"close\": 12.5\n },\n \"reason\": \"Wrong close copied from the sheet\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 123,
"body": {
"sequence": 123,
"time": "2023-11-07T05:31:56Z",
"config_id": "<string>",
"record_id": "<string>",
"version": 123,
"op": "put",
"mode": "audit",
"actor": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"config_updated_at": "<string>",
"snapshot": {},
"reconstructed": true,
"restored_from": 123,
"hidden": true,
"erased": true,
"hidden_by": "<string>",
"hidden_at": "2023-11-07T05:31:56Z",
"hidden_reason": "<string>",
"amended_by": "<string>",
"amended_at": "2023-11-07T05:31:56Z",
"amend_reason": "<string>",
"original_snapshot": {}
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}{
"status_code": 400,
"body": {
"error": "field 'rating' is required"
}
}Authorizations
bearerAuthapiKeyAuth
Path Parameters
Body
application/json
Body of POST .../amend. data is merged onto the target version's folded snapshot data exactly as a record update merges (replace: true replaces data wholesale instead). folder, parent_folder, space_id and completed are not amendable.