# Schedule a zoom meeting via API

**URL:** <https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831>\
**Category:** Meetings\
**Tags:** api\
**Created:** [June 25, 2023, 8:59am UTC](https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831 "2023-06-25T08:59:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![practicereactjswithf](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/practicereactjswithf/32/49737_2.png) [@practicereactjswithf](https://devforum.zoom.us/u/practicereactjswithf)\
**Post date:** [June 25, 2023, 8:59am UTC](https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831/1 "2023-06-25T08:59:28Z")

</div>

I am using [Zoom Meeting API](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingCreate) to create a react based web app in which I need to schedule zoom meeting but while testing my endpoint on postman it shows  
{  
“code”: 124,  
“message”: “Invalid access token.”  
}  
and can anyone provide me correct header snippet for the api call and I have 3 credentials in my Server-To-Server OAuth app which are Account Id, Client Id, Client secret, so which one should be used for auth token.

---

<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:** [June 26, 2023, 8:33pm UTC](https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831/2 "2023-06-26T20:33:14Z")

</div>

Hi @practicereactjswithf  
Thanks for reaching out to the Zoon Developer Forum and welcome to our community!  
Can you please share with me how you are making your request so I can take a look at it  
Also, make sure that your Server to Server oauth app has the right scopes added to it so you can reach that endpoint

---

<div class="post-metadata">

**Author:** ![practicereactjswithf](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/practicereactjswithf/32/49737_2.png) [@practicereactjswithf](https://devforum.zoom.us/u/practicereactjswithf)\
**Post date:** [June 28, 2023, 10:53am UTC](https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831/3 "2023-06-28T10:53:59Z")

</div>

import axios from ‘axios’;  
import { NextResponse } from “next/server”;

export async function POST(  
request: Request  
) {  
const body = await request.json();  
const {  
startTime,  
endTime  
} = body;

const userId = ‘practicereactjswithfirebase@gmail.com’; // Replace with the actual user ID or email

const meeting = {  
topic: ‘My Meeting’,  
start\_time: new Date(startTime).toISOString(),  
end\_time: new Date(endTime).toISOString(),  
type: 2,  
settings: {  
join\_before\_host: true,  
approval\_type: 0,  
audio: ‘telephony’,  
meeting\_authentication: true,  
},  
};

try {  
const response = await axios.post(  
`https://api.zoom.us/users/${userId}/meetings`,  
meeting,  
{  
headers: {  
‘Content-Type’: ‘application/json’,  
‘Authorization’: ‘Bearer CDQ1xWNcRJCm9Od6RxNpEg’,

```
    },
  }
);

```

NextResponse.json(response);

} catch (error) {  
console.log(error);

return NextResponse.json(error);

}

}

---

<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:** [June 28, 2023, 2:48pm UTC](https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831/4 "2023-06-28T14:48:28Z")

</div>

Thanks for sharing this, but I was talking about the request to get your access token @practicereactjswithf  
Could you share that with me please

---

<div class="post-metadata">

**Author:** ![practicereactjswithf](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/practicereactjswithf/32/49737_2.png) [@practicereactjswithf](https://devforum.zoom.us/u/practicereactjswithf)\
**Post date:** [June 28, 2023, 6:04pm UTC](https://devforum.zoom.us/t/schedule-a-zoom-meeting-via-api/90831/5 "2023-06-28T18:04:04Z")

</div>

Actually was not using any access token here because I haven’t went through [Using Zoom APIs](https://developers.zoom.us/docs/api/rest/using-zoom-apis/) . I was directly using [Zoom Meeting API](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingCreate) to create meeting link, so now it is working fine.  
Thnaks.
