{"meta":{"title":"Конечные точки REST API для членства в группах предприятия","intro":"Используйте REST API для создания и управления членством корпоративных команд в вашем GitHub предприятии.","product":"REST API","breadcrumbs":[{"href":"/ru/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/ru/enterprise-cloud@latest/rest/enterprise-teams","title":"Корпоративные функции команд"},{"href":"/ru/enterprise-cloud@latest/rest/enterprise-teams/enterprise-team-members","title":"Участники группы enterprise"}],"documentType":"article"},"body":"# Конечные точки REST API для членства в группах предприятия\n\nИспользуйте REST API для создания и управления членством корпоративных команд в вашем GitHub предприятии.\n\n## Сведения о членах группы предприятия\n\nЭти конечные точки доступны только аутентифицированным членам корпоративной команды с классическим personal access tokens диапазоном `read:enterprise`[API](/ru/enterprise-cloud@latest/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)`GET` и `admin:enterprise` других API.\n\nЭти конечные точки несовместимы с токенами доступа fine-grained personal access tokens или GitHub App.\n\nGitHub генерирует корпоративные команды `slug` из команды `name` и добавляет `ent:` префикс.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List enterprise teams for a user\n\n```\nGET /enterprises/{enterprise}/members/{username}/teams\n```\n\nLists all enterprise teams that a user is a member of. This endpoint is available only for\nenterprises using the new enterprise teams experience.\nThe authenticated user must be an enterprise owner or have the enterprise\\_teams:read permission.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/members/USERNAME/teams\n```\n\n**Response schema (Status: 200):**\n\nArray of `Enterprise Team`:\n\n* `id`: required, integer, format: int64\n* `name`: required, string\n* `description`: string\n* `slug`: required, string\n* `url`: required, string, format: uri\n* `sync_to_organizations`: string\n* `organization_selection_type`: string\n* `group_id`: required, string or null\n* `group_name`: string or null\n* `html_url`: required, string, format: uri\n* `members_url`: required, string\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `notification_setting`: string, enum: `notifications_enabled`, `notifications_disabled`\n\n## List members in an enterprise team\n\n```\nGET /enterprises/{enterprise}/teams/{enterprise-team}/memberships\n```\n\nLists all team members in an enterprise team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`enterprise-team`** (string) (required)\n  The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships\n```\n\n**Response schema (Status: 200):**\n\nArray of `Simple User`:\n\n* `name`: string or null\n* `email`: string or null\n* `login`: required, string\n* `id`: required, integer, format: int64\n* `node_id`: required, string\n* `avatar_url`: required, string, format: uri\n* `gravatar_id`: required, string or null\n* `url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `followers_url`: required, string, format: uri\n* `following_url`: required, string\n* `gists_url`: required, string\n* `starred_url`: required, string\n* `subscriptions_url`: required, string, format: uri\n* `organizations_url`: required, string, format: uri\n* `repos_url`: required, string, format: uri\n* `events_url`: required, string\n* `received_events_url`: required, string, format: uri\n* `type`: required, string\n* `site_admin`: required, boolean\n* `starred_at`: string\n* `user_view_type`: string\n\n## Bulk add team members\n\n```\nPOST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add\n```\n\nAdd multiple team members to an enterprise team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`enterprise-team`** (string) (required)\n  The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.\n\n#### Body parameters\n\n* **`usernames`** (array of strings) (required)\n  The GitHub user handles to add to the team.\n\n### HTTP response status codes\n\n* **200** - Successfully added team members.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/add \\\n  -d '{\n  \"usernames\": [\n    \"monalisa\",\n    \"octocat\"\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List members in an enterprise team](#list-members-in-an-enterprise-team).\n\n## Bulk remove team members\n\n```\nPOST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove\n```\n\nRemove multiple team members from an enterprise team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`enterprise-team`** (string) (required)\n  The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.\n\n#### Body parameters\n\n* **`usernames`** (array of strings) (required)\n  The GitHub user handles to be removed from the team.\n\n### HTTP response status codes\n\n* **200** - Successfully removed team members.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/remove \\\n  -d '{\n  \"usernames\": [\n    \"monalisa\",\n    \"octocat\"\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List members in an enterprise team](#list-members-in-an-enterprise-team).\n\n## Get enterprise team membership\n\n```\nGET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\n```\n\nReturns whether the user is a member of the enterprise team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`enterprise-team`** (string) (required)\n  The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **200** - User is a member of the enterprise team.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/USERNAME\n```\n\n**Response schema (Status: 200):**\n\n* `name`: string or null\n* `email`: string or null\n* `login`: required, string\n* `id`: required, integer, format: int64\n* `node_id`: required, string\n* `avatar_url`: required, string, format: uri\n* `gravatar_id`: required, string or null\n* `url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `followers_url`: required, string, format: uri\n* `following_url`: required, string\n* `gists_url`: required, string\n* `starred_url`: required, string\n* `subscriptions_url`: required, string, format: uri\n* `organizations_url`: required, string, format: uri\n* `repos_url`: required, string, format: uri\n* `events_url`: required, string\n* `received_events_url`: required, string, format: uri\n* `type`: required, string\n* `site_admin`: required, boolean\n* `starred_at`: string\n* `user_view_type`: string\n\n## Add team member\n\n```\nPUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\n```\n\nAdd a team member to an enterprise team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`enterprise-team`** (string) (required)\n  The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **201** - Successfully added team member\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/USERNAME\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Get enterprise team membership](#get-enterprise-team-membership).\n\n## Remove team membership\n\n```\nDELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\n```\n\nRemove membership of a specific user from a particular team in an enterprise.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`enterprise-team`** (string) (required)\n  The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/memberships/USERNAME\n```\n\n**Response schema (Status: 204):**"}