ByteChef LogoByteChef

Loops

Loops is an email marketing and transactional email platform built for modern SaaS companies, helping businesses automate onboarding, product updates, and lifecycle messaging with simple workflows, API integrations, and scalable contact management.

Categories: Advertising

Type: loops/v1


Connections

Version: 1

API Key

Properties

NameLabelTypeDescriptionRequired
tokenAPI KeySTRINGTo find your API key go to Settings -> API in Loops and click Generate key.true

Connection Setup

Generate API Key

  1. Login to your Loops
  2. Click here to go to Settings.
  3. Click on API.
  4. Click on Generate key button.
  5. By clicking here you can copy your API Key.

Actions

Create Campaign

Name: createCampaign

Create a draft campaign. Loops creates an empty email message for it; set its subject and content with Update Email Message.

Properties

NameLabelTypeDescriptionRequired
nameNameSTRINGThe campaign name.true
campaignGroupIdCampaign Group IDSTRINGThe ID of the group to add this campaign to. Defaults to the team's Unsorted group when empty.false
mailingListIdMailing List IDSTRINGThe ID of the mailing list to send to.false
audienceSegmentIdAudience Segment IDSTRINGThe ID of an audience segment to send to.false

Example JSON Structure

{
  "label" : "Create Campaign",
  "name" : "createCampaign",
  "parameters" : {
    "name" : "",
    "campaignGroupId" : "",
    "mailingListId" : "",
    "audienceSegmentId" : ""
  },
  "type" : "loops/v1/createCampaign"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the campaign.
urlSTRINGThe URL of the campaign in the Loops app.
nameSTRINGThe name of the campaign.
statusSTRINGThe status of the campaign, for example Draft or Sent.
createdAtSTRINGISO 8601 timestamp for when the campaign was created.
updatedAtSTRINGISO 8601 timestamp for when the campaign was last updated.
emailMessageIdSTRINGThe ID of the campaign's email message.
campaignGroupIdSTRINGThe ID of the campaign group this campaign belongs to, if set.
mailingListIdSTRINGThe ID of the mailing list this campaign sends to, if set.
audienceSegmentIdSTRINGThe ID of the audience segment this campaign targets, if set.
emailMessageContentRevisionIdSTRINGThe content revision of the new email message. Pass it as Expected Revision ID on the first Update Email Message.

Output Example

{
  "id" : "",
  "url" : "",
  "name" : "",
  "status" : "",
  "createdAt" : "",
  "updatedAt" : "",
  "emailMessageId" : "",
  "campaignGroupId" : "",
  "mailingListId" : "",
  "audienceSegmentId" : "",
  "emailMessageContentRevisionId" : ""
}

Create Contact

Name: createContact

Create a new contact with an email address and any other contact properties.

Properties

NameLabelTypeDescriptionRequired
emailEmail AddressSTRINGThe contact’s email address.true
firstNameFirst NameSTRINGThe contact’s first name.false
lastNameLast NameSTRINGThe contact’s last name.false
userGroupUser GroupSTRINGYou can use groups to segment users when sending emails. Currently, a contact can only be in one user group. Groups like “Users”, “VIPs”, “Investors” or “Customers”false
userIdUser IDSTRINGA unique user ID (for example, from an external application).false
mailingListsMailing ListsARRAY
Items [STRING]
List of mailing lists the user will be subscribed to.false

Example JSON Structure

{
  "label" : "Create Contact",
  "name" : "createContact",
  "parameters" : {
    "email" : "",
    "firstName" : "",
    "lastName" : "",
    "userGroup" : "",
    "userId" : "",
    "mailingLists" : [ "" ]
  },
  "type" : "loops/v1/createContact"
}

Output

Type: OBJECT

Properties

NameTypeDescription
successBOOLEAN
Options true, false
Indicates whether the contact was created successfully.
idSTRINGThe internal ID of the new contact.

Output Example

{
  "success" : false,
  "id" : ""
}

How to find Mailing List ID

  1. Go to Setting.
  2. Click on Lists.
  3. There you will see your Mailing lists.
  4. Copy ID of the desired mailing list.

Get Campaign

Name: getCampaign

Get a campaign, including the ID of its email message.

Properties

NameLabelTypeDescriptionRequired
campaignIdCampaign IDSTRINGThe ID of the campaign to get.true

Example JSON Structure

{
  "label" : "Get Campaign",
  "name" : "getCampaign",
  "parameters" : {
    "campaignId" : ""
  },
  "type" : "loops/v1/getCampaign"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the campaign.
urlSTRINGThe URL of the campaign in the Loops app.
nameSTRINGThe name of the campaign.
statusSTRINGThe status of the campaign, for example Draft or Sent.
createdAtSTRINGISO 8601 timestamp for when the campaign was created.
updatedAtSTRINGISO 8601 timestamp for when the campaign was last updated.
emailMessageIdSTRINGThe ID of the campaign's email message.
campaignGroupIdSTRINGThe ID of the campaign group this campaign belongs to, if set.
mailingListIdSTRINGThe ID of the mailing list this campaign sends to, if set.
audienceSegmentIdSTRINGThe ID of the audience segment this campaign targets, if set.

Output Example

{
  "id" : "",
  "url" : "",
  "name" : "",
  "status" : "",
  "createdAt" : "",
  "updatedAt" : "",
  "emailMessageId" : "",
  "campaignGroupId" : "",
  "mailingListId" : "",
  "audienceSegmentId" : ""
}

Get Email Message

Name: getEmailMessage

Get an email message, including its subject, preview text, LMX body and current content revision.

Properties

NameLabelTypeDescriptionRequired
emailMessageIdEmail Message IDSTRINGThe ID of the email message, for example the Email Message ID of a campaign.true

Example JSON Structure

{
  "label" : "Get Email Message",
  "name" : "getEmailMessage",
  "parameters" : {
    "emailMessageId" : ""
  },
  "type" : "loops/v1/getEmailMessage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the email message.
campaignIdSTRINGThe campaign this email message belongs to, if any.
transactionalIdSTRINGThe transactional email this email message belongs to, if any.
subjectSTRINGThe email subject.
previewTextSTRINGThe email preview text.
fromNameSTRINGThe email sender name.
fromEmailSTRINGThe sender email address, without the team's sending domain.
replyToEmailSTRINGThe email reply-to address.
emailFormatSTRINGThe rendering format of the email: styled or plain.
lmxSTRINGThe email body serialized as LMX.
contentRevisionIdSTRINGThe current content revision. Pass it as Expected Revision ID on the next update.
updatedAtSTRINGISO 8601 timestamp for when the email message was last updated.
warningsARRAY
Items [{STRING(rule), STRING(severity), STRING(message), STRING(path)}]
Non-fatal issues raised while compiling the submitted LMX.

Output Example

{
  "id" : "",
  "campaignId" : "",
  "transactionalId" : "",
  "subject" : "",
  "previewText" : "",
  "fromName" : "",
  "fromEmail" : "",
  "replyToEmail" : "",
  "emailFormat" : "",
  "lmx" : "",
  "contentRevisionId" : "",
  "updatedAt" : "",
  "warnings" : [ {
    "rule" : "",
    "severity" : "",
    "message" : "",
    "path" : ""
  } ]
}

Update Email Message

Name: updateEmailMessage

Update the subject, preview text, sender or LMX body of an email message. Only the fields you fill in are changed. A campaign's email message can be updated only while the campaign is a draft.

Properties

NameLabelTypeDescriptionRequired
emailMessageIdEmail Message IDSTRINGThe ID of the email message to update.true
expectedRevisionIdExpected Revision IDSTRINGThe content revision you last read: the Content Revision ID from Get Email Message, or the Email Message Content Revision ID from Create Campaign. The update is applied only if the email is still at this revision, so a newer edit is never overwritten.true
subjectSubjectSTRINGThe email subject.false
previewTextPreview TextSTRINGThe email preview text.false
fromNameFrom NameSTRINGThe email sender name.false
fromEmailFrom EmailSTRINGThe sender email address without the team's sending domain, for example hello for hello@yourdomain.com.false
replyToEmailReply-To EmailSTRINGThe reply-to email address.false
lmxLMXSTRINGThe email body in LMX, Loops' XML-like email markup, for example <Paragraph>Hello, {firstName}!</Paragraph>. Styles go in the LMX <Style /> tag. The payload is limited to 100KB. See https://loops.so/docs/creating-emails/lmx for the format.false

Example JSON Structure

{
  "label" : "Update Email Message",
  "name" : "updateEmailMessage",
  "parameters" : {
    "emailMessageId" : "",
    "expectedRevisionId" : "",
    "subject" : "",
    "previewText" : "",
    "fromName" : "",
    "fromEmail" : "",
    "replyToEmail" : "",
    "lmx" : ""
  },
  "type" : "loops/v1/updateEmailMessage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the email message.
campaignIdSTRINGThe campaign this email message belongs to, if any.
transactionalIdSTRINGThe transactional email this email message belongs to, if any.
subjectSTRINGThe email subject.
previewTextSTRINGThe email preview text.
fromNameSTRINGThe email sender name.
fromEmailSTRINGThe sender email address, without the team's sending domain.
replyToEmailSTRINGThe email reply-to address.
emailFormatSTRINGThe rendering format of the email: styled or plain.
lmxSTRINGThe email body serialized as LMX.
contentRevisionIdSTRINGThe current content revision. Pass it as Expected Revision ID on the next update.
updatedAtSTRINGISO 8601 timestamp for when the email message was last updated.
warningsARRAY
Items [{STRING(rule), STRING(severity), STRING(message), STRING(path)}]
Non-fatal issues raised while compiling the submitted LMX.

Output Example

{
  "id" : "",
  "campaignId" : "",
  "transactionalId" : "",
  "subject" : "",
  "previewText" : "",
  "fromName" : "",
  "fromEmail" : "",
  "replyToEmail" : "",
  "emailFormat" : "",
  "lmx" : "",
  "contentRevisionId" : "",
  "updatedAt" : "",
  "warnings" : [ {
    "rule" : "",
    "severity" : "",
    "message" : "",
    "path" : ""
  } ]
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.

How is this guide?

Last updated on

On this page