# Blueshift

> Update customer profiles, send events, manage customer lists and catalogs, and trigger campaigns in Blueshift.

App · 28 actions. Web page: https://docs.lodol.com/docs/integrations/blueshift

## Actions

### Add a customer to a list

Add a customer to a customer list.

**Inputs**

- List ID (`list_id`, number, required): The number of the customer list, from its page in Blueshift.
- Find customer by (`identifier_key`, text, required): Whether the customer is given by email address or customer ID. One of: `email`, `customer_id` (Customer id).
- Email or customer ID (`identifier_value`, text, required): The customer's email address or customer ID.

**Outputs**

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

**Example output**

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

### Add items to a catalog

Add products to a catalog, or update the ones with the same product ID.

**Inputs**

- Catalog (`catalog_uuid`, text, required): The catalog.
- Products (`products`, list, required): The products: each needs a product_id, title, image, web_link, availability (in_stock or out_of_stock) and a category list.

**Outputs**

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

**Example output**

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

### Archive a campaign

Archive a campaign.

**Inputs**

- Campaign (`campaign_uuid`, text, required): The campaign.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived": true
  }
}
```

### Create a catalog

Create an empty product catalog to add items to.

**Inputs**

- Name (`name`, text, required): The catalog's name.

**Outputs**

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

**Example output**

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

### Create a customer list

Create an empty customer list to add customers to.

**Inputs**

- Name (`name`, text, required): The list's name.
- Description (`description`, text, required): What the list holds.
- Seed list (`is_seed_list`, true/false): Make it a seed list, for test sends.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "filename": "example",
    "id": 1,
    "is_seed_list": true,
    "source": "example",
    "status": "example",
    "updated_at": "example",
    "user_count": 1,
    "uuid": "example"
  }
}
```

### Create an email template

Create an HTML email template.

**Inputs**

- Name (`name`, text, required): The template's name.
- Subject (`subject`, text, required): The email's subject line.
- HTML content (`content`, text, required): The email's HTML.
- Preheader (`preheader`, text): The preview text shown after the subject.
- Author email (`author`, text): The email address of the template's author.
- Tags (`tag_data`, text): Tags, as a folder and its tags: `folder_name: tag1, tag2`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "status": "example",
    "uuid": "example"
  }
}
```

### Create or update a customer

Create a customer, or update the one with the same email address or customer ID.

**Inputs**

- Email (`email`, text): The customer's email address.
- Customer ID (`customer_id`, text): The customer ID your systems use.
- Phone number (`phone_number`, text): The phone number, with its country code.
- First name (`firstname`, text): The first name.
- Last name (`lastname`, text): The last name.
- Gender (`gender`, text): The gender, as your account records it.
- Unsubscribed from email (`unsubscribed`, true/false): Whether the customer is unsubscribed from email.
- Other attributes (`attributes`, object): Other attributes to set, by name, such as plan or city.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "customer": {
      "created_at": "example",
      "custom_attributes": {},
      "customer_id": "example",
      "email": "example",
      "firstname": "example",
      "joined_at": "example",
      "last_purchase_at": "example",
      "last_visit_at": "example",
      "lastname": "example",
      "lifetime_orders": 1,
      "lifetime_visits": 1,
      "phone_number": "example",
      "unsubscribed": true,
      "updated_at": "example",
      "uuid": "example"
    }
  }
}
```

### Delete a customer

Permanently delete a customer's personal data.

**Inputs**

- Email (`email`, text): The customer's email address.
- Customer ID (`customer_id`, text): The customer ID your systems use.
- Delete all matching profiles (`delete_all_matching_customers`, true/false): Delete every profile that matches, not only the first.

**Outputs**

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

**Example output**

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

### Get a catalog

Get one product catalog.

**Inputs**

- Catalog (`catalog_uuid`, text, required): The catalog.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "catalog_type": "example",
    "last_processed": "example",
    "name": "example",
    "upload_method": "example",
    "url": "example",
    "uuid": "example"
  }
}
```

### Get a customer

Get a customer's profile by their Blueshift UUID.

**Inputs**

- Customer UUID (`customer_uuid`, text, required): The customer's Blueshift UUID.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "customer": {
      "created_at": "example",
      "custom_attributes": {},
      "customer_id": "example",
      "email": "example",
      "firstname": "example",
      "joined_at": "example",
      "last_purchase_at": "example",
      "last_visit_at": "example",
      "lastname": "example",
      "lifetime_orders": 1,
      "lifetime_visits": 1,
      "phone_number": "example",
      "unsubscribed": true,
      "updated_at": "example",
      "uuid": "example"
    }
  }
}
```

