API to retrieve a list of clients in an agency or white label account
Please see this article for information on API authorization, testing endpoints, and how obtain your API key.
If you would like to programmatically retrieve a list of the clients that belong to your agency or white label account, and a list of each of their campaigns, you can leverage our this API endpoint to achieve this.
The call to this endpoint must be an HTTP GET to:https://api.leadpost.com/api/v1.0/agency/clients/campaigns
This API endpoint retrieves a list of all client accounts belonging to your agency or white label account and a list of campaigns for each account returned.
There are no input parameters and the response will return a list of account ids and client names in agency account, and alongside each account, a list of campaigns belonging to that account with their current status, as shown below:
Sample API Response:
[
{
"accountId": 12345,
"clientName": "Client 1",
"clientCampaigns": [
{
"campaignId": 121,
"campaignStatus": "Inactive",
"campaignStatusId": 2,
"name": "Default Campaign"
},
{
"campaignId": 122,
"campaignStatus": "Active",
"campaignStatusId": 1,
"name": "Default Campaign - Insights"
}
]
},
{
"accountId": 12346,
"clientName": "Client 2",
"clientCampaigns": [
{
"campaignId": 123,
"campaignStatus": "Active",
"campaignStatusId": 1,
"name": "Client 2 B2B"
},
{
"campaignId": 124,
"campaignStatus": "Active",
"campaignStatusId": 1,
"name": "Client 2 B2B - Insights"
}
]
}
]