There is a way to manually do it (https://support.google.com/youtube/answer/4524878?hl=en).
But i want to do it with the help of an api call .
For example :
In google analytics we use the below command to insert user using the google analytics api call for management.
files = analytics.management().accountUserLinks().insert(
accountId = account_id,
body={
'permissions': {
'effective' : ['READ_AND_ANALYZE'],
'local': ['EDIT','MANAGE_USERS']
},
'userRef': {'email': '[email protected]'}
}).execute()