Skip to content

HighLevel: Get Campaign Statistics

HighLevel emails.getCampaignStats: arguments, response, policy and SDK examples.

← Emails operations · Get started

Operation gohighlevel.get_campaign_stats

Provider route: GET /emails/locations/{locationId}/campaigns/stats/{source}/{sourceId}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/gohighlevel with npm, or alter-sdk-gohighlevel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HighLevelIntegration } from "@alter-ai/gohighlevel";
async function execute(input: Parameters<HighLevelIntegration["emails"]["getCampaignStats"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HighLevelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.emails.getCampaignStats(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_gohighlevel import HighLevelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HighLevelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.emails.get_campaign_stats(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.locationIdstringRequired within parent
path.sourcestringRequired within parentOne of: email-campaigns, workflow-campaigns, bulk-actions
path.sourceIdstringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.subSourceIdstringOptional

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get Campaign Statistics — response body

Referenced models: Get Campaign Statistics — response body

Get Campaign Statistics — response body
FieldTypePresenceDescription and constraints
$objectRoot
locationIdstringRequired within parentLocation ID
sourcestringRequired within parentSource type
Known values: email-campaigns, workflow-campaigns, bulk-actions
sourceIdstringRequired within parentSource ID
statsJSONRequired within parentEmail performance metrics
stats (allOf 1)ModelAll variants applyExpand Get Campaign Statistics — response body — stats accepted, bounce Rate, click Rate, clicked, complained, complaint Rate, delivered, failed, open Rate, opened, permanent Fail, rejected, replied, reply Rate, sent, temporary Fail, unsubscribe Rate, unsubscribed
subSourceIdstringOptionalWorkflow action ID
traceIdstringOptionalTrace ID of the request

Referenced models: Get Campaign Statistics — response body — stats accepted, bounce Rate, click Rate, clicked, complained, complaint Rate, delivered, failed, open Rate, opened, permanent Fail, rejected, replied, reply Rate, sent, temporary Fail, unsubscribe Rate, unsubscribed

Get Campaign Statistics — response body — stats accepted, bounce Rate, click Rate, clicked, complained, complaint Rate, delivered, failed, open Rate, opened, permanent Fail, rejected, replied, reply Rate, sent, temporary Fail, unsubscribe Rate, unsubscribed
FieldTypePresenceDescription and constraints
$objectRoot
acceptedJSONRequired within parent
accepted (anyOf 1)numberAlternativeEmails accepted by the mail server
accepted (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
bounceRateJSONRequired within parent
bounceRate (anyOf 1)numberAlternativeBounce rate as percentage of sent
bounceRate (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
clickRateJSONRequired within parent
clickRate (anyOf 1)numberAlternativeClick rate as percentage of delivered
clickRate (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
clickedJSONRequired within parent
clicked (anyOf 1)numberAlternativeLinks clicked
clicked (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
complainedJSONRequired within parent
complained (anyOf 1)numberAlternativeSpam complaints
complained (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
complaintRateJSONRequired within parent
complaintRate (anyOf 1)numberAlternativeComplaint rate as percentage of delivered
complaintRate (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
deliveredJSONRequired within parent
delivered (anyOf 1)numberAlternativeEmails delivered to inbox
delivered (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
failedJSONRequired within parent
failed (anyOf 1)numberAlternativeFailed emails
failed (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
openRateJSONRequired within parent
openRate (anyOf 1)numberAlternativeOpen rate as percentage of delivered
openRate (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
openedJSONRequired within parent
opened (anyOf 1)numberAlternativeEmails opened
opened (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
permanentFailJSONRequired within parent
permanentFail (anyOf 1)numberAlternativeHard bounces
permanentFail (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
rejectedJSONRequired within parent
rejected (anyOf 1)numberAlternativeRejected emails
rejected (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
repliedJSONRequired within parent
replied (anyOf 1)numberAlternativeReplies received
replied (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
replyRateJSONRequired within parent
replyRate (anyOf 1)numberAlternativeReply rate as percentage of delivered
replyRate (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
sentJSONRequired within parent
sent (anyOf 1)numberAlternativeTotal emails sent (delivered + accepted + bounced)
sent (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
temporaryFailJSONRequired within parent
temporaryFail (anyOf 1)numberAlternativeSoft bounces
temporaryFail (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
unsubscribeRateJSONRequired within parent
unsubscribeRate (anyOf 1)numberAlternativeUnsubscribe rate as percentage of delivered
unsubscribeRate (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
unsubscribedJSONRequired within parent
unsubscribed (anyOf 1)numberAlternativeUnsubscribes
unsubscribed (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

SDK function policy ID: gohighlevel.get_campaign_stats. Catalog operation: get-campaign-stats. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["emails/stats.readonly"]

Pinned headers: {"Version": "v3"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.