Problems with the roblox group api

So I’m trying to get join requests of a group using the roblox group api in javascript
I’m using this request:

let res = await fetch(`https://groups.roblox.com/v1/groups/14142592/join-requests?sortOrder=Asc&limit=10`, {
                method: "GET",
                headers: {
                    'Cookie': '.ROBLOSECURITY=${roblox security token here}'
                }
            })
            console.log(res)

But I keep getting the status code 401 0 with the text being unauthorized, can someone explain to me why it isn’t working

Pretty sure the cookie is not enough. Your request needs a X-CSRF-Token as well. Here’s an in-depth explanation; Accessing the Roblox API - the comprehensive tutorial

Also note that the cookie will become invalid at every IP change. So if you use Replit you can’t really authentificate.