How can we add the udid of a device to the provisioning profile using apple store connect api?

Trying to connect with the api,https://api.appstoreconnect.apple.com/v1/profiles/{profile_id} with method as patch and request body as { 'data': { 'relationships': { 'devices': { 'data': [ { 'type': 'devices', 'id':device_id } ] } } } }

it shows 403 error and couldn't find the issue with it.The api key and the auth key file used for generating the jwt token is provided with admin access to all.Through this api we can fetch the details but can't add the device.Please suggest a solution to resolve the issue.