# Invalid access token despite updated JWT token

**URL:** <https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333>\
**Category:** API and Webhooks\
**Created:** [October 25, 2021, 12:11pm UTC](https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333 "2021-10-25T12:11:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![huetherb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/huetherb/32/1758_2.png) [@huetherb](https://devforum.zoom.us/u/huetherb)\
**Post date:** [October 25, 2021, 12:11pm UTC](https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333/1 "2021-10-25T12:11:31Z")

</div>

## Using this template helps us debug your issues more effectively 🙂

**Description**  
Hi, I am using the Zoom API to create and update meetings. I just tested creation and it worked fine. But when updating, I am getting error.

**Error**  
The error, as seen in the curl response is

{“code”:124,“message”:“Invalid access token.”}

Here is my code in PHP:

```
    $url = "https://api.zoom.us/v2/accounts/myid/meetings/".$zoomid;
    $httpmethod = "PATCH";

    $data = array(
        "topic" => $ptitle,
        "type" => 2,
        "start_time" => $starttime,
        "timezone" => 'America/New_York',
        "duration" => 90,
        "password" => null,
        "agenda" => $agenda,
        "settings" => array(
            "host_video" => true,
            "participants_video" => false,
            "join_before_host" => true,
            "mute_upon_entry" => false,
            "watermark" => true,
            "approval_type" => 2,
            "audio" => 'both',
            "auto_recording" => 'none',
            "enforce_login" => false,
            "enforce_login_domains" => null,
            "alternative_hosts" => null
        )
    );

    $data_string = json_encode($data);

    curl_setopt_array($curl, array(
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => $httpmethod,
        CURLOPT_POSTFIELDS => $data_string,
        CURLOPT_HTTPHEADER => array(
            "authorization: Bearer theJWTtoken",
            "content-type: application/json"
        ),
    ));

    $response = curl_exec($curl);

```

The PHP vars above are valid, and what I show above as theJWTtoken is the token that I see at [App Marketplace](https://marketplace.zoom.us/develop/apps) under credentials. Also ‘myid’ shown above in the API url is my valid account id.

Just can’t figure out what might be going on. Ideas?

---

<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 27, 2021, 12:19pm UTC](https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333/2 "2021-10-27T12:19:44Z")

</div>

Hey @huetherb,

Thanks for reaching out. Can you confirm which field(s) you’re trying to update? Have you tried passing only these fields, and removing any fields you’re not updating/are passing null values for?

Let me know—thanks!  
Will

---

<div class="post-metadata">

**Author:** ![huetherb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/huetherb/32/1758_2.png) [@huetherb](https://devforum.zoom.us/u/huetherb)\
**Post date:** [November 7, 2021, 3:18pm UTC](https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333/3 "2021-11-07T15:18:53Z")

</div>

Hi, not sure what was going on, but now all is well!

---

<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:** [November 9, 2021, 11:03am UTC](https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333/4 "2021-11-09T11:03:10Z")

</div>

Glad to hear it! 🙂

Best,  
Will

---

<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:** [November 9, 2021, 11:03am UTC](https://devforum.zoom.us/t/invalid-access-token-despite-updated-jwt-token/59333/5 "2021-11-09T11:03:17Z")

</div>

Closed on November 9, 2021, 11:03am UTC


