# Automating creation of Zoom Phone users

**URL:** <https://devforum.zoom.us/t/automating-creation-of-zoom-phone-users/81212>\
**Category:** API and Webhooks\
**Created:** [January 10, 2023, 2:49pm UTC](https://devforum.zoom.us/t/automating-creation-of-zoom-phone-users/81212 "2023-01-10T14:49:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bk-zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bk-zoom/32/33992_2.png) [@bk-zoom](https://devforum.zoom.us/u/bk-zoom)\
**Post date:** [January 10, 2023, 2:49pm UTC](https://devforum.zoom.us/t/automating-creation-of-zoom-phone-users/81212/1 "2023-01-10T14:49:47Z")

</div>

**API Endpoint(s) and/or Zoom API Event(s)**

post /phone/users/batch

```auto
        var phonePayload = {
          users: [
            {
              email: email,
              first_name: first_name,
              last_name: last_name,
              calling_plans: ["US/CA Unlimited"],
              extension_number: extension_number,
              sms: true,
            },
          ],
        };

        var config = {
          method: "post",
          url: `https://api.zoom.us/v2/phone/users/batch`,
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${zoomAccessToken}`,
          },
          data: phonePayload,
        };

```

**Description**

I am trying to automate our user on-boarding to create our users via the API in both meetings and phones.  
Due to the way our licenses are setup, i cannot use the “feature” parameter when creating a new zoom meeting user so it will automatically set the phone portion up for me.

```auto

    // This does not seem to work with the type of zoom license/account setup we have, have to call phone API seperatly after this user is created
    if (zoom_phone) {
      // Enable Phone too
      payload.feature = {};
      payload.feature.zoom_phone = zoom_phone;
      payload.feature.zoom_one_type = 16;
    }

```

So upon success of meeting user creation, i then call this phone users endpoint to create the phone user access. This is working great except it does not assign a number to the user, and i have to hardcode the extension.

- I do not want to maintain a list of extensions to assign
- i do not want to maintain a list of phone numbers to assign

How can i create a phone user over the API and automatically assign the next numerical extension that is available, as well as phone number.

Is there another endpoint i need to hit to claim a “free number” in the area code we desire and then hardcode it into my user account creation call?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [January 14, 2024, 6:26am UTC](https://devforum.zoom.us/t/automating-creation-of-zoom-phone-users/81212/2 "2024-01-14T06:26:34Z")

</div>

Closed on January 14, 2024, 6:26am UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
