正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

グループエンタープライズユーザーAPI

  • プラン: Premium、Ultimate
  • 提供形態: GitLab.com

これらのAPIエンドポイントを使用して、エンタープライズユーザーアカウントを操作します。詳細については、エンタープライズユーザーを参照してください。

これらのAPIエンドポイントは、トップレベルグループでのみ機能します。ユーザーはグループのメンバーである必要はありません。

前提要件:

  • トップレベルグループのオーナーロールを持っている必要があります。

すべてのエンタープライズユーザーをリストする

指定されたトップレベルグループのすべてのエンタープライズユーザーをリストします。

結果をフィルタリングするには、pageおよびper_page ページネーションパラメータを使用します。

GET /groups/:id/enterprise_users

サポートされている属性は以下のとおりです:

属性必須説明
id整数または文字列はいトップレベルグループのIDまたはURLエンコードされたパス
username文字列いいえ指定されたユーザー名のユーザーを返します。
search文字列いいえ一致する名前、メール、またはユーザー名を持つユーザーを返します。部分的な値を使用すると、結果が増えます。
activeブール値いいえアクティブユーザーのみを返します。
blockedブール値いいえブロックされたユーザーのみを返します。
created_after日時いいえ指定された時刻以降に作成されたユーザーを返します。形式は、: ISO 8601(YYYY-MM-DDTHH:MM:SSZ)です。
created_before日時いいえ指定された時刻よりも前に作成されたユーザーを返します。形式は、: ISO 8601(YYYY-MM-DDTHH:MM:SSZ)です。
two_factor文字列いいえ2要素認証(2FA)の登録ステータスに基づいてユーザーを返します。使用可能な値:enableddisabled

リクエスト例:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/enterprise_users"

レスポンス例:

[
  {
    "id": 66,
    "username": "user22",
    "name": "Sidney Jones22",
    "state": "active",
    "avatar_url": "https://www.gravatar.com/avatar/xxx?s=80&d=identicon",
    "web_url": "http://my.gitlab.com/user22",
    "created_at": "2021-09-10T12:48:22.381Z",
    "bio": "",
    "location": null,
    "public_email": "",
    "linkedin": "",
    "twitter": "",
    "website_url": "",
    "organization": null,
    "job_title": "",
    "pronouns": null,
    "bot": false,
    "work_information": null,
    "followers": 0,
    "following": 0,
    "local_time": null,
    "last_sign_in_at": null,
    "confirmed_at": "2021-09-10T12:48:22.330Z",
    "last_activity_on": null,
    "email": "user22@example.org",
    "theme_id": 1,
    "color_scheme_id": 1,
    "projects_limit": 100000,
    "current_sign_in_at": null,
    "identities": [
      {
        "provider": "group_saml",
        "extern_uid": "2435223452345",
        "saml_provider_id": 1
      }
    ],
    "can_create_group": true,
    "can_create_project": true,
    "two_factor_enabled": false,
    "external": false,
    "private_profile": false,
    "commit_email": "user22@example.org",
    "shared_runners_minutes_limit": null,
    "extra_shared_runners_minutes_limit": null,
    "scim_identities": [
      {
        "extern_uid": "2435223452345",
        "group_id": 1,
        "active": true
      }
    ]
  },
  ...
]

エンタープライズユーザーの詳細を取得

指定されたエンタープライズユーザーの詳細を取得します。

GET /groups/:id/enterprise_users/:user_id

サポートされている属性は以下のとおりです:

属性必須説明
id整数または文字列はいトップレベルグループのIDまたはURLエンコードされたパス
user_id整数はいユーザーアカウントのID。

リクエスト例:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/enterprise_users/:user_id"

レスポンス例:

{
  "id": 66,
  "username": "user22",
  "name": "Sidney Jones22",
  "state": "active",
  "avatar_url": "https://www.gravatar.com/avatar/xxx?s=80&d=identicon",
  "web_url": "http://my.gitlab.com/user22",
  "created_at": "2021-09-10T12:48:22.381Z",
  "bio": "",
  "location": null,
  "public_email": "",
  "linkedin": "",
  "twitter": "",
  "website_url": "",
  "organization": null,
  "job_title": "",
  "pronouns": null,
  "bot": false,
  "work_information": null,
  "followers": 0,
  "following": 0,
  "local_time": null,
  "last_sign_in_at": null,
  "confirmed_at": "2021-09-10T12:48:22.330Z",
  "last_activity_on": null,
  "email": "user22@example.org",
  "theme_id": 1,
  "color_scheme_id": 1,
  "projects_limit": 100000,
  "current_sign_in_at": null,
  "identities": [
    {
      "provider": "group_saml",
      "extern_uid": "2435223452345",
      "saml_provider_id": 1
    }
  ],
  "can_create_group": true,
  "can_create_project": true,
  "two_factor_enabled": false,
  "external": false,
  "private_profile": false,
  "commit_email": "user22@example.org",
  "shared_runners_minutes_limit": null,
  "extra_shared_runners_minutes_limit": null,
  "scim_identities": [
    {
      "extern_uid": "2435223452345",
      "group_id": 1,
      "active": true
    }
  ]
}

