---
updatedAt: 2026-04-21T04:23:54.000Z
agentTools:
  projectIndex: https://developer.blueshift.com/llms.txt
---

# Live content

Use this endpoint to insert content recommendations in your website and mobile apps.

## API at a glance

**Description:** This API allows you to insert personalized content recommendations in your website and mobile apps. It returns dynamic content based on user identity and context, including product recommendations and tracking URLs.

## Authentication & testing

<details>
  <summary><strong>Testing the API on this page</strong></summary>

  <h3>How to try it here</h3>

  <ul>
    <li>Use your <strong>User API Key</strong> as the <strong>Username</strong> (leave <strong>Password</strong> blank).</li>

<Image align="center" border={true} width="100% " src="https://files.readme.io/c11a123983769d19ed808108a287068e6ddab2f279c4771a8f34c47fb8c6a40d-Account-Settings-User-API.png" className="border" />

<li>Select the appropriate API endpoint based on your Blueshift region.</li>

    <img src="https://files.readme.io/a567ea5d40fd528b7651d01be5932921690ecbe9786b366284cb2bd48f05ff7d-API_-_Select_Region_-_With_Highlights.png" alt="API - Select Region" width="75%" />

    <li>Enter the necessary parameters and click <strong>Try It</strong> to run the request.</li>
  </ul>
</details>

<details>
  <summary><strong>Authentication using Base64 encoding</strong></summary>

  <h3>Note for developers</h3>

  <p>
    API requests require authentication using HTTP Basic Authentication with an API key.
    The API key serves as the username, while the password field should be left empty.
    The format to encode is: <code>your\_api\_key:</code> (note the trailing colon).
  </p>

  <p>
    This string must be Base64-encoded and included in the request's Authorization header
    as follows:
  </p>

  <pre><code>Authorization: Basic encoded\_value</code></pre>

  <p>
    You can generate the encoded value using a trusted
    <a href="https://gchq.github.io/CyberChef/#recipe=To_Base64('A-Za-z0-9%2B/%3D')" target="_blank">Base64 encoder</a>.
  </p>
</details>

***

<h4>Postman collection</h4>

<p>
  <strong>Try it with Postman:</strong>
  Explore the API using <a href="https://developer.blueshift.com/reference/test-apis#postman-collection" target="_blank">Blueshift's Postman collection.</a>
</p>

***

## Things to know before you start

* **Slot configuration:** The slot name must be registered in the Blueshift app before making API calls.
* **User identification:** Provide at least one user identifier (customer\_id, email, cookie, or device\_id) in the `user` object.
* **Context parameters:** Use `context` to refine recommendations with seed items, exclusions, and pagination.
* **Tracking URLs:** The response includes `impression_url` and `click_url` for tracking user interactions.
* **Use case:** Best for powering recommendation widgets, personalized carousels, dynamic product sections, and real-time content personalization.

## Request parameters

<details>
  <summary><strong>Check out the request parameters</strong></summary>

### **Body parameters**

| Parameter | Type     | Required | Description                                                                            |
| :-------- | :------- | :------- | :------------------------------------------------------------------------------------- |
| `slot`    | `string` | ✅ Yes    | Specify the name of the slot as registered on the Blueshift app.                       |
| `api_key` | `string` | ✅ Yes    | Specify the Event API key from your account settings.                                  |
| `user`    | `object` | ✅ Yes    | User identification object. See structure below.                                       |
| `context` | `object` | ❌ No     | Context for recommendations (seed items, exclusions, pagination). See structure below. |

### **User object**

> **Note:** Provide at least one user identifier.

| Parameter     | Type     | Description                                                |
| :------------ | :------- | :--------------------------------------------------------- |
| `customer_id` | `string` | Specify the customer ID of the user.                       |
| `email`       | `string` | Specify the email address of the user.                     |
| `cookie`      | `string` | Specify the user's Blueshift cookie (for anonymous users). |
| `device_id`   | `string` | Specify the UUID of the device.                            |

### **Context object**

