Skip to main content
PUT/users/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(integers)required
List of users' ids (unique identifiers for the user which are given by User automatically).
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/mass_update_custom_attributes/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"ids": [
1924,
1925,
1926
],
"attribute": "20261110_1519_seats",
"value": 7
}'

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.

IDs in ids that aren't contacts are skipped: the other contacts are updated 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.