Skip to main content
PUT/users-by-id/mass_update_custom_attributes/

Mass update custom attributes

You can update a value for your custom attributes for many users at the same time.

Attributes

Optional unless marked required

idslist(strings)required
List of users' custom ids (unique identifiers for the user which are provided by the client).
attributestringrequired
The name of your attribute. Has to be at least 1 character, and cannot be longer than 255 characters.
valuevarious typesrequired
A possible attribute types: boolean, fixed, string, date, datetime, integer, float and json.

Request​

curl -X PUT "https://<your_app_subdomain>.user.com/api/public/users-by-id/mass_update_custom_attributes/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"devon"
],
"attribute": "20261110_1519_seats",
"value": 4
}'

Response examples​

{
"status": "ok"
}

A 400 names the fields that were rejected. The messages you're most likely to see:

MessageWhen
This field is required.ids, attribute or value is missing (each missing field is listed).
<name> is not a valid user attribute.No contact attribute has that name.
“abc” value must be an integer. (in non_field_errors)value doesn't fit the attribute's type.

Custom IDs in ids that no contact has are skipped: the other contacts are updated, no contact is created, and the response is 200 as usual.

Response fields​

Fields returned in the 200 OK response body.

statusstring
ok when the update was accepted.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.