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
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -206,3 +206,32 @@ The following filters are supported:
206
206
-`created_before` and `created_after` - The time a user was created. Uses the
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
+
210
+
## Use the Coder API to retrieve a list of users
211
+
212
+
Use the [Coder API](../../reference/api/users.md#get-users) to retrieve a full list of users on your Coder deployment:
213
+
214
+
```shell
215
+
curl -X GET http://coder-server:8080/api/v2/users \
216
+
-H 'Accept: application/json' \
217
+
-H 'Coder-Session-Token: API_KEY'
218
+
```
219
+
220
+
You can also filter your results based on the `organization_id` with:
221
+
222
+
```shell
223
+
curl -X GET 'http://coder-server:8080/api/v2/users?organization_id=Example-Org' \
224
+
-H 'Accept: application/json' \
225
+
-H 'Coder-Session-Token: API_KEY'
226
+
```
227
+
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:
231
+
232
+
```shell
233
+
curl -X GET http://coder-server:8080/api/v2/users \
0 commit comments