org_id
and team_id
using the route PUT /organizations/{org_id}/team/{team_id}/memberships/{username}
.curl --location --request PUT 'https://api.github.com/orgs//teams//memberships/' \
--header 'Content-Type: application/json' \
--data-raw '{
"role": "maintainer"
}'
{
"role": "member",
"state": "active",
"url": "http://example.com"
}