Skip to main content

Create an API key for a company

This endpoint allows you to generate a new API key for the specified company, which can be used to authenticate API requests. The response contains the newly created API key.

Request

Endpoint

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

Headers

x-api-key: {YOUR_API_KEY}
Content-Type: application/json

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 key will be generated

Body

{
"label": "string"
}

Body schema

FieldRequiredTypeDescription
labelYesstringA descriptive name assigned to the key

Request sample

Create API keys

curl --request POST \
--url "https://api.woodpecker.co/rest/v2/agency/companies/{company_id}/api_keys" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"label": "string"
}'

Response

Response examples

Created API key

{
"api_key": "string"
}

Body schema

FieldTypeDescription
api_keystringnewly generated API key