> For the complete documentation index, see [llms.txt](https://api.senderwiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.senderwiz.com/admin/get-delivery-report.md).

# Get Delivery Report

### 📋 Get Delivery Report

Retrieve a list of all campaign delivery logs and status events for each email sent from your SenderWiz account. This endpoint supports advanced filtering, timezone-aware date filters, pagination, and both JSON and CSV output formats.

***

#### **🔹 HTTP Request**

```http
GET ADMIN-API-URL/deliveryreport
```

***

#### **🔸 Query Parameters (Optional)**

| Parameter      | Type   | Required | Description                                                                                       |
| -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------- |
| `customer_id`  | int    | No       | Filter by customer ID                                                                             |
| `campaign_id`  | int    | No       | Filter by campaign ID                                                                             |
| `date_from`    | string | No       | Filter by sent date (start). Format: `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS` with optional timezone |
| `date_to`      | string | No       | Filter by sent date (end). Format: `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS` with optional timezone   |
| `opened`       | 0/1    | No       | Filter by open status: 1=open, 0=not opened                                                       |
| `clicked`      | 0/1    | No       | Filter by click status: 1=clicked, 0=not clicked                                                  |
| `bounced`      | 0/1    | No       | Filter by bounce status: 1=bounced, 0=not bounced                                                 |
| `unsubscribed` | 0/1    | No       | Filter by unsubscribe status: 1=unsubscribed, 0=not unsubscribed                                  |
| `complaint`    | 0/1    | No       | Filter by complaint status: 1=complaint, 0=no complaint                                           |
| `server_name`  | string | No       | Filter by delivery server name (exact match)                                                      |
| `format`       | string | No       | `json` or `csv` (default is json)                                                                 |
| `page`         | int    | No       | Results page number (default 1)                                                                   |
| `page_size`    | int    | No       | Records per page (default 100, max 500)                                                           |

***

#### **🔐 Authorization Header**

Include your Admin API key:

```
X-ADMIN-API-KEY: your-admin-api-key-here
```

***

#### **Timezone-Aware Date Filtering**

You can provide timezones in your `date_from` and `date_to` using ISO 8601 offset notation:

* Use `+05:30` for IST (India), `-06:00` for US Central, `+00:00` for UTC, etc.
* **Example:** `2025-07-30 10:00:00+05:30`
* If no timezone is specified, UTC is assumed.

**URL Encoding:**

* For `+`, use `%2B` in URLs: `2025-07-01%2B05:30`
* For `-`, you can use as is: `2025-07-01-06:00`

**Returned data times** (like `delivery_date_time`, `open_time`) will also be shown in the requested timezone.

**🔸 Quick Examples**

* **All output in UTC-6:00 (US Central, no daylight savings):**

  ```html
  GET ADMIN-API-URL/deliveryreport?date_from=2025-01-01-06:00&date_to=2025-06-01-06:00
  ```
* **All output in UTC+5:30 (India):**

  ```html
  GET ADMIN-API-URL/deliveryreport?date_from=2025-01-01%2B05:30&date_to=2025-06-01%2B05:30
  ```

***

#### How Date Filters Work

* **Only a date?**
  * `2025-07-01` → treated as `2025-07-01 00:00:00`
  * `2025-07-31` → treated as `2025-07-31 00:00:00` (midnight of that day, so doesn't include the full day)
* **To include the whole last day:**
  * Use `date_to=2025-07-31 23:59:59`
* **All times are either UTC or your requested timezone (see above).**

***

**💻 PHP Example**

```php
// GET DELIVERY REPORT
$response = $endpoint->get('deliveryreport', [
    'customer_id' => 1,
    'date_from'   => '2025-07-01',
    'date_to'     => '2025-07-31',
    'opened'      => 1,
    'clicked'     => 1,
    'page'        => 1,
    'page_size'   => 100
]);

// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
```

***

**📦 Sample Dummy JSON Response**

```json
[
  {
    "customer_email": "john.doe@example.com",
    "campaign": "Summer Sale 2025",
    "list": "All Customers",
    "subscriber_email": "alice.smith@email.com",
    "delivery_server": "SMTP-US-East",
    "delivery_status": "success",
    "delivery_date_time": "2025-07-12 09:30:25", // Will be in the requested timezone
    "open": "Yes",
    "open_time": "2025-07-12 09:31:10",
    "click": "Yes",
    "click_time": "2025-07-12 09:32:00",
    "bounce": "No",
    "bounce_type": null,
    "bounce_time": null,
    "unsubscribe": "No",
    "unsubscribe_time": null,
    "complaint": "No",
    "complaint_time": null
  },
  {
    "customer_email": "john.doe@example.com",
    "campaign": "Summer Sale 2025",
    "list": "All Customers",
    "subscriber_email": "bob.jones@email.com",
    "delivery_server": "SMTP-US-East",
    "delivery_status": "success",
    "delivery_date_time": "2025-07-12 09:30:25",
    "open": "No",
    "open_time": null,
    "click": "No",
    "click_time": null,
    "bounce": "Yes",
    "bounce_type": "hard",
    "bounce_time": "2025-07-12 09:31:15",
    "unsubscribe": "No",
    "unsubscribe_time": null,
    "complaint": "No",
    "complaint_time": null
  }
]
```

***

**📄 Sample CSV Response**

Add `&format=csv` to your request URL.\
The response will be a CSV file with the same columns as above.

***

#### 🔗 **Request Examples**

Replace `ADMIN-API-URL` with your actual API endpoint URL.

#### 1. All activity for customer 1 (full date range, JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1
```

#### 2. All activity for customer 1 between July 1–31, 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31
```

#### 3. Only opened emails for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=1
```

#### 4. Only NOT opened emails for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=0
```

#### 5. Opened AND clicked emails for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=1&clicked=1
```

#### 6. Opened but NOT clicked emails for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=1&clicked=0
```

#### 7. Neither opened NOR clicked emails for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=0&clicked=0
```

#### 8. Only unsubscribed for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&unsubscribed=1
```

#### 9. Only bounced emails for customer 1 in July 2025 (JSON)

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&bounced=1
```

#### 10. All activity for customer 1 in July 2025 as CSV

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&format=csv
```

#### 11. Only NOT opened emails for customer 1 in July 2025 as CSV

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=0&format=csv
```

#### 12. Opened AND clicked emails for customer 1 in July 2025 as CSV

```
GET ADMIN-API-URL/deliveryreport?customer_id=1&date_from=2025-07-01&date_to=2025-07-31&opened=1&clicked=1&format=csv
```

***

#### **Tip:**

* Use the `X-ADMIN-API-KEY` header for all requests.
* You can combine filters like `opened`, `clicked`, `bounced`, `unsubscribed`, `complaint`, or `server_name`.
* All date/time fields are returned in the timezone requested in your filter. If no timezone is given, UTC is used.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.senderwiz.com/admin/get-delivery-report.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
