Skip to main content

Get a list of company users

Retrieve details of users under a specific company, including their ID, name, email, roles, and guest permissions.

Request

Endpoint

GET https://api.woodpecker.co/rest/v2/agency/companies/{company_id}/users

Headers

x-api-key: {YOUR_API_KEY}

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

Parameters

ParameterRequiredTypeDescription
company_idYesintegerPath parameter - the ID of the company for which the users will be returned
pageNointegerRequested results page (1-based)
roleNostringFilter by user role: admin, owner, guest, authorized_team_member

Request sample

Get a list of company users

curl --request GET \
--url "https://api.woodpecker.co/rest/v2/agency/companies/{company_id}/users" \
--header "x-api-key: {YOUR_API_KEY}"

Response

Response examples

A list of company users

{
"content": [
{
"id": 1234,
"name": "Michael Scott",
"email": "michael@dundermifflin.com",
"roles": ["admin"],
"guest_permissions": []
},
{
"id": 1235,
"name": "Jim Halpert",
"email": "jimothy@dundermifflin.com",
"roles": ["admin", "owner"],
"guest_permissions": []
},
{
"id": 1236,
"name": "Bob Vance",
"email": "bob.vance@vancerefrigeration.com",
"roles": ["guest"],
"guest_permissions": ["mailboxes"]
},
{
"id": 1237,
"name": "Pam Beesly",
"email": "pam@dundermifflin.com",
"roles": ["authorized_team_member"],
"guest_permissions": []
}
],
"pagination_data": {
"total_elements": 4,
"total_pages": 1,
"current_page_number": 1,
"page_size": 50
}
}

Body schema

FieldTypeDescription
contentarray[object]List of all users with access to the specific company
└─idintegerUnique user ID
└─namestringUser's full name
└─emailstringUser's email
└─rolesarray[string]List of roles assigned to a user. More about roles here
  • admin - set of permission that may be applied on the agency-level. Has full access to all companies
  • owner - has the same permissions as an admin but only within a given company
  • authorized_team_member - regular agency team member that has access to the company
  • guest - can view campaign results, export data, and manage their email accounts
└─guest_permissionsarray[string]mailboxes - whether a guest user can add/remove their mailboxes. Empty array for non-guests or guest without permission
pagination_dataobjectPagination information. See the pagination section

Pagination

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

Use page parameter to view a specific page.

info

Each page contains up to 50 users

{
"content": [],
"pagination_data": {
"total_elements": 501,
"total_pages": 11,
"current_page_number": 3,
"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