# Optimove

> Read customers, segments and campaigns, update customers, manage email unsubscribes and send transactional emails.

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

## Actions

### Add email unsubscribes

Add email addresses to a brand's unsubscribe list, so its emails no longer reach them.

**Inputs**

- Brand ID (`brand_id`, number, required): The ID of your Optimove email brand. At least 0.
- Emails (`emails`, list, required): The email addresses to unsubscribe, up to 200.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

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

### Add or update customer

Add a customer, or update an existing customer's attributes. Optimove accepts the change at once and applies it within a few minutes. Needs Customer Ingestion turned on for your tenant.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's ID, as your systems keep it.
- Attributes (`attributes`, object): Attribute names (as List customer attributes gives them) and the value for each, such as Email and Country.
- Callback URL (`callback_url`, text): A web address Optimove sends the outcome to once it is applied.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

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

### Delete customers

Delete customers added through the API, the SDK or Imported Customers. Customers from the daily batch are refused. Optimove accepts the request at once and applies it within a few minutes.

**Inputs**

- Customer IDs (`customer_ids`, list, required): The IDs of the customers to delete, up to 10,000.
- Callback URL (`callback_url`, text): A web address Optimove sends the outcome to, with any customers it refused.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

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

### Get API key permissions

Get the channels and customer attributes the API key is allowed to use.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

```json
{
  "data": {
    "AllowedAll": true,
    "AllowedAttributes": [
      {
        "AliasFieldName": "example",
        "CharacterMaximumLength": 1,
        "DataType": "example",
        "RealFieldName": "example"
      }
    ],
    "AllowedChannels": [
      {
        "ChannelId": 1,
        "Name": "example"
      }
    ]
  }
}
```

### Get campaign

Get a campaign's target group, channels, group sizes, type and status.

**Inputs**

- Campaign ID (`campaign_id`, number, required): The campaign's ID. At least 1.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

```json
{
  "data": {
    "CampaignType": "example",
    "Channels": [
      {
        "Id": 1,
        "Name": "example"
      }
    ],
    "ControlGroupSize": 1,
    "Duration": 1,
    "Error": "example",
    "IsMultiChannel": true,
    "IsRecurrence": true,
    "LeadTime": 1,
    "Notes": "example",
    "Status": "example",
    "Tags": [
      {}
    ],
    "TargetGroupID": 1,
    "TestGroupSize": 1
  }
}
```

### Get customer

Get one customer's attributes and their values.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's ID, as your systems give it to Optimove.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "Alias": "example",
      "FieldType": "example",
      "RealFieldName": "example",
      "Value": "example"
    }
  ]
}
```

### Get customer's last action

Get the last marketing action a customer received: the action, the day, its duration and the target group.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's ID.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

```json
{
  "data": {
    "ActionID": 1,
    "Date": "example",
    "Duration": 1,
    "TargetGroupID": 1
  }
}
```

### Get last data update

Get the latest day whose customer data Optimove has finished processing, usually yesterday.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

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

### List actions

List the marketing actions defined in Optimove, with their IDs.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "ActionID": 1,
      "ActionName": "example"
    }
  ]
}
```

### List campaigns run on a day

List the campaigns run on a day, with their target group, type, duration and status. Failed campaigns aren't listed.

**Inputs**

- Date (`date`, date, required): The day the campaigns ran.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "CampaignID": 1,
      "CampaignType": "example",
      "Duration": 1,
      "Error": "example",
      "IsMultiChannel": true,
      "IsRecurrence": true,
      "LeadTime": 1,
      "Notes": "example",
      "Status": "example",
      "TargetGroupID": 1
    }
  ]
}
```

### List channel templates

List the templates of a channel, with their IDs.

**Inputs**

- Channel (`channel_id`, number, required): The channel. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "TemplateID": 1,
      "TemplateName": "example"
    }
  ]
}
```

### List channels

List the channels campaigns have been sent through, with their IDs.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "ChannelId": 1,
      "ChannelName": "example"
    }
  ]
}
```

### List customer attribute changes

List customers whose value of one attribute changed since the day before, with the value before and after.

**Inputs**

- Attribute (`changed_attribute`, text, required): The attribute whose changes to list, such as OptimailUnsubscribed.
- Customer attributes (`customer_attributes`, list): Customer attributes to add to each customer returned, up to 10, such as Email or Country.
- Limit (`limit`, number): The most customers to return. Optimove returns 10,000 unless told otherwise. From 1 to 200000.
- Skip (`skip`, number): How many customers to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "CustomerAttributes": [
        "example"
      ],
      "CustomerID": "example",
      "FinalCustomerAttribute": "example",
      "InitialCustomerAttribute": "example"
    }
  ]
}
```

### List customer attributes

List the customer attributes available, by the name other steps take, with a description of each.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "Description": "example",
      "RealFieldName": "example"
    }
  ]
}
```

### List customers in campaigns now

List the customers in one or more running campaigns, with the campaign, action and dates.

**Inputs**

- Customer attributes (`customer_attributes`, list): Customer attributes to add to each customer returned, up to 10, such as Email or Country.
- Limit (`limit`, number): The most customers to return. Optimove returns 10,000 unless told otherwise. From 1 to 200000.
- Skip (`skip`, number): How many customers to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "ActionID": 1,
      "CampaignID": 1,
      "CustomerAttributes": [
        "example"
      ],
      "CustomerID": "example",
      "EndDate": "example",
      "StartDate": "example"
    }
  ]
}
```

