Summary of events

Use this endpoint to get a summary of counted events. By default, this endpoint returns data for the last 7 days.

API at a glance

Description: This API retrieves a summary of counted events over a specified time period. By default, it returns data for the last 7 days, including event counts, error metrics, and time-series data.

Authentication & testing

Testing the API on this page

How to try it here

  • Use your User API Key as the Username (leave Password blank).
  • User API Key Location
  • Select the appropriate API endpoint based on your Blueshift region.
  • API - Select Region
  • Enter the necessary parameters and click Try It to run the request.
Authentication using Base64 encoding

Note for developers

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: your_api_key: (note the trailing colon).

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

Authorization: Basic encoded_value

You can generate the encoded value using a trusted Base64 encoder.


Postman collection

Try it with Postman: Explore the API using Blueshift's Postman collection.


Things to know before you start

  • Default time range: Returns data for the last 7 days if no time parameters are specified.
  • Time-series data: Provides event counts broken down by date in the specified range.
  • Error tracking: Includes error metrics such as invalid user attributes and missing identifiers.
  • Event breakdown: Returns counts for both standard and custom events.
  • Clickstream page: You can view your event stream on the clickstream page. You can also view errors and download error logs there.
  • Use case: Best for monitoring event volumes, tracking trends over time, identifying errors in event tracking, and building analytics dashboards.

Request parameters

Check out the request parameters

Query parameters

Note: Both parameters are optional. If not specified, returns last 7 days of data.

ParameterTypeRequiredDescription
timestamp_startstring (ISO 8601)❌ NoSpecify a timestamp in ISO 8601 format to filter data for events that occurred after it.
timestamp_endstring (ISO 8601)❌ NoSpecify a timestamp in ISO 8601 format to filter data for events that occurred before it.

Example requests & responses

Get event summary

Request

curl --request POST \
     --url 'https://api.getblueshift.com/api/v1/event/summary.json?timestamp_start=2023-04-25T00%3A00%3A00Z&timestamp_end=2023-04-26T23%3A59%3A59Z' \
     --header 'accept: application/json' \
     --header 'authorization: Basic <YOUR_API_KEY>'

Response

{
  "events_chart_stats": [
    {
      "archives": {},
      "error": {
        "invalid_user_attributes": [10, 15, 27],
        "missing_identifier": [20, 30, 15]
      },
      "events": {
        "add_to_cart": [20, 30, 15],
        "subscription_update": [53, 42, 16]
      },
      "timelapse": ["04/25", "04/26", "04/27"]
    }
  ],
  "stats": {
    "add_to_cart": {
      "archived": false,
      "count": 375983,
      "display_name": "add_to_cart",
      "type": "standard"
    },
    "subscription_update": {
      "archived": false,
      "count": 375983,
      "display_name": "pageload",
      "type": "standard"
    }
  },
  "status": "ok",
  "timestamp_end": "2023-06-22T17:16:14.179Z",
  "timestamp_start": "2023-06-21T17:16:14.179Z"
}

Understanding the response

The response contains several key components:

Event count

The stats key contains details on each event with total counts. Filter by type for standard or custom_event.

Event distribution count

The events_chart_stats object shows event count distribution by day. The timelapse attribute contains dates in MM/DD format, and corresponding arrays show counts for each date.

Event processing errors

Error counts and distribution by day are included. Errors are categorized by type (e.g., missing_identifier, invalid_user_attributes).

Error types

Error typeDescription
es_index_errorIndexing error due to data type mismatch between event payload and backend system (e.g., string value for date parameter).
event_name_missingEvent is missing the required event attribute.
event_verification_errorEvent signature verification failed (only applicable if event verification feature is enabled).
invalid_customer_idInvalid customer_id (e.g., '0', or greater than 64 characters).
invalid_device_idDevice ID does not match the format for iOS or Android device.
invalid_emailInvalid email address.
invalid_event_attributesInvalid attributes in event payload (e.g., event name exceeds 100 characters, attributes contain script tags).
invalid_productProduct not found in catalog.
invalid_user_attributesInvalid user attributes in payload (e.g., invalid gender value).
missing_identifierMissing customer identifier (cookie, device_id, email, email_hash, or retailer_customer_id).
missing_productWhitelisted product/catalog event missing product/catalog_ids in payload.
parsing_errorUnable to parse JSON payload.
transaction_indexing_errorError while updating transaction record.
unknown_errorUnexpected processing error. Contact Blueshift support for more information.
user_lock_errorUnable to acquire lock on user.
user_not_found_errorUser not found in system.
API error responses

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

Status code

Description

Example responses

400 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.

{ "errors": { "name": ["can't be blank"] } }

{ "errors": { "startdate": ["can't be blank"] } }

401 Unauthorized

API authentication failed due to an invalid or missing API key.

{ "message": "Not authorized" }

403 Forbidden

The API key does not have sufficient permissions to perform this action.

{ "message": "Permission denied" }

404 Not Found

The specified campaign was not found. Verify the campaign UUID.

{ "message": "Campaign not found" }

422 Unprocessable Entity

  • 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).

{ "message": "Campaign cannot be paused in its current status." }

{ "message": "Invalid schedule values" }

429 Too Many Requests

The request limit has been exceeded. Reduce request frequency.

{ "message": "Rate limit exceeded" }

500 Internal Server Error

An unexpected server error occurred. Contact support if the issue persists.

{ "message": "Internal Server Error - Please contact support for more information." }

502 Bad Gateway

The server received an invalid response. Retry the request.

{ "message": "Bad Gateway - Please retry the request." }

503 Service Unavailable

The service is temporarily unavailable. Try again later.

{ "message": "Service Unavailable - The service is temporarily unavailable. Try again later." }

504 Gateway Timeout

The server took too long to respond. Retry the request with exponential backoff.

{ "message": "Gateway Timeout - The server took too long to respond. Retry with exponential backoff." }

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!