Developers

Messaging Connector

Coming soon! Available from version 25.5. Access to the Messaging Connector includes access to the Message API. The API allows you to create, edit, test and publish campaigns. Contact your Client Manager for information on pricing and access.

Staging a campaign

Creating a new campaign. This operation will fail if the campaign already exists.

Request

POST /messages/v1/campaign/email/:stage
{
  "name": "",
  "flowTemplate": "",
  "senderName": "",
  "senderEmail": "",
  "replyToEmail": "",
  "subject": "",
  "schedule": "",
  "templateName": "",
  "targetGroupName": "",
  "limitToTargetGroupName": "",
  "utmCampaign": "",
  "blockGroups": []
}

Example

{
  "name": "newsletter-001",
  "flowTemplate": "NewsletterFlowTemplate",
  "senderName": "Cafe Connect",
  "senderEmail": "newsletter@coffee.agilliclabs.com",
  "replyToEmail": "newsletter@coffee.agilliclabs.com",
  "subject": "Newsletter 001 <globaldata>YEAR</globaldata>",
  "schedule": "2025-12-01 12:00:00",
  "templateName": "newsletter.html",
  "targetGroupName": "Roastery Newsletter",
  "limitToTargetGroupName": "Valid Newsletter",
  "utmCampaign": "newsletter-roastery",
  "blockGroups": [
    {
      "blockGroupId": "message_group",
      "messages": [
        {
          "name": "Roastery News 001",
          "maxVariants": 1,
          "collapsed": false,
          "messageTemplate": "RoasteryMessageTemplate",
          "blockId": "message-side_article",
          "variants": [
            {
              "name": "Fallback",
              "targetGroupName": "All recipients",
              "fields": {
                "hero-image":"",
                "message-trompet":"",
                "message-header":"",
                "message-content":"",
                "cta-link":""
              }
            },
            {
              "name": "Gold Loyalty",
              "targetGroupName": "Gold Loyalty",
              "fields": {
                "hero-image":"",
                "message-trompet":"",
                "message-header":"",
                "message-content":"",
                "cta-link":""
              }
            },
            {
              "name": "Silver Loyalty",
              "targetGroupName": "Silver Loyalty",
              "fields": {
                "hero-image":"",
                "message-trompet":"",
                "message-header":"",
                "message-content":"",
                "cta-link":""
              }
            }
          ]
        }
      ]
    }
  ]
}

Properties

NameRequiredTypeDescription
nameYesStringName of the campaign. Will be used as the Flow and Email name.
flowTemplateNoStringThe name of the flow template.
sendernameNoStringThe from name of the email – also know. as “Personal from”.
senderEmailNoStringThe email from address.
replyToEmailNoStringThe email reply-to address.
subjectYesStringThe email subject line.
scheduleNoStringThe flow schedule. Date format must match what is defined in Settings / API.
templateNameYesStringThe name of the email HTML template.
targetGroupNameYesStringThe name of the target group to be used on the campaign flow.
limitToTargetGroupNameNoStringThe name of the global target group to be used on the campaign flow.
utmCampaignNoStringThe utm_campaign to be set on the email. Will default to the name of email if omitted.
blockGroupsYesBlock Group objectDefinition

Response

{
  "success": true,
  "message": "",
  "data": {
    "campaignId": "",
    "campaignName": "",
    "schedule": ""
  }
}

Editing a campaign

Editing a campaign. This operation will fail if the campaign does not exist.

Please note that the amount of “variants” is expected to remain the same between a :stage and :edit request.

Request

POST /messages/v1/campaign/email/:edit
{
  "campaignId": "",
  "senderName": "",
  "senderEmail": "",
  "replyToEmail": "",
  "subject": "",
  "schedule": "",
  "targetGroupName": "",
  "limitToTargetGroupName": "",
  "utmCampaign": "",
  "blockGroups": []
}

Example

{
  "campaignId": "#BaaB",
  "senderName": "Cafe Connect",
  "senderEmail": "newsletter@coffee.agilliclabs.com",
  "replyToEmail": "newsletter@coffee.agilliclabs.com",
  "subject": "Newsletter 001 <globaldata>YEAR</globaldata>",
  "schedule": "2025-12-01 12:00:00",
  "targetGroupName": "Roastery Newsletter",
  "limitToTargetGroupName": "Valid Newsletter",
  "utmCampaign": "newsletter-roastery",
  "blockGroups": [
    {
      "messages": [
        {
          "name": "Roastery News 001",
          "maxVariants": 1,
          "collapsed": true,
          "variants": [
            {
              "name": "Fallback",
              "targetGroupName": "All recipients",
              "fields": {
                "hero-image":"",
                "message-trompet":"",
                "message-header":"",
                "message-content":"",
                "cta-link":""
              }
            },
            {
              "name": "Gold Loyalty",
              "targetGroupName": "Gold Loyalty",
              "fields": {
                "hero-image":"",
                "message-trompet":"",
                "message-header":"",
                "message-content":"",
                "cta-link":""
              }
            },
            {
              "name": "Silver Loyalty",
              "targetGroupName": "Silver Loyalty",
              "fields": {
                "hero-image":"",
                "message-trompet":"",
                "message-header":"",
                "message-content":"",
                "cta-link":""
              }
            }
          ]
        }
      ]
    }
  ]
}