| Parameter            | Type      | Description                                                                  |
| :------------------- | :-------- | :--------------------------------------------------------------------------- |
| `seed_item_ids`      | `array`   | IDs of items that form the basis of replay or related items recommendations. |
| `exclude_item_ids`   | `array`   | IDs of items to exclude from the response.                                   |
| `exclude_categories` | `array`   | Categories to exclude from the response.                                     |
| `page_number`        | `integer` | Page number for paginated recommendations (if pagination is enabled).        |

</details>

## Example requests & responses

<details>
  <summary><strong>Get live content recommendations</strong></summary>

**Request**

```bash
curl --request POST \
     --url https://api.getblueshift.com/live \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
       "slot": "Promotions_Homepage_Carousel_JSON",
       "api_key": "<YOUR_EVENT_API_KEY>",
       "user": {
         "customer_id": "812123",
         "email": "janedoe@acme.com"
       },
       "context": {
         "seed_item_ids": ["item_1", "item_2"],
         "exclude_categories": ["clearance"],
         "page_number": 1
       }
     }'
```

**Response**

```json
{
  "content": {
    "products": [
      {
        "image_url": "https://images.randomhouse.com/cover/9780140437911",
        "name": "Saint Joan",
        "price": 14,
        "sku": "9780140437911",
        "url": "http://www.blueshiftreads.com/products/drama-european-english-irish-scottish-welsh/saint-joan"
      },
      {
        "image_url": "https://images.randomhouse.com/cover/9780142410806",
        "name": "Free Baseball",
        "price": 5.99,
        "sku": "9780142410806",
        "url": "http://www.blueshiftreads.com/products/juvenile-fiction-sports-recreation-baseball-softball/free-baseball"
      }
    ],
    "user": {
      "firstname": "Jane",
      "lastname": "Doe"
    }
  },
  "feedback": {
    "errors": [],
    "selected_experiment_uuid": "175d4f44-f1f0-438c-ad38-f4ede2047974",
    "selected_trigger_uuid": "d181abb6-d5d5-4120-8c9b-c0de724576d6",
    "skipped_triggers": {
      "d181abb6-d5d5-4120-8c9b-c0de724576d6": "Active ( launch preview simulation is enabled )"
    }
  },
  "success": true,
  "tracking": {
    "click_url": "http://api.getblueshift.com/track?uid=d1a50376-4f62-46d0-b4a3-36ca0bd2f9cc&eid=175d4f44-f1f0-438c-ad38-f4ede2047974&mid=42a62e43-438a-4cf9-ac1d-a24706fe3065&a=click",
    "impression_url": "http://api.getblueshift.com/track?uid=d1a50376-4f62-46d0-b4a3-36ca0bd2f9cc&eid=175d4f44-f1f0-438c-ad38-f4ede2047974&mid=42a62e43-438a-4cf9-ac1d-a24706fe3065&a=open"
  }
}
```

</details>

<details>
<summary><strong>API error responses</strong></summary>

<Callout icon="📘" theme="info">
  ### Note

  The following error codes are commonly returned by Blueshift APIs. Depending on the specific endpoint, not all may apply.
</Callout>

