# Iterable

> Manage users, events and list subscriptions, inspect campaigns and templates, and send email or SMS from Iterable campaigns.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/iterable

## Actions

### Create list

Create a static list.

**Inputs**

- Description (`description`, text): Description.
- Name (`name`, text, required): Name.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "listId": 1
  }
}
```

### Delete list

Delete a list.

**Inputs**

- List (`listId`, number, required): list id

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "code": "Success",
    "msg": "example",
    "params": {}
  }
}
```

### Delete user by ID

Delete a user profile by its user ID. This permanently removes the profile.

**Inputs**

- User ID (`userId`, text, required): The user ID of the profile to delete.

**Outputs**

- `data` (object): The deletion result returned by Iterable.

**Example output**

```json
{
  "data": {}
}
```

### Get campaign

Get a campaign.

**Inputs**

- ID (`id`, number, required): Campaign ID

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "campaignState": "Draft",
    "createdAt": 1,
    "createdByUserId": "example",
    "endedAt": 1,
    "id": 1.0,
    "labelIds": [],
    "labels": [],
    "listIds": [],
    "messageMedium": "example",
    "name": "example",
    "recurringCampaignId": 1.0,
    "sendSize": 1.0,
    "startAt": 1,
    "suppressionListIds": [],
    "templateId": 1.0,
    "type": "Blast",
    "updatedAt": 1,
    "updatedByUserId": "example",
    "workflowId": 1.0
  }
}
```

### Get campaign metrics

Get metrics for campaigns.

**Inputs**

- Campaign (`campaignId`, list, required): Campaign(s) to export
- StartDateTime (`startDateTime`, date and time): Export starting from (>=). Accepted formats include YYYY-MM-DD and other ISO 8601 formats.
- EndDateTime (`endDateTime`, date and time): Export ending at (<). Accepted formats include YYYY-MM-DD and other ISO 8601 formats.

**Outputs**

- `data` (text): The report returned by Iterable as text.

**Example output**

```json
{
  "data": "example"
}
```

### Get email template

Get an email template by templateId.

**Inputs**

- TemplateId (`templateId`, number, required): Template ID
- Locale (`locale`, text): Locale of content to get

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "bccEmails": [],
    "cacheDataFeed": {},
    "campaignDataFields": {},
    "ccEmails": [],
    "clientTemplateId": "example",
    "creatorUserId": "example",
    "dataFeedId": 1.0,
    "dataFeedIds": [],
    "fromEmail": "example",
    "fromName": "example",
    "googleAnalyticsCampaignName": "example",
    "html": "example",
    "isDefaultLocale": false,
    "linkParams": [],
    "locale": "example",
    "mergeDataFeedContext": {},
    "messageTypeId": 1.0,
    "metadata": {
      "campaignId": 1,
      "clientTemplateId": "example",
      "createdAt": "example",
      "creatorUserId": "example",
      "messageTypeId": 1,
      "name": "example",
      "templateId": 1,
      "updatedAt": "example"
    },
    "name": "example",
    "plainText": "example",
    "preheaderText": "example",
    "replyToEmail": "example",
    "shortenLinks": false,
    "subject": "example",
    "templateId": 1
  }
}
```

### Get list size

Get count of users in list.

**Inputs**

- List (`listId`, number, required): list id

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {}
}
```

### Get user

Get a user by email (query parameter).

**Inputs**

- Email (`email`, text): Email

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "user": {
      "dataFields": {},
      "email": "example",
      "userId": "example"
    }
  }
}
```

### Get user by id

Get a user by userId (path parameter).

**Inputs**

