PlatformDocs
MCP server

create_automation

Creates an automation that is active straight away and runs whenever a lead matches it.

View as Markdown

Create automation · Changes data · Acts outside your account

Creates an automation that is active straight away and runs whenever a lead matches it. By default it triggers when a new lead is identified, on the first visit only, immediately. The action is set by trigger.then, and its settings go in trigger.actions. For example, Slack uses { sentToSlack: { sendMessagesTo } } and a webhook uses { sentToWebhook: { url } }. To send leads to an email campaign, pass actions: [{ emailCampaign: "<campaignId from list_campaigns>" }]. Without trigger.then, the action is send-to-slack, or send-to-emailCampaign when actions has a campaign. It acts outside the account for every future matching lead (messages, CRM records, campaign emails). Confirm with the user before calling. Returns the created automation with its _id. Errors (405) include a missing campaign or an invalid campaign ID.

ConnectionAccount URL, team member URL or OAuth

Parameters

ParameterTypeRequiredAcceptsDescription
websiteIdstringYesanyWebsite ID from list_websites.
namestringYesanyName shown in the automation list.
triggerobjectYesanyThe rule and the action settings; each key below has a default.
trigger.whenstringNo7 valuesWhat starts it (default new-lead-is-identified).
trigger.thenstringNo16 valuesThe action: where matching leads go. Without it, send-to-slack, or send-to-emailCampaign when actions has a campaign.
trigger.triggerstringNoonly-on-first-visit, on-every-visit, noneonly-on-first-visit (default), on-every-visit or none.
trigger.intervalstringNoimmediately, after-session, daily, weekly, monthlyimmediately (default), after-session, daily, weekly or monthly.
trigger.repeatWindowHoursintegerNo7 valuesAct at most once per company or person in this many hours (12, 24, 72, 168, 720, 2160 or 4320); leave out for no limit.
trigger.dedupeScopestringNocontact, companyWhat counts as the same for the repeat limit: contact (default) or company.
trigger.contactSelectionStrategystringNoflexible-job-titles, exact-job-titles, flexible-find-at-least-one-job-titlesHow contacts are matched to your job titles: flexible-job-titles (default), exact-job-titles or flexible-find-at-least-one-job-titles.
trigger.maxContactsToSendintegerNomin 1Most contacts sent per company (default 1).
trigger.filterstringNoanyA saved filter id from list_filters; only leads matching it.
trigger.emailVerificationobjectNoanyWhich emails count: allowOnlyValidEmails, allowCatchAllEmails, allowGuessedEmails, allowWithoutEmails (true/false).
trigger.actionsobjectNoanyThe action settings, e.g. { sentToSlack: { sendMessagesTo: '#leads' } } or { sentToWebhook: { url } }. HubSpot: { sentToHubspot: { assignContactsTo, createDeal: true, pipelineId, dealStageId, dealAmount } } also creates a deal per lead (pipeline and stage ids from list_crm_pipelines); without createDeal only the contact and its company are created.
actionsobject[]NoanyShortcut for email campaigns only: a list whose item has emailCampaign set to a campaign id from list_campaigns, e.g. [{ "emailCampaign": "64f..." }]. Other items are ignored; put other action settings in trigger.actions.
actions[].emailCampaignstringNoanyA campaign id from list_campaigns.

Accepted values

The exact values these fields take; anything else is refused.

trigger.when

new-lead-is-identified · new-intent-data-triggered · new-prospector-lead · new-web-scraping-signal · new-scout-lead · new-linkedin-engagement · new-tag-added-to-lead

trigger.then

send-to-slack · send-to-hubspot · send-to-pipedrive · send-to-salesforce · send-to-zoho · send-to-gohighlevel · trigger-webhook · send-to-zapier · send-to-clay · send-to-emailCampaign · send-to-linkedinCampaign · send-email-alert · send-csv-on-email · send-to-googleAdsCampaign · send-to-linkedinAdsAudience · send-to-metaAdsAudience

trigger.repeatWindowHours

12 · 24 · 72 · 168 · 720 · 2160 · 4320

Tool definition

What your assistant receives from tools/list:

