|
| 1 | +--- |
| 2 | +title: User Management Commands |
| 3 | +layout: en_enterprise |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +Travis CI Enterprise (TCIE) offers a new tab for admin users utilizing `admin-v2`, the **User Activity** tab, where admin users can see `active` or `inactive` users and suspend or unsuspend specific users. |
| 8 | + |
| 9 | +> Note: An `active` user is a user who utilizes the system and not necessarily a user consuming a license. |
| 10 | +
|
| 11 | +This section describes how to obtain and use an Organizational-level token. |
| 12 | + |
| 13 | +## Obtain Organization-level token |
| 14 | + |
| 15 | +A new token authorization method was introduced in Travis API **org.token**. An organization-level access token that grants permissions to perform platform-level administrative commands via APIs. |
| 16 | + |
| 17 | +Travis CI Enterprise platform admin users require a list of active and inactive user accounts to make informed decisions about whether to suspend accounts. TCIE admin users can now obtain and regenerate organization-level tokens (OTP secured). Each token has a predefined permission. Currently, there are two possible usages for Organization-level tokens: checking user activity and suspending or unsuspending users in the organization. |
| 18 | + |
| 19 | +Navigate to the API Tokens section at the bottom of the Travis admin V2 Organization page. Under the Organization tab, scroll down to the **API** section. |
| 20 | + |
| 21 | +This section displays the API key of the Organization. |
| 22 | +Click the “Copy” button to copy the token. |
| 23 | +Click the “Re-generate” button to generate a new token. |
| 24 | + |
| 25 | +The token is hidden by default, and by clicking the **View** button, the token is displayed. |
| 26 | + |
| 27 | +> Note: This section is for admin users only. |
| 28 | +
|
| 29 | +## How to use Organization-level tokens |
| 30 | + |
| 31 | +Users can now use the following new API endpoint: |
| 32 | +``` |
| 33 | +/org/:id/user_activity |
| 34 | +``` |
| 35 | + |
| 36 | +Here is an example of using the command for looking for active users since Feb. 21st, 2025: |
| 37 | +``` |
| 38 | +curl -L -v -s -k -X GET \ |
| 39 | + -H "Content-Type: application/json" \ |
| 40 | + -H "Accept: application/json" \ |
| 41 | + -H "Travis-API-Version: 3" \ |
| 42 | + -H "Authorization: org.token <organization id in admin-v2>:<paste your org.token here>" \ |
| 43 | + "https://[instance]/org/:[org id]/user_activity?date=2025-02-21&status=active" |
| 44 | +``` |
| 45 | + |
| 46 | +Using a GET request allows users to retrieve a list of active and inactive users for a specified time between the current date and any specified date. |
| 47 | + |
| 48 | +The status parameter accepts the `active` or `inactive` values. And enter the `date` param using the `yyyy-mm-dd` format. |
| 49 | + |
| 50 | +## Suspending and Unsuspending Users |
| 51 | + |
| 52 | +The following new endpoints were introduced and can be used to suspend or unsuspend users. |
| 53 | + |
| 54 | +``` |
| 55 | +/org/:id/suspend |
| 56 | +/org/:id/unsuspend |
| 57 | +/users/suspend |
| 58 | +/users/unsuspend` |
| 59 | +``` |
| 60 | +To suspend users based on their Travis CI ID, use the following: |
| 61 | +``` |
| 62 | +{ "user_ids" : [1,2...]} |
| 63 | +``` |
| 64 | + |
| 65 | +To suspend users based on their VCS TYPE and ID, use the following: |
| 66 | +``` |
| 67 | +{ "vcs_type":"github", "vcs_ids": [100,101..]} |
| 68 | +``` |
| 69 | + |
| 70 | +### Bulk Suspension |
| 71 | +Travis CIE admin users can bulk suspend users via API or CLI by providing a list of users with their VCS IDs. |
| 72 | + |
| 73 | + |
| 74 | +## User Activity |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +The new **User Activity** tab, available from the top bar, was introduced to Travis CI Enterprise, allowing admin users to manage Enterprise users within the organization. |
| 79 | + |
| 80 | +In this section, you can obtain a CSV file containing a list of active and inactive users for a specified date. Simply, enter a `Date From` to generate a list of Active and Inactive users. |
| 81 | + |
| 82 | +## Suspend Users |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +With the list you generated, you can select a subset of users for suspension by uploading a CSV file containing only the users you want to suspend. |
| 87 | + |
| 88 | +Once the file is uploaded, you can suspend all users from the uploaded file. |
| 89 | + |
| 90 | +Use the **Suspend** button to suspend any user from the list. |
| 91 | + |
| 92 | +You can also unsuspend users by viewing the Suspend users list and clicking the **Unsuspend** button. |
| 93 | + |
| 94 | +> Note: The old Enterprise Users page is now a section of the new User Activity page. |
| 95 | +
|
| 96 | +## Contact Enterprise Support |
| 97 | + |
| 98 | +{{ site.data.snippets.contact_enterprise_support }} |
0 commit comments