Custom data
Claim Custom Row
Atomically take one matching row and mark it.
The operation a query plus an upsert cannot express: two callers doing that both read the same row before either writes, and upsert has no precondition to refuse the second. Here the select and the mark are one statement.
An empty result is a 200 with found: false — running out of rows is an
answer the caller acts on, not an error.
POST
/
core
/
custom-data
/
tables
/
{name}
/
claim
Claim Custom Row
curl --request POST \
--url https://api.anyreach.ai/core/custom-data/tables/{name}/claim \
--header 'Content-Type: application/json' \
--data '
{
"patch": {},
"filters": [
{
"property": "<string>",
"op": "eq",
"value": "<unknown>"
}
],
"order": [
{
"property": "<string>",
"direction": "asc"
}
]
}
'import requests
url = "https://api.anyreach.ai/core/custom-data/tables/{name}/claim"
payload = {
"patch": {},
"filters": [
{
"property": "<string>",
"op": "eq",
"value": "<unknown>"
}
],
"order": [
{
"property": "<string>",
"direction": "asc"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
patch: {},
filters: [{property: '<string>', op: 'eq', value: '<unknown>'}],
order: [{property: '<string>', direction: 'asc'}]
})
};
fetch('https://api.anyreach.ai/core/custom-data/tables/{name}/claim', 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.anyreach.ai/core/custom-data/tables/{name}/claim",
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([
'patch' => [
],
'filters' => [
[
'property' => '<string>',
'op' => 'eq',
'value' => '<unknown>'
]
],
'order' => [
[
'property' => '<string>',
'direction' => 'asc'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.anyreach.ai/core/custom-data/tables/{name}/claim"
payload := strings.NewReader("{\n \"patch\": {},\n \"filters\": [\n {\n \"property\": \"<string>\",\n \"op\": \"eq\",\n \"value\": \"<unknown>\"\n }\n ],\n \"order\": [\n {\n \"property\": \"<string>\",\n \"direction\": \"asc\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.anyreach.ai/core/custom-data/tables/{name}/claim")
.header("Content-Type", "application/json")
.body("{\n \"patch\": {},\n \"filters\": [\n {\n \"property\": \"<string>\",\n \"op\": \"eq\",\n \"value\": \"<unknown>\"\n }\n ],\n \"order\": [\n {\n \"property\": \"<string>\",\n \"direction\": \"asc\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anyreach.ai/core/custom-data/tables/{name}/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"patch\": {},\n \"filters\": [\n {\n \"property\": \"<string>\",\n \"op\": \"eq\",\n \"value\": \"<unknown>\"\n }\n ],\n \"order\": [\n {\n \"property\": \"<string>\",\n \"direction\": \"asc\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"found": false,
"record": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
Organization ID for user PATs (pat_ prefix tokens)
Path Parameters
Body
application/json
Take one matching row and mark it.
Same filter and sort vocabulary as a query — the row you claim is the row
that query would have returned first. patch is what changes about it, and
it is deliberately not a filter: the caller says which row, the config says
what happens to it.
⌘I
Claim Custom Row
curl --request POST \
--url https://api.anyreach.ai/core/custom-data/tables/{name}/claim \
--header 'Content-Type: application/json' \
--data '
{
"patch": {},
"filters": [
{
"property": "<string>",
"op": "eq",
"value": "<unknown>"
}
],
"order": [
{
"property": "<string>",
"direction": "asc"
}
]
}
'import requests
url = "https://api.anyreach.ai/core/custom-data/tables/{name}/claim"
payload = {
"patch": {},
"filters": [
{
"property": "<string>",
"op": "eq",
"value": "<unknown>"
}
],
"order": [
{
"property": "<string>",
"direction": "asc"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
patch: {},
filters: [{property: '<string>', op: 'eq', value: '<unknown>'}],
order: [{property: '<string>', direction: 'asc'}]
})
};
fetch('https://api.anyreach.ai/core/custom-data/tables/{name}/claim', 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.anyreach.ai/core/custom-data/tables/{name}/claim",
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([
'patch' => [
],
'filters' => [
[
'property' => '<string>',
'op' => 'eq',
'value' => '<unknown>'
]
],
'order' => [
[
'property' => '<string>',
'direction' => 'asc'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.anyreach.ai/core/custom-data/tables/{name}/claim"
payload := strings.NewReader("{\n \"patch\": {},\n \"filters\": [\n {\n \"property\": \"<string>\",\n \"op\": \"eq\",\n \"value\": \"<unknown>\"\n }\n ],\n \"order\": [\n {\n \"property\": \"<string>\",\n \"direction\": \"asc\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.anyreach.ai/core/custom-data/tables/{name}/claim")
.header("Content-Type", "application/json")
.body("{\n \"patch\": {},\n \"filters\": [\n {\n \"property\": \"<string>\",\n \"op\": \"eq\",\n \"value\": \"<unknown>\"\n }\n ],\n \"order\": [\n {\n \"property\": \"<string>\",\n \"direction\": \"asc\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anyreach.ai/core/custom-data/tables/{name}/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"patch\": {},\n \"filters\": [\n {\n \"property\": \"<string>\",\n \"op\": \"eq\",\n \"value\": \"<unknown>\"\n }\n ],\n \"order\": [\n {\n \"property\": \"<string>\",\n \"direction\": \"asc\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"found": false,
"record": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