{
  "name": "create_automation",
  "title": "Create automation",
  "annotations": {
    "title": "Create automation",
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": true
  },
  "inputSchema": {
    "type": "object",
    "properties": {
      "websiteId": {
        "type": "string",
        "description": "Website ID from list_websites."
      },
      "name": {
        "type": "string",
        "description": "Name shown in the automation list."
      },
      "trigger": {
        "type": "object",
        "properties": {
          "when": {
            "type": "string",
            "enum": [
              "new-lead-is-identified",
              "new-intent-data-triggered",
              "new-prospector-lead",
              "new-web-scraping-signal",
              "new-scout-lead",
              "new-linkedin-engagement",
              "new-tag-added-to-lead"
            ],
            "description": "What starts it (default new-lead-is-identified)."
          },
          "then": {
            "type": "string",
            "enum": [
              "send-to-slack",
              "send-to-hubspot",
              "send-to-pipedrive",
              "send-to-salesforce",
              "send-to-zoho",
              "send-to-gohighlevel",
              "trigger-webhook",
              "send-to-zapier",
              "send-to-clay",
              "send-to-emailCampaign",
              "send-to-linkedinCampaign",
              "send-email-alert",
              "send-csv-on-email",
              "send-to-googleAdsCampaign",
              "send-to-linkedinAdsAudience",
              "send-to-metaAdsAudience"
            ],
            "description": "The action: where matching leads go. Without it, send-to-slack, or send-to-emailCampaign when actions has a campaign."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "only-on-first-visit",
              "on-every-visit",
              "none"
            ],
            "description": "only-on-first-visit (default), on-every-visit or none."
          },
          "interval": {
            "type": "string",
            "enum": [
              "immediately",
              "after-session",
              "daily",
              "weekly",
              "monthly"
            ],
            "description": "immediately (default), after-session, daily, weekly or monthly."
          },
          "repeatWindowHours": {
            "type": "integer",
            "enum": [
              12,
              24,
              72,
              168,
              720,
              2160,
              4320
            ],
            "description": "Act at most once per company or person in this many hours (12, 24, 72, 168, 720, 2160 or 4320); leave out for no limit."
          },
          "dedupeScope": {
            "type": "string",
            "enum": [
              "contact",
              "company"
            ],
            "description": "What counts as the same for the repeat limit: contact (default) or company."
          },
          "contactSelectionStrategy": {
            "type": "string",
            "enum": [
              "flexible-job-titles",
              "exact-job-titles",
              "flexible-find-at-least-one-job-titles"
            ],
            "description": "How contacts are matched to your job titles: flexible-job-titles (default), exact-job-titles or flexible-find-at-least-one-job-titles."
          },
          "maxContactsToSend": {
            "type": "integer",
            "minimum": 1,
            "description": "Most contacts sent per company (default 1)."
          },
          "filter": {
            "type": "string",
            "description": "A saved filter id from list_filters; only leads matching it."
          },
          "emailVerification": {
            "type": "object",
            "description": "Which emails count: allowOnlyValidEmails, allowCatchAllEmails, allowGuessedEmails, allowWithoutEmails (true/false)."
          },
          "actions": {
            "type": "object",
            "description": "The action settings, e.g. { sentToSlack: { sendMessagesTo: '#leads' } } or { sentToWebhook: { url } }. HubSpot: { sentToHubspot: { assignContactsTo, createDeal: true, pipelineId, dealStageId, dealAmount } } also creates a deal per lead (pipeline and stage ids from list_crm_pipelines); without createDeal only the contact and its company are created."
          }
        },
        "description": "The rule and the action settings; each key below has a default."
      },
      "actions": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "emailCampaign": {
              "type": "string",
              "description": "A campaign id from list_campaigns."
            }
          }
        },
        "description": "Shortcut for email campaigns only: a list whose item has emailCampaign set to a campaign id from list_campaigns, e.g. [{ \"emailCampaign\": \"64f...\" }]. Other items are ignored; put other action settings in trigger.actions."
      }
    },
    "required": [
      "websiteId",
      "name",
      "trigger"
    ]
  }
}

On this page