Preview API Documentation for BayEngage (2.0.0)

Download OpenAPI specification:Download

This is a documentation that covers all of BayEngage's Custom APIs.

Disclaimer: These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future.

To use these APIs, authentication is required. Please refer to the V2 documentation for details on the Authentication API.

url: https://developer.targetbay.com/bayengage/v2/#tag/Authentication/paths/~1oauth2~1token/post

Insights

The Insights API delivers key email campaign metrics like opens, clicks, sales conversions, and deliverability filtered by date.

Get Products Sales Analytics

Retrieves sales analytics for products within a specified date range, including quantity sold and product details.

Authorization: This endpoint requires a bearer token with the read_preview scope

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
start_date
required
string <DD-MM-YYYY HH:MM AM/PM>
Example: start_date=01-01-2025

Start date for the sales data in dd-mm-yyyy format

end_date
required
string <DD-MM-YYYY HH:MM AM/PM>
Example: end_date=30-01-2025

End date for the sales data in d-m-yyyy format

page
integer >= 1
Default: 1
Example: page=1

The page number for pagination

limit
integer [ 1 .. 100 ]
Default: 10
Example: limit=10

The number of items to return per page

sort_by
string
Default: "desc"
Enum: "asc" "desc"
Example: sort_by=asc

Sort order for quantity sold

Responses

Response samples

Content type
application/json
{}

Get Products by Inventory Status

Retrieves a list of products filtered by inventory status insights including low inventory, high inventory, and newly added products.

Authorization: This endpoint requires a bearer token with the read_preview scope

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
insight_type
required
string
Enum: "low_inventory" "high_inventory" "newly_added"
Example: insight_type=high_inventory

Type of inventory insight to filter products

page
integer >= 1
Default: 1
Example: page=1

The page number for pagination

limit
integer [ 1 .. 100 ]
Default: 20
Example: limit=20

The number of items to return per page

Responses

Response samples

Content type
application/json
{}

Get Categories by Purchase Metrics

Retrieves a list of categories filtered by purchase analytics including most purchased, least purchased, and newly added categories.

Authorization: This endpoint requires a bearer token with the read_preview scope

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
insight_type
required
string
Enum: "most_purchased" "least_purchased"
Example: insight_type=least_purchased

Type of purchase insight to filter categories

page
integer >= 1
Default: 1
Example: page=1

The page number for pagination

limit
integer [ 1 .. 100 ]
Default: 20
Example: limit=20

The number of items to return per page

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "locale": "en",
  • "message": "OK",
  • "data": {
    }
}

Get Newly Added Categories

Retrieves a paginated list of product categories based on the newly_added insight type.Useful for identifying recently added categories in the store.

Authorization: This endpoint requires a bearer token with the read_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
insight_type
required
string
Value: "newly_added"
Example: insight_type=newly_added

Insight type for filtering categories. Must be newly_added.

page
integer >= 1
Default: 1
Example: page=1

The page number for pagination

limit
integer [ 1 .. 100 ]
Default: 20
Example: limit=20

The number of items to return per page

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "locale": "en",
  • "message": "OK",
  • "data": {
    }
}

Media

The Media API lets users fetch a list of uploaded media files through a GET and POST request. It's useful for managing assets like images and documents across campaigns and templates.

Fetch Media from Content Studio

Retrieves user-uploaded media from the BayEngage Content Studio.

Authorization: Requires Bearer Token with read_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
page
integer >= 1
Default: 1
Example: page=1

The page number for pagination.

limit
integer [ 1 .. 100 ]
Default: 10
Example: limit=10

The number of items to return per page.

format
string
Enum: "image/gif" "image/jpeg" "image/png" "image/webp"
Example: format=image/png

Filter results by file format.

source
string
Enum: "url" "file" "ai_generated"
Example: source=file

Filter results by the source of the media file.

search
string
Example: search=banner

Search media assets by name.

sort_by
string
Enum: "id:desc" "id:asc"
Example: sort_by=id:desc

Sort media by ID in ascending or descending order.

Responses

Response samples

Content type
application/json
{}

Fetch BayEngage Studio Icons

Retrieves a list of icons from BayEngage's Content Studio.

Authorization: Requires Bearer Token with read_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
page
integer >= 1
Example: page=1

Page number for pagination.

limit
integer >= 1
Example: limit=20

Number of icons to return per page.

Responses

Response samples

Content type
application/json
{}

Upload Media

Uploads an image (either base64 encoded or URL) to the preview environment.

Authorization: Requires Bearer Token with write_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
Request Body schema: application/json
image
required
string

Image base64 value or image URL

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{}

Coupon

The Coupon API lets users fetch a All the Coupon codes through a GET request. It's useful for check and verify the all available coupon codes along with values.

Get All Coupons Title

Retrieves a list of coupons with filtering, sorting, and pagination options.

Authorization: This endpoint requires a bearer token with the read_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
search
string
Example: search=sale-coupon

Search coupons by title.

type
string
Enum: "static" "dynamic" "unique" "all"
Example: type=static

Filter coupons by type.

status
string
Enum: "active" "expired" "action_needed" "all"
Example: status=active

Filter coupons by status.

sort_by
string
Enum: "created_at:desc" "created_at:asc" "id:desc" "id:asc"
Example: sort_by=created_at:desc

Sort coupons by field and order.

page
integer
Example: page=1

Page number for pagination.

limit
integer
Example: limit=20

Number of records per page.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "locale": "en",
  • "message": "OK",
  • "data": {
    }
}

Get All Coupon Codes From Specific Coupon

Retrieves coupon codes for a given coupon ID, with support for sorting, searching, filtering by type, and pagination.

Authorization: Requires a bearer token with the read_preview scope

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
path Parameters
couponId
required
integer
Example: 3065

The ID of the coupon

query Parameters
search
string
Example: search=XZ5B56

Search by coupon code

type
string
Enum: "issued_at" "claimed_at" "not-issued" "all"
Example: type=all

Filter coupon codes by type

sort_by
string
Enum: "issued_at:desc" "issued_at:asc" "claimed_at:desc" "claimed_at:asc"
Example: sort_by=issued_at:asc

Sort coupon codes by issued or claimed date

page
integer
Example: page=1

Page number for pagination

limit
integer
Example: limit=20

Number of records per page

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "locale": "en",
  • "message": "OK",
  • "data": {
    }
}

Product Attribute

The Product attribute API lets users fetch the all available product attribute through a GET request. It's useful for check and verify the all available product attribute's along with values.

Get All Product Attributes

Fetches product attributes by custom attribute, pagination, and sorting.

Authorization: Requires Bearer Token with read_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
query Parameters
search
string
Example: search=team

Use Search to Get Specific Product Attributes

page
integer
Example: page=1

Page number for pagination

limit
integer
Example: limit=10

Number of records per page

sort_by
string
Enum: "id:asc" "id:desc"
Example: sort_by=id:desc

Sort order by ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "locale": "en",
  • "message": "OK",
  • "data": {
    }
}

Get Product Attribute values

Fetches product attribute values by using custom attribute key, pagination, and sorting.

Authorization: Requires Bearer Token with read_preview scope.

**Disclaimer:** `These are experimental APIs and may be deprecated or changed without prior notice. For the most stable and up-to-date version, use the V2 APIs. These endpoints are expected to be promoted to V2 in the future`.
Authorizations:
bearerAuth
path Parameters
attributeKey
required
string
Example: team

Search by attribute handle by custom attribute

query Parameters
page
integer
Example: page=1

Page number for pagination

limit
integer
Example: limit=10

Number of records per page

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "locale": "en",
  • "message": "OK",
  • "data": {
    }
}