You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin/users/index.md
+22-12Lines changed: 22 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -207,31 +207,41 @@ The following filters are supported:
207
207
RFC3339Nano format.
208
208
-`login_type` - Represents the login type of the user. Refer to the [LoginType documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#LoginType) for a list of supported values
209
209
210
-
## Use the Coder API to retrieve a list of users
210
+
## Retrieve your list of Coder users
211
211
212
-
Use the [Coder API](../../reference/api/users.md#get-users) to retrieve a full list of users on your Coder deployment:
212
+
<divclass="tabs">
213
+
214
+
You can use the Coder CLI or API to retrieve your list of users.
215
+
216
+
### CLI
217
+
218
+
Use `users list` to export the list of users to a CSV file:
213
219
214
220
```shell
215
-
curl -X GET http://coder-server:8080/api/v2/users \
216
-
-H 'Accept: application/json' \
217
-
-H 'Coder-Session-Token: API_KEY'
221
+
coder users list > users.csv
218
222
```
219
223
220
-
You can also filter your results based on the `organization_id` with:
224
+
Visit the [users list](../../reference/cli/users_list.md) documentation for more options.
221
225
222
-
```shell
223
-
curl -X GET 'http://coder-server:8080/api/v2/users?organization_id=Example-Org' \
226
+
### API
227
+
228
+
Use [get users](../../reference/api/users.md#get-users):
229
+
230
+
```bash
231
+
curl -X GET http://coder-server:8080/api/v2/users \
224
232
-H 'Accept: application/json' \
225
233
-H 'Coder-Session-Token: API_KEY'
226
234
```
227
235
228
-
### Export a list of users to a CSV file
229
-
230
-
You can use [jq](https://jqlang.org/) to process the JSON response and export the results to a CSV file:
236
+
To export the results to a CSV file, you can use [jq](https://jqlang.org/) to process the JSON response:
231
237
232
-
```shell
238
+
```bash
233
239
curl -X GET http://coder-server:8080/api/v2/users \
0 commit comments