### List customers in value segment

List the customers in a value segment now.

**Inputs**

- Value segment (`value_segment_id`, number, required): The value segment. At least 0.
- Customer attributes (`customer_attributes`, list): Customer attributes to add to each customer returned, up to 10, such as Email or Country.
- Limit (`limit`, number): The most customers to return. Optimove returns 10,000 unless told otherwise. From 1 to 200000.
- Skip (`skip`, number): How many customers to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "CustomerAttributes": [
        "example"
      ],
      "CustomerID": "example"
    }
  ]
}
```

### List customers sent campaigns on a day

List the customers sent campaigns on a day, with the action, recipient group and channel of each.

**Inputs**

- Date (`date`, date, required): The day the campaigns were sent.
- Customer attributes (`customer_attributes`, list): Customer attributes to add to each customer returned, up to 10, such as Email or Country.
- Limit (`limit`, number): The most customers to return. Optimove returns 10,000 unless told otherwise. From 1 to 200000.
- Skip (`skip`, number): How many customers to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "ActionID": 1,
      "ChannelID": 1,
      "CustomerAttributes": [
        "example"
      ],
      "CustomerID": "example",
      "RecipientGroupID": 1
    }
  ]
}
```

### List email unsubscribes

List the email addresses on a brand's unsubscribe list, optionally only those added between two days.

**Inputs**

- Brand ID (`brand_id`, number, required): The ID of your Optimove email brand. Your Customer Success Manager can tell you it. At least 0.
- Start date (`start_date`, date): Only addresses unsubscribed on or after this day.
- End date (`end_date`, date): Only addresses unsubscribed on or before this day.
- Limit (`limit`, number): The most addresses to return, up to 10,000. From 1 to 10000.
- Skip (`skip`, number): How many addresses to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "Email": "example",
      "UnsubscribedTime": "example"
    }
  ]
}
```

### List microsegments

List the microsegments of Optimove's customer model, with their lifecycle stage, future value and churn rate.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "ChurnRate": 1,
      "ConversionProbability": 1,
      "FutureValue": 1,
      "LifecycleStageID": "example",
      "MicrosegmentID": 1,
      "MicrosegmentName": "example",
      "ReactivationRate": 1
    }
  ]
}
```

### List target groups

List the target groups defined in Optimove, with their IDs and priorities.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "TargetGroupID": 1,
      "TargetGroupName": "example",
      "TargetGroupPriority": 1
    }
  ]
}
```

### List transactional email templates

List the transactional email templates, with their content and settings.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "TemplateAttributes": [
        "example"
      ],
      "TemplateContent": "example",
      "TemplateID": 1,
      "TemplateName": "example"
    }
  ]
}
```

### List value segment changes

List customers whose value segment changed between two days, with the segment before and after.

**Inputs**

- Start date (`start_date`, date, required): The first day to compare.
- End date (`end_date`, date, required): The last day to compare.
- Customer attributes (`customer_attributes`, list): Customer attributes to add to each customer returned, up to 10, such as Email or Country.
- Limit (`limit`, number): The most customers to return. Optimove returns 10,000 unless told otherwise. From 1 to 200000.
- Skip (`skip`, number): How many customers to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "CustomerAttributes": [
        "example"
      ],
      "CustomerID": "example",
      "FinalValueSegmentID": 1,
      "InitialValueSegmentID": 1
    }
  ]
}
```

### List value segments

List the value segments defined in Optimove, with their IDs.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Optimove.

**Example output**

```json
{
  "data": [
    {
      "ValueSegmentID": 1,
      "ValueSegmentName": "example"
    }
  ]
}
```

### Remove email unsubscribe

Take an email address off a brand's unsubscribe list.

**Inputs**

- Brand ID (`brand_id`, number, required): The ID of your Optimove email brand. At least 0.
- Email (`email`, text, required): The email address to take off the list.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

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

### Send transactional email

Send a transactional email template to up to 200 people, now or at a set time.

**Inputs**

- Template (`template_id`, number, required): The transactional template to send. At least 1.
- Recipients (`recipients`, list, required): The email addresses to send to, up to 200.
- Personalizations (`personalizations`, object): Template tags and the value for each, such as [%TRANS:FIRST_NAME%] and Vivienne. The same values go to every recipient.
- Schedule time (`schedule_time`, date and time): When to send it. Leave empty to send now.
- BCC (`bcc`, list): Email addresses to copy in secretly.
- Unique message ID (`unique_message_id`, text): An ID of your own for this send, so sending it twice is refused. Up to 254 characters.

**Outputs**

- `data` (object): The response from Optimove.

**Example output**

```json
{
  "data": {
    "Error": "example",
    "IsSuccess": true,
    "SendID": 1
  }
}
```
