Update user relationship
/data_objects/objects/{type_name}/{object_id}/users
Use this endpoint to merge attributes into an existing user relationship.

Data Objects is generally available, but your workspace must be provisioned for Accounts before you can use this endpoint. To request provisioning, go to Data Settings > Accounts and complete the questionnaire. For details, see Enable Accounts.
Prerequisites
To use this endpoint, you need an API key with data_objects.user_relationships.update.
Rate limit
This endpoint is in the Data Objects write bucket with a default limit of 1000 requests per minute.
Path parameters
The following table lists and describes the path parameters for the /data_objects/objects/{type_name}/{object_id}/users endpoint.
| Parameter | Required | Data Type | Description |
|---|---|---|---|
type_name |
Required | String | Object type |
object_id |
Required | String | Object identifier |
Request parameters
The following table lists and describes the JSON request body parameters for the /data_objects/objects/{type_name}/{object_id}/users endpoint.
| Parameter | Required | Data Type | Description |
|---|---|---|---|
user |
Required | Object | The user to relate to the object. Must contain exactly one of external_id, braze_id, alias, email, or phone. |
user.external_id |
Optional | String | The user’s external ID. |
user.braze_id |
Optional | String | The Braze user ID. |
user.alias |
Optional | Object | User alias object with alias_name and alias_label (both required when used). |
user.email |
Optional | String | The user’s email address. |
user.phone |
Optional | String | The user’s phone number. Must be convertible to E.164. |
rel_kind |
Required | String | Relationship kind |
attributes |
Optional | Object | Relationship attributes to merge |
Identifying the user
- Pass exactly one identifier in
user. Zero or more than one non-null identifier returns400. Null identifier fields alongside one valid identifier are accepted. - If an email or phone number matches more than one user profile, Braze picks the identified user (one with an
external_id). If there’s still a tie, Braze picks the most recently updated profile. - Use
external_idwhere available.
Example request
This section includes a sample JSON payload and a sample cURL request.
Sample request payload
{
"user": {
"external_id": "user-123"
},
"rel_kind": "account_user",
"attributes": {
"role": "billing_admin"
}
}
Alternate example using user alias:
{
"user": {
"alias": {
"alias_name": "[email protected]",
"alias_label": "crm_email"
}
},
"rel_kind": "account_user",
"attributes": {
"role": "billing_admin"
}
}
Sample cURL request
This example changes the role attribute on the existing account_user relationship to billing_admin, leaving the relationship’s other attributes unchanged.
curl --location --request PATCH 'https://rest.iad-01.braze.com/data_objects/objects/account/acct-123/users' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"external_id": "user-123"
},
"rel_kind": "account_user",
"attributes": {
"role": "billing_admin"
}
}'
Response
This section includes a sample successful response and the response fields.
Example success response
The status code 200 could return the following response body.
{
"user_relationship": {
"type_name": "account",
"object_id": "acct-123",
"rel_kind": "account_user",
"user": {
"external_id": "user-123",
"braze_id": "507f1f77bcf86cd799439011"
},
"attributes": { "role": "billing_admin" }
}
}
Response parameters
The following table lists and describes the fields in a successful response.
| Parameter | Required | Data Type | Description |
|---|---|---|---|
user_relationship |
Required | Object | Updated user relationship record |
user_relationship.type_name |
Required | String | Data object type machine name |
user_relationship.object_id |
Required | String | Data object identifier |
user_relationship.rel_kind |
Required | String | Relationship kind value |
user_relationship.user |
Required | Object | Linked user object containing the identifier as sent plus braze_id |
user_relationship.attributes |
Required | Object | Relationship attributes after merge (always present, empty object if none) |
Errors
The following table lists common errors for this endpoint and how to resolve them.
| Status | Cause | Guidance |
|---|---|---|
400 |
Missing or empty user, no identifier, more than one identifier, blank identifier, malformed braze_id, email, or alias, phone that can’t convert to E.164, or the old top-level braze_id body |
Send a user object with exactly one valid identifier. |
400 |
Unknown rel_kind for the type or schema validation error |
Confirm rel_kind is valid for the object type and attributes match the relationship schema. |
404 |
Relationship or user not found (user-not-found or data-object-relationship-not-found) |
Confirm the object, user, and relationship key values all exist. |
401 |
Missing or invalid REST API key | Verify the Authorization header uses Bearer YOUR_REST_API_KEY and that the key is active. |
403 |
API key lacks permission or request is blocked by allowlist | Confirm the key has data_objects.user_relationships.update and that your source IP is on the key allowlist, if configured. |
429 |
Rate limit exceeded | Retry after X-RateLimit-Reset and reduce request frequency. |