Server to Server Endpoint request unauthorised

You need to not just read the HTTP Error code, but the Error/body message as well, as that covers what the problem is.

You are not sending a Client-ID Header and this is required