- User ID (`userId`, text, required): userId

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "user": {
      "dataFields": {},
      "email": "example",
      "userId": "example"
    }
  }
}
```

### List campaigns

List campaign metadata.

**Inputs**

- Page (`page`, number): Page number (starting at 1). At least 1.
- PageSize (`pageSize`, number): Number of results to return per page (defaults to 20, maximum of 1000).
- Sort (`sort`, text): Field to sort campaigns by, with optional direction prefix. Use - for descending, + or no prefix for ascending. Campaigns can be sorted by id, name, createdAt, updatedAt, or startAt. Examples: -createdAt, +name, id. Default: `id`.
- CampaignState (`campaignState`, list): Filter campaigns by state. Can be specified multiple times to filter by multiple states. Valid states: Draft, Ready, Scheduled, Running, Finished, Starting, Aborted, Recurring, Archived. Example: ?campaignState=Ready&campaignState=Running

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "campaigns": [],
    "nextPageUrl": "example",
    "previousPageUrl": "example",
    "totalCampaignsCount": {}
  }
}
```

### List channels

Get channels.

**Inputs**: None.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "channels": []
  }
}
```

### List journeys

Get journeys (workflows).

**Inputs**

- Page (`page`, number): Page number (starting at 1). At least 1.
- PageSize (`pageSize`, number): Number of results to return per page (defaults to 10, maximum of 50).
- Sort (`sort`, text): Sort field with optional direction prefix. Use - for descending, + or no prefix for ascending. Examples: -createdAt, +name, id. Default: `id`.
- State (`state`, list): Without this parameter, the endpoint returns all non-archived journeys. With state set to Archived, the endpoint only returns archived journeys.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "journeys": [],
    "nextPageUrl": "example",
    "previousPageUrl": "example",
    "totalJourneysCount": 1
  }
}
```

### List lists

Get lists.

**Inputs**: None.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "lists": []
  }
}
```

### List message types

List message types.

**Inputs**: None.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "messageTypes": []
  }
}
```

### List subscribers

Get users in a list.

**Inputs**

- List (`listId`, number, required): list id
- PreferUserId (`preferUserId`, true/false): If true, will return the userId instead of email if both exists in a user profile for a hybrid project. Default: `false`.

**Outputs**

- `data` (text): The report returned by Iterable as text.

**Example output**

```json
{
  "data": "example"
}
```

### List templates

Get project templates.

**Inputs**

- TemplateType (`templateType`, text): Only retrieve templates associated with this template type. One of: `Base`, `Blast`, `Triggered`, `Workflow`.
- MessageMedium (`messageMedium`, text): Only retrieve templates associated with this message medium. One of: `Email`, `Push`, `InApp`, `SMS`.
- StartDateTime (`startDateTime`, date and time): Get templates created at or after this date time (yyyy-MM-dd HH:mm:ss [ZZ])
- EndDateTime (`endDateTime`, date and time): Get templates created before this date time (yyyy-MM-dd HH:mm:ss [ZZ])
- Page (`page`, number): Page number (starting at 1). At least 1. Default: `1`.
- PageSize (`pageSize`, number): Number of results to return per page (defaults to 20, maximum of 1000). Default: `20`.
- Sort (`sort`, text): Field to sort templates by, with optional direction prefix. Use - for descending, + or no prefix for ascending. Templates can be sorted by id, name, createdAt, or updatedAt. Examples: -createdAt, +name, id. Default: `id`.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "nextPageUrl": "example",
    "previousPageUrl": "example",
    "templates": [],
    "totalTemplatesCount": {}
  }
}
```

### List user events

Get user events.

**Inputs**

- Email (`email`, text, required): Email of the user whose events you are retrieving.
- Limit (`limit`, number): The number of events to retrieve. (Max is 200). From 1 to 200. Default: `25`.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "events": []
  }
}
```

### List user events by id

Get user events by userId.

**Inputs**

