# Updating custom\_attributes values for users

**URL:** <https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460>\
**Category:** API and Webhooks\
**Created:** [July 17, 2020, 7:04pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460 "2020-07-17T19:04:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian.altgilbers](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ian.altgilbers/32/12094_2.png) [@ian.altgilbers](https://devforum.zoom.us/u/ian.altgilbers)\
**Post date:** [July 17, 2020, 7:04pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/1 "2020-07-17T19:04:04Z")

</div>

We would like to store another account identifier in addition to email address to help in account lifecycle management.

I was looking at using “custom\_attributes” in the API for updating a user record:  
[[https://marketplace.zoom.us/docs/api-reference/zoom-api/users/userupdate](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/userupdate)]

I am able to update built-in fields like “job\_title”:

```
zoom_user_base="https://api.zoom.us/v2/users/"
my_email="top@sec.ret"
R=requests.get(zoom_user_base+my_email,headers=zoom_dev.headers)
print(json.loads(R.content.decode()).get("job_title"))
R=requests.patch(zoom_user_base+my_email,headers=zoom_dev.headers,data='{"job_title":"Super Peon"}')
R=requests.get(zoom_user_base+my_email,headers=zoom_dev.headers)
print(json.loads(R.content.decode()).get("job_title"))

```

With output

```
Peon
Super Peon

```

However, when I try to add a custom\_attribute, I get a 204 status code but the changes are not reflected in the user…When I try to supply JSON including custom attributes, like:

```
R=requests.patch(zoom_user_base+my_email,headers=zoom_dev.headers,data='{"job_title":"SysAdmin","custom_attributes":[{"key":"uid","name":"uid","value":"my_uid"}]}')
print(R.status_code)
R=requests.get(zoom_user_base+my_email,headers=zoom_dev.headers)
print(json.loads(R.content.decode()).get("job_title"))
print(json.loads(R.content.decode()).keys())

```

I get:

```
204
SysAdmin
dict_keys(['id', 'first_name', 'last_name', 'email', 'type', 'role_name', 'pmi', 'use_pmi', 'personal_meeting_url', 'timezone', 'verified', 'dept', 'created_at', 'last_login_time', 'pic_url', 'host_key', 'jid', 'group_ids', 'im_group_ids', 'account_id', 'language', 'phone_country', 'phone_number', 'status', 'job_title', 'location'])

```

No “custom\_attributes” key is found, but the API call did update the job\_title and gave no errors or warnings.

Anyone have luck with using custom\_attributes?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 22, 2020, 7:28am UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/2 "2020-07-22T07:28:07Z")

</div>

Hey @ian.altgilbers,

Can you try sending without the array and just the object?

`"custom_attributes":{"key":"uid","name":"uid","value":"my_uid"}`

Let me know if that works.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![ian.altgilbers](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ian.altgilbers/32/12094_2.png) [@ian.altgilbers](https://devforum.zoom.us/u/ian.altgilbers)\
**Post date:** [July 22, 2020, 3:19pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/3 "2020-07-22T15:19:30Z")

</div>

```
R=requests.patch("https://api.zoom.us/v2/users/"+my_email,headers=zoom_dev.headers,data='{"job_title":"SysAdmin","custom_attributes":{"key":"uid","name":"uid","value":"my_uid"}}')

```

That gives me a 400 response with content:

```
{"code":300,"message":"Request Body should be a valid JSON object."}
```

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 27, 2020, 7:04pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/4 "2020-07-27T19:04:05Z")

</div>

Hey @ian.altgilbers,

I figured it out. You have to add the custom attribute first here which sets the `name` value: [https://zoom.us/account/user#/advanced](https://zoom.us/account/user#/advanced)

 ![Screen Shot 2020-07-27 at 1.00.54 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/c/ca2e7ce6c384cc617cf8b525187d3d2dfabd3bd0.png)

Then you can update the attribute:

```json
{
  "custom_attributes":[{
    "key":"cbf_8y1njyfmtsk1hnbazp2ucw","name":"test","value":"set from API"
  }]
}

```

 ![Screen Shot 2020-07-27 at 1.03.16 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/4/4430d6233510a939dd10db8d9abbda8055d81f13.png)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![ian.altgilbers](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ian.altgilbers/32/12094_2.png) [@ian.altgilbers](https://devforum.zoom.us/u/ian.altgilbers)\
**Post date:** [August 10, 2020, 8:11pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/5 "2020-08-10T20:11:46Z")

</div>

Thank you Tommy.

Once I had the custom attribute defined, I was able to push values in.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 10, 2020, 10:35pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/6 "2020-08-10T22:35:34Z")

</div>

You are welcome! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![jferguson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jferguson/32/9015_2.png) [@jferguson](https://devforum.zoom.us/u/jferguson)\
**Post date:** [October 14, 2020, 9:12pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/8 "2020-10-14T21:12:17Z")

</div>

I just wanted to add here that once you map it to a SAML attribute it doesn’t appear that you can update it with the API. I created a custom attribute and wanted it mapped from Active Directory but also didn’t want to wait for everyone to login again so I tried to pre-populate them. I had to remove the SAML mapping to get the values set from my script.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 15, 2020, 7:40pm UTC](https://devforum.zoom.us/t/updating-custom-attributes-values-for-users/24460/9 "2020-10-15T19:40:54Z")

</div>

Hey @jferguson,

Very interesting—thanks for sharing this. I’ll do some investigating on my end as well, though it sounds like this may be an intricacy of the SAML mappings.

Thanks again for pointing this out,  
Will