<Table>
  <thead>
    <tr>
      <th>
        Status code
      </th>

      <th>
        Description
      </th>

      <th>
        Example responses
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **400 Bad Request**
      </td>

      <td>
        The request is invalid due to missing or incorrect parameters. This includes missing fields, invalid values, formatting issues, or conflicts such as duplicate data.
      </td>

      <td>
        `{ "errors": { "name": ["can't be blank"] } }`

        `{ "errors": { "startdate": ["can't be blank"] } }`
      </td>
    </tr>

    <tr>
      <td>
        **401 Unauthorized**
      </td>

      <td>
        API authentication failed due to an invalid or missing API key.
      </td>

      <td>
        `{ "message": "Not authorized" }`
      </td>
    </tr>

    <tr>
      <td>
        **403 Forbidden**
      </td>

      <td>
        The API key does not have sufficient permissions to perform this action.
      </td>

      <td>
        `{ "message": "Permission denied" }`
      </td>
    </tr>

    <tr>
      <td>
        **404 Not Found**
      </td>

      <td>
        The specified campaign was not found. Verify the campaign UUID.
      </td>

      <td>
        `{ "message": "Campaign not found" }`
      </td>
    </tr>

    <tr>
      <td>
        **422 Unprocessable Entity**
      </td>

      <td>
        * The campaign cannot be paused due to its current status (e.g., already completed or archived).
        * One or more scheduling parameters may be invalid (if applicable).
      </td>

      <td>
        `{ "message": "Campaign cannot be paused in its current status." }`

        `{ "message": "Invalid schedule values" }`
      </td>
    </tr>

    <tr>
      <td>
        **429 Too Many Requests**
      </td>

      <td>
        The request limit has been exceeded. Reduce request frequency.
      </td>

      <td>
        `{ "message": "Rate limit exceeded" }`
      </td>
    </tr>

    <tr>
      <td>
        **500 Internal Server Error**
      </td>

      <td>
        An unexpected server error occurred. Contact support if the issue persists.
      </td>

      <td>
        `{ "message": "Internal Server Error - Please contact support for more information." }`
      </td>
    </tr>

    <tr>
      <td>
        **502 Bad Gateway**
      </td>

      <td>
        The server received an invalid response. Retry the request.
      </td>

      <td>
        `{ "message": "Bad Gateway - Please retry the request." }`
      </td>
    </tr>

    <tr>
      <td>
        **503 Service Unavailable**
      </td>

      <td>
        The service is temporarily unavailable. Try again later.
      </td>

      <td>
        `{ "message": "Service Unavailable - The service is temporarily unavailable. Try again later." }`
      </td>
    </tr>

    <tr>
      <td>
        **504 Gateway Timeout**
      </td>

      <td>
        The server took too long to respond. Retry the request with exponential backoff.
      </td>

      <td>
        `{ "message": "Gateway Timeout - The server took too long to respond. Retry with exponential backoff." }`
      </td>
    </tr>
  </tbody>
</Table>