Properties

NameRequiredTypeDescription
campaignIdYesStringCampaign identifier
sendernameNoStringThe from name of the email – also know. as “Personal from”.
senderEmailNoStringThe email from address.
replyToEmailNoStringThe email reply-to address.
subjectYesStringThe email subject line.
scheduleNoStringThe flow schedule. Date format must match what is defined in Settings / API.
targetGroupNameYesStringThe name of the target group to be used on the campaign flow.
limitToTargetGroupNameNoStringThe name of the global target group to be used on the campaign flow.
utmCampaignNoStringThe utm_campaign to be set on the email. Will default to the name of email if omitted.
blockGroupsYesBlock Group objectDefinition

Response

{
  "success": true,
  "message": "",
  "data": {
    "campaignId": "",
    "campaignName": "",
    "schedule": ""
  }
}

Testing a campaign

Testing a campaign. This operation will fail if the campaign does not exist.

Request

POST /messages/v1/campaign/email/:test
{
  "campaignId": "",
  "viewAsRecipientId": "",
  "sendMessage": ""
}

Properties

NameRequiredTypeDescription
campaignIdYesStringCampaign identifier
viewAsRecipientIdYesStringRecipient Identifier value of the recipient to test with
sendMessageNoStringAllowed values are true/false. Controls whether a message should be sent to the viewAsRecipientId value.

Response

{
  "success": true,
  "message": "",
  "data": {
    "subject": "",
    "content": ""
  }
}

Publishing a campaign

Coming later. Subject to change.

Publishing a campaign. This operation will fail if the campaign does not exist.

Request

POST /messages/v1/campaign/email/:publish
{
  "campaignId": ""
}

Properties

NameRequiredTypeDescription
campaignIdYesStringCampaign identifier

Objects

Stage Block Group Object

{
  "blockGroupId": "",
  "messages": []
}

Properties

NameRequiredTypeDescription
blockGroupIdYesStringName of the blockgroup id (agid in HTML template).
messagesYesArray of Message objectsDefinition

Edit Block Group Object

{
  "messages": []
}

Properties

NameRequiredTypeDescription
messagesYesArray of Message objectsDefinition

Stage Message Object

{
  "name": "",
  "maxVariants": 1,
  "collapsed": false,
  "messageTemplate": "",
  "blockId": "",
  "variants": []
}

Properties

NameRequiredTypeDescription
nameYesStringName of the message (promotion).
maxVariantsNoIntegerMax variants (propositions) to show setting.
collapsedNoBooleanAllowed values are true/false. Hide the block if the recipient does not match any propositions.
messageTemplateYesStringName of the message (promotion) template.
blockIdYesStringName of the block id (agid in HTML template).
variantsYesArray of Variant objectsDefinition

Edit Message Object

{
  "name": "",
  "maxVariants": 1,
  "variants": []
}

Properties

NameRequiredTypeDescription
nameYesStringName of the message (promotion).
maxVariantsNoIntegerMax variants (propositions) to show setting.
collapsedNoBooleanAllowed values are true/false. Hide the block if the recipient does not match any propositions.
variantsYesArray of Variant objectsDefinition

Variant Object

{
  "name": "",
  "targetGroupName": "",
  "fields": {}
}

Properties

NameRequiredTypeDescription
nameYesStringName of the message (promotion).
targetGroupNameNoStringName of the target group to be used as a condition.
fieldsYesArray of Variant Field objectsDefinition

Variant Field Object

{
  "(insert the variant field name here)": "value",
}

Properties

NameRequiredTypeDescription
Must match a promotion field name in the found in the requested messageTemplateYesStringName of the message field (promotion field).

Examples

Promotion field of the type “plain”.

{
  "message-trompet": "Latest news"
}

Promotion field of the type “rich”.

{
  "message-content": "Get ready to carve jack o lanterns with our newest offering - <b>Pumpkin Spice Cold Foam Shaken Macchiato!</b>
Find it in a store near you."
}

Promotion field of the type “link”. Create or add existing events by appending ?evt=

{
  "message-link": "https://coffee.agilliclabs.com?evt=clicked_article"
}

Promotion field of the type “image”. Value must be an absolute URL to an image resource.

{
  "message-image": "https://coffee.agilliccdn.com/pi7g7w/MjAyMTEy/Mjc=/NTcyMTE4MmItZWZmNi00ZGViLTk5MzAtZDIzYmFiZDI1Y2Y1.png"
}

Full example

{
  "message-trompet": "Latest news",
  "message-header": "It's spooky season!",
  "message-content": "Get ready to carve jack o lanterns with our newest offering - Pumpkin Spice Cold Foam Shaken Macchiato!
Find it in a store near you.", 
  "message-link": "https://coffee.agilliclabs.com?evt=clicked_article",
  "message-image": "https://coffee.agilliccdn.com/pi7g7w/MjAyMTEy/Mjc=/NTcyMTE4MmItZWZmNi00ZGViLTk5MzAtZDIzYmFiZDI1Y2Y1.png"
}