エンタープライズユーザーを修正する

指定されたエンタープライズユーザーの属性を更新します。

PATCH /groups/:id/enterprise_users/:user_id

サポートされている属性は以下のとおりです:

属性必須説明
id整数または文字列はいトップレベルグループのIDまたはURLエンコードされたパス
user_id整数はいユーザーアカウントのID。
name文字列いいえユーザーアカウントの名前。
email文字列いいえユーザーアカウントのメールアドレス。確認済みのグループドメインからのものでなければなりません。

リクエスト例:

curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" --data "email=new-email@example.com" --data "name=New name" "https://gitlab.example.com/api/v4/groups/:id/enterprise_users/:user_id"

成功した場合、200 OKを返します。

成功したレスポンスの例:

{
  "id": 66,
  "username": "user22",
  "name": "New name",
  "state": "active",
  "avatar_url": "https://www.gravatar.com/avatar/xxx?s=80&d=identicon",
  "web_url": "http://my.gitlab.com/user22",
  "created_at": "2021-09-10T12:48:22.381Z",
  "bio": "",
  "location": null,
  "public_email": "",
  "linkedin": "",
  "twitter": "",
  "website_url": "",
  "organization": null,
  "job_title": "",
  "pronouns": null,
  "bot": false,
  "work_information": null,
  "followers": 0,
  "following": 0,
  "local_time": null,
  "last_sign_in_at": null,
  "confirmed_at": "2021-09-10T12:48:22.330Z",
  "last_activity_on": null,
  "email": "new-email@example.com",
  "theme_id": 1,
  "color_scheme_id": 1,
  "projects_limit": 100000,
  "current_sign_in_at": null,
  "identities": [
    {
      "provider": "group_saml",
      "extern_uid": "2435223452345",
      "saml_provider_id": 1
    }
  ],
  "can_create_group": true,
  "can_create_project": true,
  "two_factor_enabled": false,
  "external": false,
  "private_profile": false,
  "commit_email": "user22@example.org",
  "shared_runners_minutes_limit": null,
  "extra_shared_runners_minutes_limit": null,
  "scim_identities": [
    {
      "extern_uid": "2435223452345",
      "group_id": 1,
      "active": true
    }
  ]
}

その他の発生しうる応答:

  • 400 Bad Request: 検証エラー。
  • 403 Forbidden: 認証済みのユーザーはオーナーではありません。
  • 404 Not found: ユーザーが見つかりません。

エンタープライズユーザーを削除する

指定されたエンタープライズユーザーを削除します。

DELETE /groups/:id/enterprise_users/:user_id

サポートされている属性は以下のとおりです:

属性必須説明
id整数または文字列はいトップレベルグループのIDまたはURLエンコードされたパス
user_id整数はいユーザーアカウントのID。
hard_deleteブール値いいえfalseの場合、ユーザーを削除し、コントリビューションをシステム全体の「Ghostユーザー」に移動します。trueの場合、ユーザー、関連するコントリビューション、およびユーザーのみがオーナーになっているグループを削除します。デフォルト値: false

リクエスト例:

curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/enterprise_users/:user_id"

成功した場合、204 No contentを返します。

その他の発生しうる応答:

  • 403 Forbidden: 認証済みのユーザーはオーナーではありません。
  • 404 Not found: ユーザーが見つかりません。
  • 409 Conflict: グループの唯一のオーナーであるユーザーは削除できません。

エンタープライズユーザーの2要素認証を無効にする

指定されたエンタープライズユーザーの2要素認証(2FA)を無効にします。

PATCH /groups/:id/enterprise_users/:user_id/disable_two_factor

サポートされている属性は以下のとおりです:

属性必須説明
id整数または文字列はいトップレベルグループのIDまたはURLエンコードされたパス
user_id整数はいユーザーアカウントのID。

リクエスト例:

curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/enterprise_users/:user_id/disable_two_factor"

成功した場合、204 No contentを返します。

その他の発生しうる応答:

  • 400 Bad request: 指定されたユーザーに対して2FAが有効になっていません。
  • 403 Forbidden: 認証済みのユーザーはオーナーではありません。
  • 404 Not found: ユーザーが見つかりません。