# Assigning phone number to user

**URL:** <https://devforum.zoom.us/t/assigning-phone-number-to-user/82735>\
**Category:** Users and Groups\
**Created:** [February 7, 2023, 7:09pm UTC](https://devforum.zoom.us/t/assigning-phone-number-to-user/82735 "2023-02-07T19:09:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbecirovic](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nbecirovic](https://devforum.zoom.us/u/nbecirovic)\
**Post date:** [February 7, 2023, 7:09pm UTC](https://devforum.zoom.us/t/assigning-phone-number-to-user/82735/1 "2023-02-07T19:09:39Z")

</div>

So far I wrote a script that extracts a free 10 digit number, meaning it’s not assigned and I get it using GET List phone numbers. After that I use GET List phone users to extract user\_id.

From here I’m trying to utilize POST Assign phone number to user to provision that user with the free number. Here is the example of the POST body:

```auto
{
  "phone_numbers": [
    {
      "id": "id1234",
      "number": "+19041234567"
    }
  ]
}

```

And I keep getting this:

```auto
{
    "code": 1001,
    "message": "User does not exist: :userId."
}

```

I’ve verified that user exists and I’m using the ‘id’ key and value from GET List phone users and not sure why I’m getting this message. Please help. This is the last part that I need to get working.

---

<div class="post-metadata">

**Author:** ![nbecirovic](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nbecirovic](https://devforum.zoom.us/u/nbecirovic)\
**Post date:** [February 7, 2023, 7:53pm UTC](https://devforum.zoom.us/t/assigning-phone-number-to-user/82735/2 "2023-02-07T19:53:16Z")

</div>

Figured it out. User ID goes within the actual POST URL:

```auto
{{baseUrl}}/phone/users/id1234/phone_numbers

```

POST body should be:

```auto
{
  "phone_numbers": [
    {
      "id": "phone_id1234",
      "number": "+19041234567"
    }
  ]
}

```
