Performance summary

API at a glance

Description: This API allows you to retrieve campaign performance metrics (such as sends, opens, clicks, purchases, and revenue) for all campaigns that ran within a specific date range.

ℹ️

Note

Campaign metrics noted on the UI are calculated using the account time zone. If you want the metrics from the report API to match that of the metrics you see on the UI, edit start/end date to reflect this.

Authentication & testing

Testing the API on this page

How to try it here

  • Use your User API Key as the Username (leave Password blank).
  • 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

  • Required parameters: Both start_time and end_time are required to fetch data.
  • Date format: Timestamps must be in ISO 8601 format (e.g., 2023-10-06T20:41:21.000Z).
  • Optional filtering: You can filter results by campaign status or tag_data.
  • Performance metrics: The response includes comprehensive statistics such as sends, opens, clicks, purchases, revenue, and more.
  • Use case: Best for generating campaign performance reports, analyzing metrics across multiple campaigns, or exporting data for external analysis.

Request parameters

Check out the request parameters

Query parameters

Parameter

Type

Required

Description

start_time

string (ISO 8601)

✅ Yes

Specify a timestamp in the ISO 8601 format to filter the performance data of the campaigns that ran after it.

end_time

string (ISO 8601)

✅ Yes

Specify a timestamp in the ISO 8601 format to filter the performance data of the campaigns that ran before it.

status

string

❌ No

Specify a status to filter the campaigns.

  • Options: launched, draft, paused, completed.

tag_data

string

❌ No

Specify tags to filter the campaigns.

  • Example: tag_data=Category:Welcome

Example requests & responses

Get campaign performance summary

Request

curl --request GET \
     --url 'https://api.getblueshift.com/api/v1/campaigns.json?start_time=2023-05-05T20%3A41%3A21.000Z&end_time=2023-10-06T20%3A41%3A21.000Z&status=launched' \
     --header 'accept: application/json' \
     --header 'authorization: Basic <YOUR_API_KEY>'

Response

{
  "campaigns": [
    {
      "campaign_executing": false,
      "campaign_execution_ended_at": "2024-10-03T04:57:24.000Z",
      "campaign_execution_started_at": "2023-10-05T04:57:24.000Z",
      "created_at": "2023-10-03T04:57:24.000Z",
      "currency": "USD",
      "enddate": "2024-05-03T04:57:24.000Z",
      "exec_term": "on_going",
      "name": "Daily market tips",
      "recurring_number": 1,
      "recurring_schedule": "continuously",
      "recurring_time": "2024-01-03T14:45:00.000Z",
      "recurring_unit": "day",
      "segment_name": "Daily market tips segment",
      "segment_uuid": "9dfd5cdc-fedc-40b5-8c65-ba533c57c8bf",
      "startdate": "2024-01-02T14:45:00.000Z",
      "statistics": {
        "activations": 0,
        "add_to_carts": 0,
        "assigns": 0,
        "bounces": 0,
        "checkouts": 0,
        "clicks": 0,
        "deliveries": 0,
        "end_time": "2023-10-06T20:41:21.000Z",
        "media_spent": 0,
        "opens": 20,
        "pageloads": 5,
        "purchases": 75,
        "revenue": 19618,
        "sends": 110,
        "spam_reports": 2,
        "start_time": "2023-05-05T20:41:21.000Z",
        "timezone": "Pacific/Los_Angeles",
        "unique_clicks": 150,
        "unique_opens": 250,
        "unsubscribes": 2,
        "visits": 2160
      },
      "status": "paused",
      "updated_at": "2024-05-05T20:41:21.000Z",
      "uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
    }
  ]
}
Query Params
date-time
required
date-time
required
string
enum
Allowed:
string
Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json