### Get a customer list

Get a customer list (a custom user list) and how many customers it holds.

**Inputs**

- List ID (`list_id`, number, required): The number of the customer list, from its page in Blueshift.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "filename": "example",
    "id": 1,
    "is_seed_list": true,
    "source": "example",
    "status": "example",
    "updated_at": "example",
    "user_count": 1,
    "uuid": "example"
  }
}
```

### Get an email template

Get an email template's subject and content, and the campaigns that use it.

**Inputs**

- Email template (`template_uuid`, text, required): The email template.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "author": "example",
    "campaigns": [
      {
        "names": "example",
        "status": "example",
        "uuid": "example"
      }
    ],
    "created_at": "example",
    "name": "example",
    "resource": {
      "content": "example",
      "subject": "example"
    },
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Get customer events

List the events Blueshift has for a customer.

**Inputs**

- Customer UUID (`customer_uuid`, text, required): The customer's Blueshift UUID.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "_bsft_ts": "example",
      "customer_id": "example",
      "email": "example",
      "event": "example",
      "event_uuid": "example",
      "timestamp": "example",
      "user_uuid": "example"
    }
  ]
}
```

### Get event history

List the latest events of one name that Blueshift received, newest first.

**Inputs**

- Event name (`event_name`, text, required): The event's name, such as purchase.
- Limit (`limit`, number): How many events to return, up to 50. From 1 to 50.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "events": [
      {
        "_bsft_ts": "example",
        "customer_id": "example",
        "email": "example",
        "event": "example",
        "event_uuid": "example",
        "timestamp": "example",
        "user_uuid": "example"
      }
    ]
  }
}
```

### Get segment counts

Get how many customers a segment holds, in total and by channel.

**Inputs**

- Segment (`segment_uuid`, text, required): The segment.
- Refresh counts (`refresh`, true/false): Start working the counts out again. They update in the background.
- Channel (`channels`, text): Only count the customers reachable on this channel. One of: `users`, `email`, `push`, `sms`, `inApp`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "approxusers": 1,
    "approxusers_updated_at": "example",
    "email_users": 1,
    "in_app_users": 1,
    "push_users": 1,
    "refresh_status": "example",
    "sms_users": 1
  }
}
```

### Launch a campaign

Launch a campaign now. Archived or completed campaigns can't be launched.

**Inputs**

- Campaign (`campaign_uuid`, text, required): The campaign.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "status": "example",
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### List campaigns

List campaigns by name, status, type or date. One-time campaigns list only those that started in the last 30 days unless a start date is given.

**Inputs**

- Name contains (`name`, text): Only campaigns whose name contains this text.
- Status (`status`, text): Only campaigns with this status. One of: `draft`, `launched`, `paused`, `completed`.
- Type (`exec_term`, text): Only campaigns of this type: one time, recurring, segment triggered (on going), event triggered (transactional) or live content (onsite). One of: `one_time` (One time), `recurring`, `on_going` (On going), `transactional`, `onsite`.
- Archived (`archived`, true/false): List archived campaigns.
- Author email (`author_email`, text): Only campaigns made by the person with this email address.
- Created after (`created_after`, date and time): Only campaigns created after this time.
- Created before (`created_before`, date and time): Only campaigns created before this time.
- Started after (`startdate`, date and time): Only campaigns that started after this time.
- Page (`page`, number): The page of results, starting at 1. At least 1.
- Per page (`per_page`, number): How many results each page holds. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "archived": true,
      "author": "example",
      "created_at": "example",
      "email": "example",
      "exec_term": "example",
      "name": "example",
      "next_execution_scheduled_at": "example",
      "segment_name": "example",
      "segment_uuid": "example",
      "startdate": "example",
      "status": "example",
      "updated_at": "example",
      "uuid": "example"
    }
  ]
}
```

### List catalogs

List the product catalogs in the account.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "catalogs": [
      {
        "catalog_type": "example",
        "last_processed": "example",
        "name": "example",
        "upload_method": "example",
        "url": "example",
        "uuid": "example"
      }
    ]
  }
}
```

### List email templates

List email templates, optionally by name.

**Inputs**

