Sample - GitHub REST API
GET/enterprises/{enterprise}/members/{username}/teams

List enterprise teams for a user

Lists all enterprise teams that a user is a member of. This endpoint is available only for enterprises using the new enterprise teams experience.

The authenticated user must be an enterprise owner or have the enterprise_teams:read permission.

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

4 parameters
enterprisestringrequired
The slug version of the enterprise name.
usernamestringrequired
The handle for the GitHub user account.
per_pageintegeroptional
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:30
pageintegeroptional
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:1

4 status codes
200Response
idintegerrequired
namestringrequired
descriptionstringoptional
slugstringrequired
urlstringrequired
sync_to_organizationsstringoptional
Retired: this field will not be returned with GHEC enterprise teams.
organization_selection_typestringoptional
group_idstringrequired
group_namestringoptional
Retired: this field will not be returned with GHEC enterprise teams.
html_urlstringrequired
members_urlstringrequired
created_atstringrequired
updated_atstringrequired
notification_settingstringoptional
Whether team members will receive notifications when the team is mentioned.
Allowed:notifications_enablednotifications_disabled
401Requires authentication
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Forbidden
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 401 is returned: Requires authentication. A 403 is returned: Forbidden. A 404 is returned: Resource not found.