List users with the REST API
This use case scenario provides the Identity REST API requests for listing users. These requests apply to both user accounts and API service accounts.
Send the following request to list all users:
http --auth-type=veracode_hmac GET "https://api.veracode.com/api/authn/v2/users"
By default, the output results show up to 20 users per page. To page through the list, you can resend the request with ?page=1
, ?page=2
, and so on, appended to the end.
Send the following request to increase the page size from the maximum of 20
and list more users in the output Results:
http --auth-type=veracode_hmac GET "https://api.veracode.com/api/authn/v2/users?page={page number}&size={page size}"
For example, set page=0&size=50
to increase the size of page 0
to 50
.
Send the following request to list only users whose accounts are enabled:
http --auth-type=veracode_hmac GET "https://api.veracode.com/api/authn/v2/users?enabled=true"
You can set enabled=false
to list only users whose accounts are disabled.