View as Markdown
CleverTap icon

CleverTap ACTION

Create Campaign

Create a campaign. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's CleverTap account once, then configure and run Create Campaign from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "clevertap-create-campaign",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    clevertap: { authProvisionId: "apn_xxxxxxx" },
    name: "Campaign Name",
    targetMode: "Target Mode",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Campaign inputs
Property Type Description
name Campaign Name string
The name of your campaign shown in the CleverTap dashboard.
Required
targetMode Target Mode string
The type of campaign to create
Required
where Where object

Allows you to filter target base on the user events and profile properties. Omit this parameter to target your entire user base. Example:

{
  "event_name": "Charged",
  "from": 20250101,
  "to": 20250402
}
Optional
content Content object

Object that defines the content for your message. Web Push Notification Example:

{
  "title": "Hi!",
  "body": "How are you doing today?",
  "platform_specific": {
    "safari": {
      "deep_link": "https://www.google.com",
      "ttl": 10
    },
    "chrome": {
      "image": "https://www.exampleImage.com",
      "icon": "https://www.exampleIcon.com",
      "deep_link": "http://www.example.com",
      "ttl": 10,
      "require_interaction": true,
      "cta_title1": "title",
      "cta_link1": "http://www.example2.com",
      "cta_iconlink1": "https://www.exampleIcon2.com"
    },
    "firefox": {
      "icon": "https://www.exampleIcon.com",
      "deep_link": "https://www.google.com",
      "ttl": 10
    },
    "kaios": {
      "icon": "https://www.exampleIcon.com",
      "ttl": 10,
      "kaiosKV": {
        "key1": "value1",
        "key2": "value2"
      }
    }
  }
}

Mobile Push Notification Example:

{
  "title": "Hi!",
  "body": "How are you doing today?",
  "platform_specific": {
    "ios": {
      "mutable-content": "true", 
      "deep_link": "example.com",
      "sound_file": "example.caf",
      "category": "application category//Books",
      "badge_count": 1,
      "Key": "Value_ios"
    },
    "android": {
      "enable_rendermax": true,
      "wzrk_cid": "Marketing",
      "background_image": "http://example.jpg",
      "default_sound": true,
      "deep_link": "example.com",
      "large_icon": "http://example.png",
      "Key": "Value_android",
    }
  }
}

Email Example:

{
  "subject": "Welcome",
  "body": "<div>Your HTML content for the email</div>",
  "sender_name": "CleverTap"
}
Optional
respectFrequencyCaps Respect Frequency Caps boolean
Set to false if you want to override frequency caps and dwell time. Defaults to true.
Optional
estimateOnly Estimate Only boolean
If this parameter is set to true, the request returns an estimated reach of the campaign, which is the number of users who receive the notification when you send it out. Setting this parameter to true does not create the campaign. Defaults to false.
Optional
conversionGoal Conversion Goal object

Checks the end goal of the campaign for conversion tracking. Example:

{
  "event_name": "Charged",
  "filter_type": {
    "event_property": [
      {
        "property_name": "Items|Book name",
        "operator": "equals",
        "property_value": "book name"
      },
      {
        "property_name": "Amount",
        "operator": "equals",
        "property_value": 3456
      },
      {
        "property_name": "Currency",
        "operator": "equals",
        "property_value": "USD"
      }
    ],
    "first_time": "yes",
    "last_time": "yes",
    "time_of_day": [["21:00","23:00"],["11:34","12:44"],["13:01","13:40"]],
    "day_of_week": [1,7],
    "day_of_month": [1,3,16,31]
  },
  "conversion_time": "1D",
  "revenue_property": "Amount"
}
Optional
ttlType Time To Live Type string
This allows setting of time to live for push notifications for android and iOS. The type of time to live. Can be absolute or relative. Defaults to absolute.
Optional
ttlValue Time To Live Value integer

This allows setting of time to live for push notifications for android and iOS. The value of the time to live. Can be a number of days, hours, minutes, or seconds.

  • For relative ttl, the input is an integer in minutes
  • For absolute ttl, the input should be an integer in the yyyyMMddHHmm format. Example: 202207200000
Optional
webhookEndpointName Webhook Endpoint Name string
The name of the webhook endpoint to use for the campaign.
Optional
webhookFields Webhook Fields string[]
The fields to include in the webhook payload. Can be profile-attributes, tokens, or identities.
Optional
webhookKeyValue Webhook Key Value object
The key-value pairs to include in the webhook payload.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
clevertap-create-campaign
Version
0.0.2
App
CleverTap
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes