HighLevel: Schedule Campaign
HighLevel emails.scheduleCampaign: arguments, response, policy and SDK examples.
← Emails operations · Get started
Operation gohighlevel.schedule_campaign
Provider route: POST /emails/locations/{locationId}/campaigns/emails/{campaignId}/schedule. 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"]["scheduleCampaign"]>[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.scheduleCampaign(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.schedule_campaign(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.campaignId | string | Required within parent | |
body | Model | Required within parent | Expand Schedule Campaign — request body — body |
Referenced models: Schedule Campaign — request body — body
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 Schedule Campaign — response body |
Referenced models: Schedule Campaign — response body
Schemas
Section titled “Schemas”3 more schemas are linked from the tables above, on the schema pages.
Schedule Campaign — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
campaignId | string | Required within parent | Campaign ID |
sourceId | JSON | Required within parent | |
sourceId (anyOf 1) | string | Alternative | Source ID for fetching campaign statistics |
sourceId (anyOf 2) | null | Alternative | |
traceId | string | Optional | Trace ID of the request |
Schedule Campaign — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
abTestConfig | JSON | Optional | A/B test configuration. Can be combined with any scheduleType except rss. |
abTestConfig (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body / abTestConfig / testType: email Content, subject Line, winning Criteria: open Rate, click Rate |
emailMeta | JSON | Required within parent | Email subject, sender, and content metadata |
emailMeta (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body email Meta attachments, from Email, from Name, preview Text, reply To Address, subject |
recipients | JSON | Required within parent | Who receives the email. Must provide either contactIds or filter. |
recipients (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body / recipients / type: contact, tag, segment |
rssConfig | JSON | Optional | RSS feed configuration. Required when scheduleType is rss. |
rssConfig (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body / rssConfig / repeatAfter: every day, every week, every month, start At Day: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday |
scheduleConfig | JSON | Optional | Schedule configuration for immediate, scheduled, batch, and smart_send types. Required when scheduleType is not rss. |
scheduleConfig (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking |
scheduleType | string | Required within parent | How to schedule the campaign One of: immediate, scheduled, batch, rss, smart_send |
sendDays | array | Optional | Days of the week to allow sending. Used for batch and RSS scheduleTypes. |
sendDays[] | string | Each item | One of: Mon, Tue, Wed, Thu, Fri, Sat, Sun |
timeZone | string | Required within parent | IANA timezone |
userId | string | Required within parent | ID of the user performing this action |
userName | string | Optional | Name of the user performing this action |
Referenced models: Schedule Campaign — request body — body / abTestConfig / testType: email Content, subject Line, winning Criteria: open Rate, click Rate, Schedule Campaign — request body — body email Meta attachments, from Email, from Name, preview Text, reply To Address, subject, Schedule Campaign — request body — body / recipients / type: contact, tag, segment, Schedule Campaign — request body — body / rssConfig / repeatAfter: every day, every week, every month, start At Day: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking
Schedule Campaign — request body — body / abTestConfig / testType: email Content, subject Line, winning Criteria: open Rate, click Rate
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
testDuration | number | Required within parent | Seconds to run the test before picking a winner |
testSize | number | Required within parent | Percentage of contacts in the test group (0-100) |
testType | string | Required within parent | What is being tested One of: emailContent, subjectLine |
variationCount | number | Required within parent | Number of variations |
variations | array | Required within parent | A/B test variations |
variations[] | Model | Each item | Expand Schedule Campaign — request body — body / abTestConfig / testType: email Content, subject Line, winning Criteria: open Rate, click Rate variations item |
winningCriteria | string | Required within parent | How to pick the winner One of: openRate, clickRate |
Referenced models: Schedule Campaign — request body — body / abTestConfig / testType: email Content, subject Line, winning Criteria: open Rate, click Rate variations item
Schedule Campaign — request body — body email Meta attachments, from Email, from Name, preview Text, reply To Address, subject
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
attachments | array | Optional | Attachment download URLs |
attachments[] | string | Each item | |
fromEmail | string | Required within parent | Sender email address |
fromName | string | Required within parent | Sender display name |
previewText | string | Optional | Preview text shown in inbox after subject |
replyToAddress | string | Optional | Reply-to email address |
subject | string | Required within parent | Email subject line |
Schedule Campaign — request body — body / recipients / type: contact, tag, segment
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
contactIds | array | Optional | Contact IDs to send to. Required when type is contact. |
contactIds[] | string | Each item | |
freezeList | boolean | Optional | Freeze the contact list at schedule time — new matching contacts will not be added later Default: true |
segment | string | Optional | Segment type for pre-built segments. Required when type is segment. One of: engaged_last_7_days, engaged_last_30_days, engaged_last_60_days, engaged_last_5_campaigns, unengaged_last_5_campaigns |
tagIds | array | Optional | Tag IDs to filter recipients by. Required when type is tag. |
tagIds[] | string | Each item | |
type | string | Required within parent | Recipient selection type One of: contact, tag, segment |
Schedule Campaign — request body — body / rssConfig / repeatAfter: every day, every week, every month, start At Day: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
firstExecutionDate | string | Optional | Override first execution date/time |
name | string | Required within parent | RSS schedule name |
repeatAfter | string | Required within parent | How often to check the feed One of: every_day, every_week, every_month |
repeatAfterTime | string | Required within parent | Time of day to execute |
rssFeedLimit | number | Optional | Max number of RSS items per email |
rssFeedURL | string | Required within parent | RSS feed URL |
startAtDay | string | Optional | Day of week for weekly RSS One of: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday |
startAtMonthDay | string | Optional | Day of month for monthly RSS |
Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
batch | JSON | Optional | Batch/drip configuration. Required when scheduleType is batch. Ignored otherwise. |
batch (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body / scheduleConfig / batch, emailPreferenceId, resend, sendAt, tracking / batch / intervalUnit: minutes, hours, days |
emailPreferenceId | string | Optional | Email preference type ID for categorizing this campaign |
resend | JSON | Optional | Auto-resend to contacts who did not open |
resend (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking resend enabled, subject, wait Hours |
sendAt | string | Optional | Date/time to send. Required for scheduled, batch, and smart_send. Ignored for immediate. |
tracking | JSON | Optional | Click and UTM tracking options |
tracking (allOf 1) | Model | All variants apply | Expand Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking tracking click Tracking, utm Tracking |
Referenced models: Schedule Campaign — request body — body / scheduleConfig / batch, emailPreferenceId, resend, sendAt, tracking / batch / intervalUnit: minutes, hours, days, Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking resend enabled, subject, wait Hours, Schedule Campaign — request body — body schedule Config batch, email Preference Id, resend, send At, tracking tracking click Tracking, utm Tracking
Schedule Campaign — request body — body / abTestConfig / testType: email Content, subject Line, winning Criteria: open Rate, click Rate variations item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
documentId | string | Optional | Template/document ID for this variation |
subject | string | Optional | Subject line for this variation |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: gohighlevel.schedule_campaign. Catalog operation: schedule-campaign. 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/campaigns.write"]
Pinned headers: {"Version": "v3"}