Skip to main content
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
}
'

Overview

Updates only attributes on an entity without touching other profile fields. Supports two modes:
ModeBehavior
merge (default)Shallow merge: sent keys overwrite or create values; keys not sent are kept
replaceFull replace: the body attributes object becomes the entire map ({} clears all)
Attributes are stored verbatim β€” nested objects act as categories and are returned as sent, same as Update entity:
{
  "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.
When the assigned risk matrix includes an 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

Requires entities:edit (legacy fallback: entities:write).
Authorization: Bearer YOUR_API_KEY

Path Parameters

id
string
required
UUID of the entity.

Request Body

attributes
object
required
Attribute map. Stored verbatim: scalar/array values at the root are uncategorized; nested objects act as categories.
mode
string
default:"merge"
merge β€” additive patch (default). replace β€” full overwrite.
skipRulesExecution
boolean
When true, skips risk matrix execution after the update.

Response

FieldTypeDescription
data.entityIdstringEntity UUID
data.modestringmerge or replace applied
data.attributesobjectFinal attributes after the patch
data.updatedAtstringISO 8601 timestamp
data.rulesExecutionSummaryobjectRisk 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" }
    }
  }'
Existing keys not included in the request remain unchanged.

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" }
    }
  }'
Keys that existed before but are omitted from attributes are removed.

Errors

HTTPCodeWhen
404ENTITY_NOT_FOUNDEntity missing or wrong org
400validationInvalid body (e.g. attributes not an object)