Skip to content

Update

users.update(struser_ref, UserUpdateParams**kwargs) -> UserUpdateResponse
PATCH/users/{user_ref}

Updates a user.

ParametersExpand Collapse
user_ref: str

User id or external_id.

tags: Tags

Tag updates.

create: Optional[Iterable[TagsCreate]]

Tags to create. The tag key must not already exist.

key: str

Tag key. Must not contain #, /, or :. Max 50 characters.

value: str

Tag value. Must not contain #, /, or :. Max 200 characters.

delete: Optional[Iterable[TagsDelete]]

Tags to remove.

key: str

Tag key to delete.

set: Optional[Iterable[TagsSet]]

Tags to set. Creates a new tag or updates an existing tag.

key: str

Tag key. Must not contain #, /, or :. Max 50 characters.

value: str

Tag value. Must not contain #, /, or :. Max 200 characters.

update: Optional[Iterable[TagsUpdate]]

Tags to update. The tag key must already exist.

key: str

Tag key. Must not contain #, /, or :. Max 50 characters.

value: str

Tag value. Must not contain #, /, or :. Max 200 characters.

ReturnsExpand Collapse
class UserUpdateResponse:
data: User

User object.

id: str

FRAGMENT generated unique ID.

external_id: str

User-provided unique ID.

tags: List[Tag]

Tags for the user.

key: str

Tag key.

value: str

Tag value.

Update

from fragment import Fragment

client = Fragment()
user = client.users.update(
    user_ref="user_dXNyX2ZyYWdfMDAx",
    tags={},
)
print(user.data)
{
  "data": {
    "id": "user_abc123",
    "external_id": "user_ext_123",
    "tags": [
      {
        "key": "department",
        "value": "engineering"
      }
    ]
  }
}
Returns Examples
{
  "data": {
    "id": "user_abc123",
    "external_id": "user_ext_123",
    "tags": [
      {
        "key": "department",
        "value": "engineering"
      }
    ]
  }
}