Update entity attributes
curl --request PATCH \
--url http://api.gu1.ai/entities/{id}/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": {},
"mode": "<string>",
"skipRulesExecution": true
}
'import requests
url = "http://api.gu1.ai/entities/{id}/attributes"
payload = {
"attributes": {},
"mode": "<string>",
"skipRulesExecution": True
}
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({attributes: {}, mode: '<string>', skipRulesExecution: true})
};
fetch('http://api.gu1.ai/entities/{id}/attributes', 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 => "http://api.gu1.ai/entities/{id}/attributes",
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([
'attributes' => [
],
'mode' => '<string>',
'skipRulesExecution' => true
]),
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 := "http://api.gu1.ai/entities/{id}/attributes"
payload := strings.NewReader("{\n \"attributes\": {},\n \"mode\": \"<string>\",\n \"skipRulesExecution\": true\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("http://api.gu1.ai/entities/{id}/attributes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": {},\n \"mode\": \"<string>\",\n \"skipRulesExecution\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}/attributes")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributes\": {},\n \"mode\": \"<string>\",\n \"skipRulesExecution\": true\n}"
response = http.request(request)
puts response.read_bodyAPI Reference
Update entity attributes
Update only custom attributes on an entity β merge new keys or replace the full attributes map. Triggers entity_updated risk matrices when configured.
PATCH
/
entities
/
{id}
/
attributes
Update entity attributes
curl --request PATCH \
--url http://api.gu1.ai/entities/{id}/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": {},
"mode": "<string>",
"skipRulesExecution": true
}
'import requests
url = "http://api.gu1.ai/entities/{id}/attributes"
payload = {
"attributes": {},
"mode": "<string>",
"skipRulesExecution": True
}
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({attributes: {}, mode: '<string>', skipRulesExecution: true})
};
fetch('http://api.gu1.ai/entities/{id}/attributes', 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 => "http://api.gu1.ai/entities/{id}/attributes",
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([
'attributes' => [
],
'mode' => '<string>',
'skipRulesExecution' => true
]),
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 := "http://api.gu1.ai/entities/{id}/attributes"
payload := strings.NewReader("{\n \"attributes\": {},\n \"mode\": \"<string>\",\n \"skipRulesExecution\": true\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("http://api.gu1.ai/entities/{id}/attributes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": {},\n \"mode\": \"<string>\",\n \"skipRulesExecution\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}/attributes")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributes\": {},\n \"mode\": \"<string>\",\n \"skipRulesExecution\": true\n}"
response = http.request(request)
puts response.read_bodyOverview
Updates onlyattributes on an entity without touching other profile fields. Supports two modes:
| Mode | Behavior |
|---|---|
merge (default) | Shallow merge: sent keys overwrite or create values; keys not sent are kept |
replace | Full replace: the body attributes object becomes the entire map ({} clears all) |
{
"mode": "merge",
"attributes": {
"contact": { "phone": "+54..." },
"otro_grupo": { "branchCode": "AR-01" }
}
}
Merge is shallow at the top level: sending a category object (e.g.
contact) overwrites that whole category. Inner keys not included are dropped. Use replace for a full rewrite.entity_updated trigger, rules run after a successful patch (respecting skipRulesExecution and matrix watchFields). Webhook entity.updated is emitted with changes.attributes.
Endpoint
PATCH http://api.gu1.ai/entities/{id}/attributes
Authentication
Requiresentities:edit (legacy fallback: entities:write).
Authorization: Bearer YOUR_API_KEY
Path Parameters
string
required
UUID of the entity.
Request Body
object
required
Attribute map. Stored verbatim: scalar/array values at the root are uncategorized; nested objects act as categories.
string
default:"merge"
merge β additive patch (default). replace β full overwrite.boolean
When
true, skips risk matrix execution after the update.Response
| Field | Type | Description |
|---|---|---|
data.entityId | string | Entity UUID |
data.mode | string | merge or replace applied |
data.attributes | object | Final attributes after the patch |
data.updatedAt | string | ISO 8601 timestamp |
data.rulesExecutionSummary | object | Risk matrix run summary (when applicable) |
Examples
Merge (default)
curl -X PATCH "https://api.gu1.ai/entities/{id}/attributes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"attributes": {
"contact": { "phone": "+54115550000" }
}
}'
Full replace
curl -X PATCH "https://api.gu1.ai/entities/{id}/attributes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "replace",
"attributes": {
"commercial": { "mcc": "5411" }
}
}'
attributes are removed.
Errors
| HTTP | Code | When |
|---|---|---|
| 404 | ENTITY_NOT_FOUND | Entity missing or wrong org |
| 400 | validation | Invalid body (e.g. attributes not an object) |
Was this page helpful?