- User ID (`userId`, text, required): UserId of the user whose events you are retrieving.
- Limit (`limit`, number): The number of events to retrieve. (Max is 200). From 1 to 200. Default: `25`.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "events": []
  }
}
```

### Send email

Send an email to an email address.

**Inputs**

- AllowRepeatMarketingSends (`allowRepeatMarketingSends`, true/false): Allow repeat marketing sends? Defaults to true.
- Campaign (`campaignId`, number, required): Campaign ID
- DataFields (`dataFields`, object): Fields to merge into email template
- Metadata (`metadata`, object): Metadata to pass back via webhooks. Not used for rendering
- RecipientEmail (`recipientEmail`, text): An email address that identifies a user profile in Iterable. Provide a recipientEmail or a recipientUserId (but not both), depending on how your project identifies users.
- RecipientUserId (`recipientUserId`, text): A user ID that identifies a user profile in Iterable. Provide a recipientEmail or a recipientUserId (but not both), depending on how your project identifies users.
- SendAt (`sendAt`, date and time): Schedule the message for up to 365 days in the future. If set in the past, email is sent immediately. Format is YYYY-MM-DD HH:MM:SS in UTC

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "code": "Success",
    "msg": "example",
    "params": {}
  }
}
```

### Send sms

Send SMS notification to user.

**Inputs**

- AllowRepeatMarketingSends (`allowRepeatMarketingSends`, true/false): Allow repeat marketing sends? Defaults to true.
- Campaign (`campaignId`, number, required): Campaign ID
- DataFields (`dataFields`, object): Fields to merge into template
- RecipientEmail (`recipientEmail`, text): An email address that identifies a user profile in Iterable. Provide a recipientEmail or a recipientUserId (but not both), depending on how your project identifies users.
- RecipientUserId (`recipientUserId`, text): A user ID that identifies a user profile in Iterable. Provide a recipientEmail or a recipientUserId (but not both), depending on how your project identifies users.
- SendAt (`sendAt`, date and time): Schedule the message for up to 365 days in the future. If set in the past, message is sent immediately. Format is YYYY-MM-DD HH:MM:SS in UTC

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "code": "Success",
    "msg": "example",
    "params": {}
  }
}
```

### Subscribe users

Add subscribers to list.

**Inputs**

- List (`listId`, number, required): Listid.
- Subscribers (`subscribers`, list, required): Subscribers.
- UpdateExistingUsersOnly (`updateExistingUsersOnly`, true/false): Whether to skip operation when the request includes a userId or email that doesn't yet exist in the Iterable project. When true, Iterable ignores requests with unknown userIds and email addresses. When false, Iterable creates new users. Defaults to false. Only respected in API calls for userID-based and hybrid projects.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "createdFields": [],
    "failCount": 1,
    "failedUpdates": {
      "conflictEmails": [],
      "conflictUserIds": [],
      "forgottenEmails": [],
      "forgottenUserIds": [],
      "invalidDataEmails": [],
      "invalidDataUserIds": [],
      "invalidEmails": [],
      "invalidUserIds": [],
      "notFoundEmails": [],
      "notFoundUserIds": []
    },
    "filteredOutFields": [],
    "invalidEmails": [],
    "invalidUserIds": [],
    "successCount": 1
  }
}
```

### Track event

Track an event.

**Inputs**

