# Error 124 when accessing API using JWT

**URL:** <https://devforum.zoom.us/t/error-124-when-accessing-api-using-jwt/67716>\
**Category:** API and Webhooks\
**Created:** [April 19, 2022, 1:30am UTC](https://devforum.zoom.us/t/error-124-when-accessing-api-using-jwt/67716 "2022-04-19T01:30:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shared.rick.henry](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shared.rick.henry/32/36987_2.png) [@shared.rick.henry](https://devforum.zoom.us/u/shared.rick.henry)\
**Post date:** [April 19, 2022, 1:30am UTC](https://devforum.zoom.us/t/error-124-when-accessing-api-using-jwt/67716/1 "2022-04-19T01:30:18Z")

</div>

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

**Description**  
I am trying to use the Api to add a meeting registrant but getting the error invalid access token 124 when I do so. My JWT token works for many of the Api calls even the ones that it says oAuth on but not for these

batch\_registrants

registrants

The ones that work with JWT so far ive tested are  
/users/  
/meetings  
/groups

Is there any way to use these apis without setting up oAuth?

My end goal is to add and remove registrants via api depending on whether or not they have paid a subscription fee for my website. I have a list of email addresses I want to register but no way currently to add them via the api. Could anyone help here?

Here is some example code that gives me the error

**Error**

```auto
          port: null,
          nativeProtocols: { 'http:': [Object], 'https:': [Object] },
          pathname: '/v2/meetings/89063002983/batch_registrants'
        },
        _ended: true,
        _ending: true,
        _redirectCount: 0,
        _redirects: [],
        _requestBodyLength: 330,
        _requestBodyBuffers: [],
        _onNativeResponse: [Function (anonymous)],
        _currentRequest: [Circular *2],
        _currentUrl: 'https://api.zoom.us/v2/meetings/89063002983/batch_registrants',
        [Symbol(kCapture)]: false
      },
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype] {
        accept: ['Accept', 'application/json, text/plain, */*'],
        'content-type': ['Content-Type', 'application/json'],
        'user-agent': ['User-Agent', 'axios/0.26.1'],
        'content-length': ['Content-Length', 330],
        host: ['Host', 'api.zoom.us']
      }
    },
    data: { code: 124, message: 'Invalid access token.' }
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]

```

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
/batch\_registrants

/registrants

**Screenshots (If applicable)**  
example code (that gives the error

```auto
function addRegisteredUSerToMeeting() {
    const options = {
        headers: { authorization: jwtApiKey },
        body: {
            auto_approve: true,
            registrants: [
                {
                    email: 'test@gmail.com',
                    first_name: 'test',
                    last_name: 'test',
                },
            ],
        },
    };

    axios.post(`https://api.zoom.us/v2/meetings/${testMeeting123}/batch_registrants`, options).then((response: any) => {
        console.log(response.data);
    });
}

addRegisteredUSerToMeeting();

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [April 20, 2022, 6:43pm UTC](https://devforum.zoom.us/t/error-124-when-accessing-api-using-jwt/67716/2 "2022-04-20T18:43:59Z")

</div>

Hi @shared.rick.henry

Thanks for reaching out to the Zoom Developer Forum! I am happy to help here!  
could you please confirm that you have meet the prerequisites for that endpoint:

- The host must be a **Licensed** user type.

Cheers,  
Elisa

---

<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:** [May 21, 2022, 4:44am UTC](https://devforum.zoom.us/t/error-124-when-accessing-api-using-jwt/67716/3 "2022-05-21T04:44:43Z")

</div>

Closed on May 21, 2022, 4:44am UTC

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