Skip to main content

Get a company's API keys

Retrieve a paginated list of API keys associated with a specific company. The response will include only the keys created by the requesting user.

Request

Endpoint

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

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 API keys will be returned
pageNointegerRequested results page (1-based)

Request sample

Get list of API keys

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

Response

Response examples

A list of API keys. If there no API keys, content will be an empty array.

{
"content": [
{
"api_key": "123456.abcdefg123456hijk987",
"label": "Custom name"
},
{
"api_key": "123456.123456abcd987efghijk",
"label": "Custom name 2"
}
],
"pagination_data": {
"total_elements": 2,
"total_pages": 1,
"current_page_number": 1,
"page_size": 50
}
}

Body schema

FieldTypeDescription
contentarray[object]Array of API key objects
└─api_keystringAPI key
└─label string/nullA descriptive name assigned while generating the key
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 API keys

{
"content": [],
"pagination_data": {
"total_elements": 300,
"total_pages": 6,
"current_page_number": 2,
"page_size": 50
}
}
FieldTypeDescription
pagination_dataobjectPagination information
└─total_elementsintegerTotal number of API keys
└─total_pagesintegerTotal number of available pages
└─current_page_numberintegerCurrent page number (1-based)
└─page_sizeintegerMaximum number of items per page