Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 172 additions & 0 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ All URIs are relative to *https://api.onesignal.com*
| [**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
| [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app |
| [**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps |
| [**get_email_provider_metrics**](DefaultApi.md#get_email_provider_metrics) | **GET** /apps/{app_id}/email_analytics/provider_metrics | Get email inbox provider metrics |
| [**get_email_provider_metrics_timeseries**](DefaultApi.md#get_email_provider_metrics_timeseries) | **GET** /apps/{app_id}/email_analytics/provider_metrics_timeseries | Get email inbox provider metrics over time |
| [**get_email_reputation**](DefaultApi.md#get_email_reputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics |
| [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification |
| [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History |
Expand Down Expand Up @@ -2363,6 +2365,176 @@ This endpoint does not need any parameter.
- **Accept**: application/json


## get_email_provider_metrics

> <EmailProviderMetricsResponse> get_email_provider_metrics(app_id, domain, start, _end)

Get email inbox provider metrics

Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending.

### Examples

```ruby
require 'onesignal'
# setup authorization
OneSignal.configure do |config|
# Configure Bearer authorization: rest_api_key
config.rest_api_key = 'YOUR_REST_API_KEY'

end

api_instance = OneSignal::DefaultApi.new
app_id = 'YOUR_APP_ID' # String | Your OneSignal App ID in UUID v4 format.
domain = 'mail.example.com' # String | The sending domain to report on. Must be an email domain configured for this app.
start = Time.parse('2026-08-01T00:00Z') # Time | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`).
_end = Time.parse('2026-08-08T00:00Z') # Time | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`).

begin
# Get email inbox provider metrics
result = api_instance.get_email_provider_metrics(app_id, domain, start, _end)
p result
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->get_email_provider_metrics: #{e}"
puts "Status Code: #{e.code}"
# `e.error_messages` flattens any error-envelope shape to an Array<String>;
# the raw body remains on `e.response_body`.
puts "Error Messages: #{e.error_messages}"
puts "Response Body: #{e.response_body}"
end
```

#### Using the get_email_provider_metrics_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> <Array(<EmailProviderMetricsResponse>, Integer, Hash)> get_email_provider_metrics_with_http_info(app_id, domain, start, _end)

```ruby
begin
# Get email inbox provider metrics
data, status_code, headers = api_instance.get_email_provider_metrics_with_http_info(app_id, domain, start, _end)
p status_code # => 2xx
p headers # => { ... }
p data # => <EmailProviderMetricsResponse>
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->get_email_provider_metrics_with_http_info: #{e}"
puts "Status Code: #{e.code}"
puts "Response Body: #{e.response_body}"
end
```

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
| **domain** | **String** | The sending domain to report on. Must be an email domain configured for this app. | |
| **start** | **Time** | Start of the reporting window, as an ISO 8601 timestamp (for example, &#x60;2026-08-01T00:00:00Z&#x60;). | |
| **_end** | **Time** | End of the reporting window, as an ISO 8601 timestamp (for example, &#x60;2026-08-08T00:00:00Z&#x60;). | |

### Return type

[**EmailProviderMetricsResponse**](EmailProviderMetricsResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-ruby-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## get_email_provider_metrics_timeseries

> <EmailProviderMetricsTimeseriesResponse> get_email_provider_metrics_timeseries(app_id, domain, start, _end, granularity, opts)

Get email inbox provider metrics over time

Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending.

### Examples

```ruby
require 'onesignal'
# setup authorization
OneSignal.configure do |config|
# Configure Bearer authorization: rest_api_key
config.rest_api_key = 'YOUR_REST_API_KEY'

end

api_instance = OneSignal::DefaultApi.new
app_id = 'YOUR_APP_ID' # String | Your OneSignal App ID in UUID v4 format.
domain = 'mail.example.com' # String | The sending domain to report on. Must be an email domain configured for this app.
start = Time.parse('2026-08-01T00:00Z') # Time | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`).
_end = Time.parse('2026-08-08T00:00Z') # Time | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`).
granularity = 'hourly' # String | The size of each time bucket. Hourly data is only available for the last 60 days.
opts = {
providers: ['gmail'] # Array<String> | Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us
}

begin
# Get email inbox provider metrics over time
result = api_instance.get_email_provider_metrics_timeseries(app_id, domain, start, _end, granularity, opts)
p result
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->get_email_provider_metrics_timeseries: #{e}"
puts "Status Code: #{e.code}"
# `e.error_messages` flattens any error-envelope shape to an Array<String>;
# the raw body remains on `e.response_body`.
puts "Error Messages: #{e.error_messages}"
puts "Response Body: #{e.response_body}"
end
```

#### Using the get_email_provider_metrics_timeseries_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> <Array(<EmailProviderMetricsTimeseriesResponse>, Integer, Hash)> get_email_provider_metrics_timeseries_with_http_info(app_id, domain, start, _end, granularity, opts)

```ruby
begin
# Get email inbox provider metrics over time
data, status_code, headers = api_instance.get_email_provider_metrics_timeseries_with_http_info(app_id, domain, start, _end, granularity, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <EmailProviderMetricsTimeseriesResponse>
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->get_email_provider_metrics_timeseries_with_http_info: #{e}"
puts "Status Code: #{e.code}"
puts "Response Body: #{e.response_body}"
end
```

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
| **domain** | **String** | The sending domain to report on. Must be an email domain configured for this app. | |
| **start** | **Time** | Start of the reporting window, as an ISO 8601 timestamp (for example, &#x60;2026-08-01T00:00:00Z&#x60;). | |
| **_end** | **Time** | End of the reporting window, as an ISO 8601 timestamp (for example, &#x60;2026-08-08T00:00:00Z&#x60;). | |
| **granularity** | **String** | The size of each time bucket. Hourly data is only available for the last 60 days. | |
| **providers** | [**Array&lt;String&gt;**](String.md) | Inbox providers to include in the totals. Omit to include all providers. Accepted values: &#x60;apple&#x60;, &#x60;att&#x60;, &#x60;canadian&#x60;, &#x60;chinese&#x60;, &#x60;comcast&#x60;, &#x60;free_fr&#x60;, &#x60;french&#x60;, &#x60;german&#x60;, &#x60;gmail&#x60;, &#x60;google_workspace&#x60;, &#x60;googlers&#x60;, &#x60;inbox_lv&#x60;, &#x60;italian&#x60;, &#x60;japanese&#x60;, &#x60;outlook_365&#x60;, &#x60;outlook_eu&#x60;, &#x60;outlook_us&#x60;, &#x60;proton&#x60;, &#x60;rackspace&#x60;, &#x60;russian&#x60;, &#x60;uk&#x60;, &#x60;united_online&#x60;, &#x60;yahoo_eu&#x60;, &#x60;yahoo_us&#x60;, &#x60;other_eu&#x60;, &#x60;other_us&#x60;, and &#x60;other&#x60;. Example: providers[]&#x3D;gmail&amp;providers[]&#x3D;yahoo_us | [optional] |

### Return type

[**EmailProviderMetricsTimeseriesResponse**](EmailProviderMetricsTimeseriesResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-ruby-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## get_email_reputation

> <EmailReputationResponse> get_email_reputation(app_id)
Expand Down
34 changes: 34 additions & 0 deletions docs/EmailMetrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# OneSignal::EmailMetrics

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **sent** | **Integer** | The number of emails sent. | [optional] |
| **delivered** | **Integer** | The number of emails successfully delivered. | [optional] |
| **opened** | **Integer** | The total number of email opens, including repeat opens by the same recipient. | [optional] |
| **clicked** | **Integer** | The total number of email link clicks, including repeat clicks by the same recipient. | [optional] |
| **unique_opened** | **Integer** | The number of emails opened at least once. | [optional] |
| **unique_clicked** | **Integer** | The number of emails with at least one link click. | [optional] |
| **failed** | **Integer** | The number of emails that failed to send. | [optional] |
| **bounced** | **Integer** | The number of emails that bounced. | [optional] |
| **complained** | **Integer** | The number of emails that recipients reported as spam. | [optional] |

## Example

```ruby
require 'onesignal'

instance = OneSignal::EmailMetrics.new(
sent: 100,
delivered: 95,
opened: 40,
clicked: 10,
unique_opened: 35,
unique_clicked: 8,
failed: 5,
bounced: 3,
complained: 1
)
```

20 changes: 20 additions & 0 deletions docs/EmailProviderMetrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# OneSignal::EmailProviderMetrics

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **provider** | **String** | The inbox provider. Known values include &#x60;apple&#x60;, &#x60;att&#x60;, &#x60;canadian&#x60;, &#x60;chinese&#x60;, &#x60;comcast&#x60;, &#x60;free_fr&#x60;, &#x60;french&#x60;, &#x60;german&#x60;, &#x60;gmail&#x60;, &#x60;google_workspace&#x60;, &#x60;googlers&#x60;, &#x60;inbox_lv&#x60;, &#x60;italian&#x60;, &#x60;japanese&#x60;, &#x60;outlook_365&#x60;, &#x60;outlook_eu&#x60;, &#x60;outlook_us&#x60;, &#x60;proton&#x60;, &#x60;rackspace&#x60;, &#x60;russian&#x60;, &#x60;uk&#x60;, &#x60;united_online&#x60;, &#x60;yahoo_eu&#x60;, &#x60;yahoo_us&#x60;, &#x60;other_eu&#x60;, &#x60;other_us&#x60;, and &#x60;other&#x60;. New providers may be added over time. | [optional] |
| **metrics** | [**EmailMetrics**](EmailMetrics.md) | | [optional] |

## Example

```ruby
require 'onesignal'

instance = OneSignal::EmailProviderMetrics.new(
provider: 'gmail',
metrics: nil
)
```

20 changes: 20 additions & 0 deletions docs/EmailProviderMetricsEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# OneSignal::EmailProviderMetricsEvent

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **date** | **Time** | The start of the time bucket, aligned to the hour, day, or month in UTC. | [optional] |
| **metrics** | [**EmailMetrics**](EmailMetrics.md) | | [optional] |

## Example

```ruby
require 'onesignal'

instance = OneSignal::EmailProviderMetricsEvent.new(
date: 2026-08-01T00:00Z,
metrics: nil
)
```

18 changes: 18 additions & 0 deletions docs/EmailProviderMetricsResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# OneSignal::EmailProviderMetricsResponse

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **providers** | [**Array&lt;EmailProviderMetrics&gt;**](EmailProviderMetrics.md) | One entry per inbox provider that received email from the domain during the reporting window. Empty when the domain is not found for the app or is not currently active for sending. | [optional] |

## Example

```ruby
require 'onesignal'

instance = OneSignal::EmailProviderMetricsResponse.new(
providers: nil
)
```

18 changes: 18 additions & 0 deletions docs/EmailProviderMetricsTimeseriesResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# OneSignal::EmailProviderMetricsTimeseriesResponse

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **events** | [**Array&lt;EmailProviderMetricsEvent&gt;**](EmailProviderMetricsEvent.md) | One entry for every time bucket in the reporting window, oldest first. Buckets with no email activity are included with all metrics set to &#x60;0&#x60;. Empty when the domain is not found for the app or is not currently active for sending. | [optional] |

## Example

```ruby
require 'onesignal'

instance = OneSignal::EmailProviderMetricsTimeseriesResponse.new(
events: nil
)
```

5 changes: 5 additions & 0 deletions lib/onesignal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
require 'onesignal/models/delivery_data'
require 'onesignal/models/duplicate_journey_overrides'
require 'onesignal/models/duplicate_journey_request'
require 'onesignal/models/email_metrics'
require 'onesignal/models/email_provider_metrics'
require 'onesignal/models/email_provider_metrics_event'
require 'onesignal/models/email_provider_metrics_response'
require 'onesignal/models/email_provider_metrics_timeseries_response'
require 'onesignal/models/email_reputation_response'
require 'onesignal/models/email_reputation_window'
require 'onesignal/models/email_warm_up'
Expand Down
Loading
Loading