View all methods

users.attributes.update

Update custom user attributes. If an attribute is set that is not part of an existing group in DX, the attribute group will be created.

Facts

Property Value
Method POST https://api.getdx.com/users.attributes.update
Required scope users:write

Arguments

Name Type Description
token Token Auth token passed as an HTTP header.
email Text The email of the user you want to update.
attributes Array<JSON> Array of attribute objects.

Example request

This is a typical request:

curl -X POST 'https://api.getdx.com/users.attributes.update' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
-H 'Content-Type: application/json' \
--data-raw '{
    "email": "john.doe@example.com",
    "attributes": [
        {
            "name": "Department",
            "value": "Engineering"
        },
        {
            "name": "Location",
            "value": "Remote"
        }
    ]
}'

Example response

This is a typical success response:

{
  "ok": true,
  "user": {
    "id": "user_123",
    "email": "john.doe@example.com",
    "failures": [],
    "attributes": [
      {
        "name": "Department",
        "value": "Engineering",
        "updated": true
      },
      {
        "name": "Location",
        "value": "Remote",
        "updated": true
      }
    ]
  }
}

Errors

This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.

Error Description
not_authed No authentication token provided.
invalid_auth Some aspect of authentication cannot be validated.