I am attempting to update a repository's team permissions through the Github API, similar to this question. However, despite having receiving a 204 response, the permission does not get updated. I have full admin access over the repo and the team. I am following the documentation here.
Code snippet in Python:
headers = {'Authorization': f'token {token}'}
parameters = {'permission': 'push'}
response = requests.put(f'https://api.github.com/teams/{team_id}/repos/{org}/{name}', headers=headers, params=parameters)
I have also tried with the key pair 'permission': 'write'
because that is one of the five permission options that appears on the repo's collaborators page, but both receive a 204 response and do not actually update the permission.
I'm doing this on a large scale for a number of repos, so I need to be able to change the permissions programmatically for each repo based on the team. I cannot tell if this is an API issue or if my code is incorrect. Thank you!