Thanks for reaching here! If I have understood right you are using Azure notification hub and wants to register devices with notification hubs in order to receive push notifications.
For details on Registration management refer to below detail link document:
To create a new registration, There is POST method which generates a registration ID, which you can subsequently use to retrieve, update, and delete this registration:
https://learn.microsoft.com/en-us/rest/api/notificationhubs/create-registration
If you are receiving response code 401 this means Authorization failure and the access key was incorrect or not present.
From Azure Portal:
Further to elaborate to access these APIs the first thing is to generate the SAS Token, used as Authorization Header.
The Authorization Header should consist of Token generated as specified in SAS Authentication and authorization with Microsoft Azure Active Directory Access Control.
You may refer to this guide to generate SAS tokens using multiple programming languages for using Azure Service Bus REST APIs
Further check these below articles for more details on How to use the Notification Hubs REST Interface.