Unable to call API using custom method

Hi All,

I am using ubuntu 20.04 and installed erpnext v13. everything was working fine but recently I created a new python file inside my custom app folder, from there I try to call the inbuilt erpnext api to add an employee, used token for authorization. I am getting frappe.exception.permission error, please can anyone help. below is the brief details

Scenario: When a field in custom doctype changes I should add an employee record using the data of custom doctype. to achieve I used webhook which calls custom method to receive and process the data from custom doctype and then add it into employee doctype.

here is the code to call the employee api

             header = {'Authorization': tokenSend} //receiving token from JSON body of webhook request.
	url=str(frappe.utils.get_url()).strip()+"/api/resource/Employee"	
	r=requests.post(url,headers=header, data=json.dumps(doc))

Getting frappe.exception.permission on running this, to check I ran the same employee API with postman and request was successful.

Please suggest.

Thanks!!