Sample - GitHub REST API
PUT/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}

Add a team member

Adds one GitHub user to an enterprise team. Supply enterprise, enterprise-team, and username to identify the enterprise, team, and user account.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
enterprisestringrequired
The enterprise slug.
enterprise-teamstringrequired
The enterprise team slug, or the enterprise team ID.
usernamestringrequired
The handle for the GitHub user account to add.

1 status code
201Returns the GitHub user object for the team member added.
namestringoptional
emailstringoptional
loginstringrequired
idintegerrequired
node_idstringrequired
avatar_urlstringrequired
gravatar_idstringrequired
urlstringrequired
html_urlstringrequired
followers_urlstringrequired
following_urlstringrequired
gists_urlstringrequired
starred_urlstringrequired
subscriptions_urlstringrequired
organizations_urlstringrequired
repos_urlstringrequired
events_urlstringrequired
received_events_urlstringrequired
typestringrequired
site_adminbooleanrequired
starred_atstringoptional
user_view_typestringoptional

Error handling

enterprise, enterprise-team, and username must be strings identifying the target enterprise, team, and GitHub user account. enterprise-team may contain either the team's slug or its ID.