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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.locationId | string | Required within parent | |
path.source | string | Required within parent | One of: email-campaigns, workflow-campaigns, bulk-actions |
path.sourceId | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.subSourceId | string | Optional |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get Campaign Statistics — response body |
Referenced models: Get Campaign Statistics — response body
Schemas
Section titled “Schemas”Get Campaign Statistics — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
locationId | string | Required within parent | Location ID |
source | string | Required within parent | Source type Known values: email-campaigns, workflow-campaigns, bulk-actions |
sourceId | string | Required within parent | Source ID |
stats | JSON | Required within parent | Email performance metrics |
stats (allOf 1) | Model | All variants apply | Expand 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 |
subSourceId | string | Optional | Workflow action ID |
traceId | string | Optional | Trace ID of the request |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accepted | JSON | Required within parent | |
accepted (anyOf 1) | number | Alternative | Emails accepted by the mail server |
accepted (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
bounceRate | JSON | Required within parent | |
bounceRate (anyOf 1) | number | Alternative | Bounce rate as percentage of sent |
bounceRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
clickRate | JSON | Required within parent | |
clickRate (anyOf 1) | number | Alternative | Click rate as percentage of delivered |
clickRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
clicked | JSON | Required within parent | |
clicked (anyOf 1) | number | Alternative | Links clicked |
clicked (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
complained | JSON | Required within parent | |
complained (anyOf 1) | number | Alternative | Spam complaints |
complained (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
complaintRate | JSON | Required within parent | |
complaintRate (anyOf 1) | number | Alternative | Complaint rate as percentage of delivered |
complaintRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
delivered | JSON | Required within parent | |
delivered (anyOf 1) | number | Alternative | Emails delivered to inbox |
delivered (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
failed | JSON | Required within parent | |
failed (anyOf 1) | number | Alternative | Failed emails |
failed (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
openRate | JSON | Required within parent | |
openRate (anyOf 1) | number | Alternative | Open rate as percentage of delivered |
openRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
opened | JSON | Required within parent | |
opened (anyOf 1) | number | Alternative | Emails opened |
opened (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
permanentFail | JSON | Required within parent | |
permanentFail (anyOf 1) | number | Alternative | Hard bounces |
permanentFail (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
rejected | JSON | Required within parent | |
rejected (anyOf 1) | number | Alternative | Rejected emails |
rejected (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
replied | JSON | Required within parent | |
replied (anyOf 1) | number | Alternative | Replies received |
replied (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
replyRate | JSON | Required within parent | |
replyRate (anyOf 1) | number | Alternative | Reply rate as percentage of delivered |
replyRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
sent | JSON | Required within parent | |
sent (anyOf 1) | number | Alternative | Total emails sent (delivered + accepted + bounced) |
sent (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
temporaryFail | JSON | Required within parent | |
temporaryFail (anyOf 1) | number | Alternative | Soft bounces |
temporaryFail (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
unsubscribeRate | JSON | Required within parent | |
unsubscribeRate (anyOf 1) | number | Alternative | Unsubscribe rate as percentage of delivered |
unsubscribeRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
unsubscribed | JSON | Required within parent | |
unsubscribed (anyOf 1) | number | Alternative | Unsubscribes |
unsubscribed (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}