IN THIS ARTICLE:
Introduction to managing companies
As an agency, you can easily get the list of all companies you provide services for and check the basic information about them. You can also add new clients to your agency account.
GET agency/companies/
To get a list of all companies you manage as an agency, use the following request:
GET https://api.woodpecker.co/rest/v2/agency/companies/
Sample response:
{
"content": [{
"id": 12345678,
"name": "Dunmore High School",
"owner": "Jim Halpert",
"active": true,
"running_campaigns": 2,
"email_slots": 2,
"linkedin_slots": 0
},
{
"id": 12345679,
"name": "Beets Beets Beets",
"owner": "Dwight Schrute",
"active": false,
"running_campaigns": 0,
"email_slots": 0,
"linkedin_slots": 0
}],
"pagination_data": {
"total_elements": 2,
"total_pages": 1,
"current_page_number": 1,
"page_size": 50
}
}
Response data type:
content - JSON object, list of companies managed by your agency.
id - number, company ID.
name - string, company name.
owner - string, a company owner, one of your team members.
active - boolean, indicates whether this company is active or not.
running_campaigns - number, number of campaigns running for that specific company.
email_slots - number, number of email slots consumed by that specific company.
linkedin_slots - number, number of LinkedIn slots consumed by that specific company. Check Note for more information.
pagination_data - JSON object, information about total elements and pages available.
Note:
LinkedIn slots are available for Sales Assistant only. However, you will see them in your API even if you're only a Cold Email & Agency user.
If you want to filter only active or inactive companies, use the following request:
https://api.woodpecker.co/rest/v2/agency/companies?active=true
POST agency/companies
To add new companies to your agency account, use the following request:
POST https://api.woodpecker.co/rest/v2/agency/companies/
along with this request body:
{
"companies": [{
"name": "My super client"
},
{
"name": "My better client"
}]
}
As a result you'll get the following response:
201 Created
{
"companies": [{
"id": 98764,
"name": "My super client",
"owner": "Michael Scott",
"active": true
},
{
"id": 98765,
"name": "My better client",
"owner": "Michael Scott",
"active": true
}]
}
Every company newly created on your account will automatically have an API key added. Learn more about how to get the list of your client's API keys.
Request limitations:
You can add up to 10 companies in one request.
If you try to add two companies with the same name or there's an existing company with the same name as one of the names provided in your request - you'll receive "400 Bad request" and no new companies will be added to your account (an entire request will fail).
A user who makes the request will automatically have the owner permissions.
GET agency/companies/{{CID}}/api_keys
To get a list of the client's API keys, use the following request:
GET https://api.woodpecker.co/rest/v2/agency/companies/{{CID}}/api_keys
where {{CID}} stands for company ID.
Sample result:
{
"content": [{
"api_key": "YOUR_CLIENTS_API_KEY",
"label": "Hubspot"
}
],
"pagination_data": {
"total_elements": 1,
"total_pages": 1,
"current_page_number": 1,
"page_size": 50
}
}
Response data type:
content - JSON object, list of all API keys created on your client's account.
api_key - string, API key.
label - string, API key label.
pagination_data - JSON object, information about total elements and pages available.
POST agency/companies/{{CID}}/api_keys
To create API keys through REST API, use the following request:
POST https://api.woodpecker.co/rest/v2/agency/companies/{{CID}}/api_keys
where {{CID}} stands for company ID.
{
"label" : string,
}
You can skip entering a website for each company and just use their ID numbers and label this new key. Newly created keys can be found by using a command from the above list.
Sample response
{
"api_key" : "generated_api_key"
}
Response data type:
api_key – string, API key
Want to integrate with us?
If you're interested in building a native integration with Woodpecker, fill out this form and we'll get back to you.