- Campaign (`campaignId`, number): Campaign tied to conversion
- CreateNewFields (`createNewFields`, true/false): Whether new fields should be ingested and added to the schema. Defaults to project's setting to allow or drop unrecognized fields.
- CreatedAt (`createdAt`, date and time): When the event happened. Leave blank to use the time Iterable receives it.
- DataFields (`dataFields`, object): Additional data associated with event (i.e. item amount, item quantity). For events of the same name, identically named data fields must be of the same type.
- Email (`email`, text): An email address that identifies a user profile in Iterable. Provide an email or a userId (but not both), depending on how your project identifies users.
- EventName (`eventName`, text, required): Name of event
- ID (`id`, text): Optional event id. If an event exists with that id, the event will be updated. If none is specified, a new id will automatically be generated and returned. Note that this ID cannot be longer than 512 bytes.
- TemplateId (`templateId`, number): Template id
- User ID (`userId`, text): A user ID that identifies a user profile in Iterable. Provide an email or a userId (but not both), depending on how your project identifies users.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "code": "Success",
    "msg": "example",
    "params": {}
  }
}
```

### Unsubscribe users

Remove users from a list.

**Inputs**

- Campaign (`campaignId`, number): attribute unsubscribe to a campaign
- ChannelUnsubscribe (`channelUnsubscribe`, true/false): Unsubscribe email from list's associated channel - essentially a global unsubscribe. (default: false)
- List (`listId`, number, required): Listid.
- Subscribers (`subscribers`, list, required): Subscribers.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "createdFields": [],
    "failCount": 1,
    "failedUpdates": {
      "conflictEmails": [],
      "conflictUserIds": [],
      "forgottenEmails": [],
      "forgottenUserIds": [],
      "invalidDataEmails": [],
      "invalidDataUserIds": [],
      "invalidEmails": [],
      "invalidUserIds": [],
      "notFoundEmails": [],
      "notFoundUserIds": []
    },
    "filteredOutFields": [],
    "invalidEmails": [],
    "invalidUserIds": [],
    "successCount": 1
  }
}
```

### Update subscriptions

Update user subscriptions.

**Inputs**

- Campaign (`campaignId`, number): Campaign to attribute unsubscribes
- Email (`email`, text): An email address that identifies a user profile in Iterable. For each user in your request, provide an email or a userId (but not both), depending on how your project identifies users.
- EmailListIds (`emailListIds`, list): Lists that a user is subscribed to
- SubscribedMessageTypeIds (`subscribedMessageTypeIds`, list): Individual message type IDs to subscribe (does not impact channel subscriptions). To set a value for this field, first have your CSM enable the opt-in message types feature. Otherwise, attempting to set this field causes an error.
- TemplateId (`templateId`, number): Template to attribute unsubscribes
- UnsubscribedChannelIds (`unsubscribedChannelIds`, list): Email channel ids to unsubscribe from
- UnsubscribedMessageTypeIds (`unsubscribedMessageTypeIds`, list): Individual message type IDs to unsubscribe (does not impact channel subscriptions).
- User ID (`userId`, text): A user ID that identifies a user profile in Iterable. For each user in your request, provide an email or a userId (but not both), depending on how your project identifies users.
- ValidateChannelAlignment (`validateChannelAlignment`, true/false): Defaults to true (validation enabled). When false, allows subscribing users to message types that belong to unsubscribed channels. By default, Iterable validates that subscribed message types belong to subscribed channels. Setting this to false bypasses this validation, allowing you to save message type preferences even when the parent channel is unsubscribed. Users won't receive messages from these types while the channel remains unsubscribed, but their pr

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "code": "Success",
    "msg": "example",
    "params": {}
  }
}
```

### Update user

Update user data.

**Inputs**

- CreateNewFields (`createNewFields`, true/false): Whether new fields should be ingested and added to the schema. Defaults to project's setting to allow or drop unrecognized fields.
- DataFields (`dataFields`, object): Data to store on the user profile identified by userId or email.
- Email (`email`, text): An email address that identifies a user profile in Iterable. Provide an email or a userId (but not both), depending on how your project identifies users.
- MergeNestedObjects (`mergeNestedObjects`, true/false): Merge top-level objects instead of overwriting them. Defaults to false. For example, if a user profile has data {"mySettings":{"mobile":true}} and the request has data {"mySettings":{"email":true}}, merging results in {"mySettings":{"mobile":true,"email":true}}.
- PreferUserId (`preferUserId`, true/false): Whether or not a new user should be created if the request includes a userId that doesn't yet exist in the Iterable project. Defaults to false. Only respected in API calls for email-based projects.
- User ID (`userId`, text): A user ID that identifies a user profile in Iterable. Provide an email or a userId (but not both), depending on how your project identifies users.

**Outputs**

- `data` (object): The result returned by Iterable.

**Example output**

```json
{
  "data": {
    "code": "Success",
    "msg": "example",
    "params": {}
  }
}
```