- Name contains (`name`, text): Only templates whose name contains this text.
- Archived (`archived`, true/false): List archived templates instead of current ones.
- Editor (`editor_type`, text): Only templates made in this editor. One of: `html`, `visual`.
- Page (`page`, number): The page of results, starting at 1. At least 1.
- Per page (`per_page`, number): How many results each page holds. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "template": [
      {
        "author": "example",
        "created_at": "example",
        "name": "example",
        "resource": {
          "updated_at": "example"
        },
        "updated_at": "example",
        "uuid": "example"
      }
    ]
  }
}
```

### List segments

List segments, optionally by name.

**Inputs**

- Name contains (`name`, text): Only segments whose name contains this text.
- Archived (`archived`, true/false): List archived segments instead of current ones.
- Page (`page`, number): The page of results, starting at 1. At least 1.
- Per page (`per_page`, number): How many results each page holds. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "segments": [
      {
        "approxusers": 1,
        "created_at": "example",
        "email_users": 1,
        "name": "example",
        "push_users": 1,
        "sms_users": 1,
        "status": "example",
        "updated_at": "example",
        "uuid": "example",
        "version": 1
      }
    ]
  }
}
```

### List subscription groups

List the subscription groups customers can opt in to or out of.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "subscription_groups": [
      {
        "archived": true,
        "author": "example",
        "created_at": "example",
        "description": "example",
        "subscription_group_id": "example",
        "subscription_group_label": "example",
        "updated_at": "example",
        "uuid": "example"
      }
    ]
  }
}
```

### Pause a campaign

Pause a running or scheduled campaign.

**Inputs**

- Campaign (`campaign_uuid`, text, required): The campaign.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "status": "example",
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Remove a customer from a list

Take a customer out of a customer list.

**Inputs**

- List ID (`list_id`, number, required): The number of the customer list, from its page in Blueshift.
- Find customer by (`identifier_key`, text, required): Whether the customer is given by email address or customer ID. One of: `email`, `customer_id` (Customer id).
- Email or customer ID (`identifier_value`, text, required): The customer's email address or customer ID.

**Outputs**

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

**Example output**

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

### Search customers

Find customers by email address.

**Inputs**

- Email (`email`, text, required): The email address to look for.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "user": {
      "created_at": "example",
      "custom_attributes": {},
      "customer_id": "example",
      "email": "example",
      "firstname": "example",
      "joined_at": "example",
      "last_purchase_at": "example",
      "last_visit_at": "example",
      "lastname": "example",
      "lifetime_orders": 1,
      "lifetime_visits": 1,
      "phone_number": "example",
      "unsubscribed": true,
      "updated_at": "example",
      "uuid": "example"
    },
    "users": [
      {
        "created_at": "example",
        "custom_attributes": {},
        "customer_id": "example",
        "email": "example",
        "firstname": "example",
        "joined_at": "example",
        "last_purchase_at": "example",
        "last_visit_at": "example",
        "lastname": "example",
        "lifetime_orders": 1,
        "lifetime_visits": 1,
        "phone_number": "example",
        "unsubscribed": true,
        "updated_at": "example",
        "uuid": "example"
      }
    ]
  }
}
```

### Send an event

Record an event for a customer, such as a purchase or a sign-up.

**Inputs**

- Event name (`event`, text, required): The event's name, such as identify, add_to_cart or purchase.
- Email (`email`, text): The customer's email address.
- Customer ID (`customer_id`, text): The customer ID your systems use.
- Event ID (`event_uuid`, text): A unique ID for the event, so it is only recorded once.
- Event attributes (`attributes`, object): The event's other attributes, by name, such as order_id or revenue.

**Outputs**

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

**Example output**

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

### Trigger a campaign

Send an event-triggered or API-triggered campaign to one customer.

**Inputs**

- Campaign (`campaign_uuid`, text, required): The event-triggered or API-triggered campaign.
- Email (`email`, text, required): The email address of the customer to send it to.
- Transaction ID (`transaction_uuid`, text): A unique ID (a UUID) for this send, so a repeat isn't sent twice.
- High priority (`high_priority`, true/false): Process this send ahead of others.
- Attachment links (`email_attachments`, list): Links to files to attach to the email.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "success": true
  }
}
```

### Unarchive a campaign

Bring an archived campaign back.

**Inputs**

- Campaign (`campaign_uuid`, text, required): The campaign.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived": true
  }
}
```

### Update an email template

Change an email template's subject, preheader or content.

**Inputs**

- Email template (`template_uuid`, text, required): The email template.
- Subject (`subject`, text): The new subject line.
- Preheader (`preheader`, text): The new preview text.
- HTML content (`content`, text): The new HTML.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "status": "example",
    "uuid": "example"
  }
}
```