</details>

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "These APIs will help you manage different workflows in Blueshift. Our powerful REST APIs provide an easy way to integrate your data and third party applications with Blueshift.",
    "version": "1.0.0",
    "title": "Blueshift APIs",
    "contact": {
      "email": "support@getblueshift.com"
    }
  },
  "tags": [
    {
      "name": "Live content",
      "description": "Use the Live content API endpoint to insert content recommendations in your website and mobile apps."
    }
  ],
  "paths": {
    "/live": {
      "post": {
        "summary": "Live content",
        "description": "Use this endpoint to insert content recommendations in your website and mobile apps.",
        "tags": [
          "Live content"
        ],
        "security": [
          {
            "event_api_auth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slot": {
                    "type": "string",
                    "description": "Specify the name of the slot on your website as registered on the Blueshift app.",
                    "example": "Promotions_Homepage_Carousel_JSON"
                  },
                  "api_key": {
                    "type": "string",
                    "description": "Specify the Event API key that you get from the account settings page of the Blueshift app.",
                    "example": "<YOUR_API_KEY>"
                  },
                  "user": {
                    "type": "object",
                    "properties": {
                      "customer_id": {
                        "type": "string",
                        "description": "Specify the customer ID of the user.",
                        "example": "812123"
                      },
                      "email": {
                        "type": "string",
                        "description": "Specify the email address of the user.",
                        "example": "janedoe@acme.com"
                      },
                      "cookie": {
                        "type": "string",
                        "description": "Specify the user's Blueshift cookie as an identifier for anonymous users.",
                        "example": "8d74322c-7bb6-44f1-18ce-6a92c5a9672f"
                      },
                      "device_id": {
                        "type": "string",
                        "description": "Specify the UUID of the device.",
                        "example": "8abe3faa-d48d-4e4a-00ca-beae01f1c987"
                      }
                    }
                  },
                  "context": {
                    "type": "object",
                    "properties": {
                      "seed_item_ids": {
                        "type": "array",
                        "description": "Specify the IDs of the items that form the basis of replay or related items.",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "<item_id_1>",
                          "<item_id_2>",
                          "..."
                        ]
                      },
                      "exclude_item_ids": {
                        "type": "array",
                        "description": "Specify the IDs of the items that should be excluded from the response.",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "<item_id_1>",
                          "<item_id_2>",
                          "..."
                        ]
                      },
                      "exclude_categories": {
                        "type": "array",
                        "description": "Specify the categories that should be excluded from the response.",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "category1",
                          "category2",
                          "..."
                        ]
                      },
                      "page_number": {
                        "type": "integer",
                        "description": "Specify this value to get more pages of recommendations if pagination is enabled for your account.",
                        "example": 2
                      }
                    }
                  }
                }
              }
            }
          },
          "description": "Create a live content campaign and enter the campaign name, select the target segment, flight dates, the slot name and the JSON template"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "object",
                      "properties": {
                        "products": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "image_url": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "price": {
                                "type": "number"
                              },
                              "sku": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            }
                          },
                          "example": [
                            {
                              "image_url": "https://images.randomhouse.com/cover/9780140437911",
                              "name": "Saint Joan",
                              "price": 14,
                              "sku": 9780140437911,
                              "url": "http://www.blueshiftreads.com/products/drama-european-english-irish-scottish-welsh/saint-joan"
                            },
                            {
                              "image_url": "https://images.randomhouse.com/cover/9780142410806",
                              "name": "Free Baseball",
                              "price": 5.99,
                              "sku": 9780142410806,
                              "url": "http://www.blueshiftreads.com/products/juvenile-fiction-sports-recreation-baseball-softball/free-baseball"
                            }
                          ]
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "firstname": {
                              "type": "string",
                              "example": "Jane"
                            },
                            "lastname": {
                              "type": "string",
                              "description": "The last name of the customer.",
                              "example": "Doe"
                            }
                          }
                        }
                      }
                    },
                    "feedback": {
                      "type": "object",
                      "properties": {
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "selected_experiment_uuid": {
                          "type": "string",
                          "example": "175d4f44-f1f0-438c-ad38-f4ede2047974"
                        },
                        "selected_trigger_uuid": {
                          "type": "string",
                          "example": "d181abb6-d5d5-4120-8c9b-c0de724576d6"
                        },
                        "skipped_triggers": {
                          "type": "object",
                          "properties": {
                            "d181abb6-d5d5-4120-8c9b-c0de724576d6": {
                              "type": "string",
                              "example": "Active ( launch preview simulation is enabled )"
                            }
                          }
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "tracking": {
                      "type": "object",
                      "properties": {
                        "click_url": {
                          "type": "string",
                          "example": "http://api.getblueshift.com/track?uid=d1a50376-4f62-46d0-b4a3-36ca0bd2f9cc&eid=175d4f44-f1f0-438c-ad38-f4ede2047974&mid=42a62e43-438a-4cf9-ac1d-a24706fe3065&a=click"
                        },
                        "impression_url": {
                          "type": "string",
                          "example": "http://api.getblueshift.com/track?uid=d1a50376-4f62-46d0-b4a3-36ca0bd2f9cc&eid=175d4f44-f1f0-438c-ad38-f4ede2047974&mid=42a62e43-438a-4cf9-ac1d-a24706fe3065&a=open"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request is invalid due to missing or incorrect parameters. This includes missing fields, invalid values, formatting issues, or conflicts such as duplicate data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - API authentication failed due to an invalid or missing API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Not authorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - The API key does not have sufficient permissions to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The requested resource was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity - The request was well-formed but contains semantic errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "Validation failed"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - The request limit has been exceeded. Reduce request frequency.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - An unexpected server error occurred. Contact support if the issue persists.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Internal Server Error"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway - The server received an invalid response. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Bad Gateway"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable - The service is temporarily unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Service Unavailable"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout - The server took too long to respond. Retry the request with exponential backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Gateway Timeout"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.getblueshift.com"
    },
    {
      "url": "https://api.eu.getblueshift.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "event_api_auth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```