Skip to main content

Get a list of users

Retrieve a list of active users in your account. Only confirmed and active accounts will be included.

Request​

Endpoint​

GET https://api.woodpecker.co/rest/v2/users

Headers​

x-api-key: {YOUR_API_KEY}

For details on how to authenticate your requests, please see the authentication guide.

Parameters​

By default, the results are sorted by content[].id ascending. You can change the order by using the sort parameter.

KeyValueRequiredDescription
sort+id/-idNoSort the results by content[].id. Use - for descending and + for ascending
pageintegerNoRequested results page (0-based)

Request samples​

Retrieve newest users​

curl --request GET \
--url "https://api.woodpecker.co/rest/v2/users?page=0&sort=-id" \
--header "x-api-key: {YOUR_API_KEY}"

Response​

Response examples​

{
"content": [
{
"id": 1234,
"name": "Michael Scott",
"email": "michael@dundermifflin.com",
"role": "admin"
},
{
"id": 1235,
"name": "Jim Halpert",
"email": "jimothy@dundermifflin.com",
"role": "user"
}
],
"pagination_data": {
"total_elements": 2,
"total_pages": 1,
"current_page_number": 1,
"page_size": 50
}
}

Body schema​

FieldTypeDescription
contentarray[object]List of users in the account
└─[].idintegerUnique identifier of the user
└─[].namestringFull name of the user
└─[].emailstringEmail address of the user
└─[].rolestringUser's role in the account (admin or user)
pagination_dataobjectPagination information. See the pagination section

Pagination​

The response body contains pagination details. It will support you in navigating through larger datasets.

Each request returns 50 users. Use page parameter to view a specific page.

info

Page parameter is 0-based. Use page=0 to retrieve the first one. pagination_data.current_page_number is 1-based.

"pagination_data": {
"total_elements": 80,
"total_pages": 2,
"current_page_number": 1,
"page_size": 50
}
FieldTypeDescription
pagination_dataobjectPagination information
└─total_elementsintegerTotal number of users
└─total_pagesintegerTotal number of available pages
└─current_page_numberintegerCurrent page number (1-based)
└─page_sizeintegerMaximum number of items per page