create_campaign
Create a new outreach campaign, including the full branching sequence.
Recommended workflow for building a sequence from a natural-language ask:
Call list_sequence_templates first (26 starters; pass
keyfor a full tree), fork the closest one so you don't build from scratch. Fill any [bracketed placeholders] in it: launch is refused while one remains (put a backslash before a bracket to send it as written).Edit step bodies / delays / branches to match the user's intent.
Call validate_sequence to catch structural issues before activation.
Call preview_sequence (structure) and preview_messages (the rendered messages one prospect would get, with warnings) and show the user both.
Call create_campaign once the user confirms.
Sequence shape: an ordered array of steps (camelCase fields). Each step has an id (unique string, REQUIRED), a type from {connection_request, message, follow_up, inmail, voice_note, view_profile, follow_profile, like_post, find_email, if_open_profile, if_connection}, an optional delayHours (defaults to 0), an optional body (REQUIRED for message/follow_up/inmail; optional invite note for connection_request, supports {{firstName}},{{company}},{{senderName}},…), an optional fallbackBody, withdrawAfterDays (connection_request), and an optional branches object.
Tokens in a body: anything beyond the built-ins must be a REGISTERED custom variable. An unregistered {{token}} is STRIPPED at send time, so the message goes out with a gap in the sentence and nothing reports it, call list_custom_variables first and create_custom_variable for anything missing. If you want literal braces in the copy (a message whose subject IS the templating syntax), escape them: {{example}} renders as {{example}}. Backslashes are counted in pairs, so an odd run escapes and an even one does not: \{{firstName}} is one literal backslash then the substituted name.
Branches fork the sequence. Valid keys on every branching step are accepted and notAccepted (there is no replied/noReply). For message/follow_up/inmail/voice_note, notAccepted is the 'No Reply Yet' follow-up path (a reply stops the sequence, so accepted is usually empty).
voice_note: sends a native LinkedIn voice note. REQUIRES voiceMediaId, upload the clip first with upload_voice_note and pass the returned id. body is an optional caption. A voice note needs a chat to land in, so place it AFTER a connection/message step (or give it a caption so it can open one). Branches on reply like a message.
A/Z testing: any message-bearing step (connection_request / message / follow_up / inmail) can carry variants, an array of { body, fallbackBody? } ALTERNATIVES beyond the primary body (which is Variant A). With 1+ present, sends split evenly across [body, ...variants] and the campaign tracks reply/accept per variant (read with get_campaign_stats with include ab_tests). Omit for no test.
like_post config: reactionType (like | celebrate | support | funny | love | insightful, default like), postsNewerThan (24h | 3d | 1w | 3w | 1mo | 3mo | 6mo | lifetime, only react if the prospect's latest post is newer than this, default 1mo), and skipIfCannotLike (skip ahead when there's no post to like). connection_request takes withdrawAfterDays.
Example: 'connect with a note, then if accepted message after 1 day, else view profile after 1h' → [ { id: 'b', type: 'connection_request', body: 'Hi {{firstName}}, ...', withdrawAfterDays: 14, branches: { accepted: [ { id: 'c', type: 'message', delayHours: 24, body: 'Thanks for connecting!' } ], notAccepted: [ { id: 'd', type: 'view_profile', delayHours: 1 } ] } } ]
Pass status='draft' to keep it editable; 'active' activates immediately (server runs launch validation and returns structured errors, e.g. a message step with empty body, if anything is off).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"accountIds": "<accountIds>",
"sequence": "<sequence>"
},
"name": "create_campaign"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Campaign name. | |
| status | No | 'draft' (default) keeps the campaign editable; 'active' activates it immediately after launch validation. | draft |
| language | No | Language the sequence is sent in: "" (as written, default), "auto" (each prospect's LinkedIn profile language) or an ISO 639-1 code like "de" or "ar". Not the same as the workspace inbox language (what replies are translated into). With a fixed language, every message step needs a `translations[lang]` entry before launch. With auto, missing languages are translated by the server the first time a prospect needs one. On every save the server keeps only translations the setting can use: a fixed language keeps only its own (switching German to Arabic drops the German ones), "" keeps none, auto keeps all. | |
| schedule | No | Campaign sending window. days are 0..6 (Sun..Sat). Times 'HH:MM'. Omit for an always-on default. | |
| sequence | Yes | The branching action tree (camelCase fields). LIMITS: up to 200 steps total (including nested branch steps) and 25 levels of nesting. Run validate_sequence + preview_sequence + preview_messages before activating. | |
| accountIds | Yes | LinkedIn sender account ids that execute this campaign. Use list_accounts to discover ids. | |
| dailyLimits | No | Daily caps for THIS CAMPAIGN, e.g. { connection_invite: 20, follow_up_message: 30 }. Each number is a total per day across every sender on the campaign, not per account, and not a range the runner varies. Each sending account ALSO has its own daily caps (get_account with include daily_limits); a send needs room under both, so the lower one governs. Omit to leave the campaign uncapped, in which case the account limits alone govern, that is a safe default and usually the right one. Unknown action keys are rejected by the API rather than ignored, so spell them exactly: connection_invite, follow_up_message, inmail, profile_view, profile_follow, post_like_comment, withdraw_connection_request. | |
| audienceData | No | Audience descriptor matching audienceSource. linkedin_urls: { urls: ["https://www.linkedin.com/in/..."] }. csv: { rows: [...] }. lead_list: { listId }. linkedin_search: { url } with a Sales Navigator PEOPLE search URL (linkedin.com/sales/search/people...); a regular linkedin.com/search URL or a company search returns no people. The search runs on the campaign's first sending account, which needs Sales Navigator. Imports at launch: the first ~125 people land right away, then the rest arrive in the background (~200 every half minute) until the search runs out or reaches ~2,500 people (Sales Navigator's own cap). So the campaign's prospect count keeps rising for several minutes after launch; that is the import, not a problem. Changing the url starts a fresh import and stops the old one. | |
| audienceSource | No | Where leads come from. Most common: linkedin_urls. | |
| sourceLanguage | No | The language the sequence copy is written in, ISO 639-1 ("" = let the server detect it). Prospects who'd get this language receive the copy as written, and a fixed `language` equal to it needs no translations. Copy may mix languages (e.g. Arabic with English terms): name the main one. | |
| idempotency_key | No | Optional UUID for safe retries: send the same key when repeating a request so it is applied once. |