---
title: getMailingIdByWaveId
slug: campaign-dev-docs/getmailingidbywaveid
createdAt: 2026-07-02T19:01:47.121Z
---

The **waveId** uniquely identifies the mailing sent with this closed loop process.

**Type**: long

**Parameters**

| Name      | Type   | Value                                                                                         |
| --------- | ------ | --------------------------------------------------------------------------------------------- |
| sessionId | String | ID of the session                                                                             |
| waveId    | long   | ID returned by [prepareNewWave](https://docs.optimizely.com/campaign-dev-docs/preparenewwave) |

**Return values**

ID of the sent mailing

Returns 0 if no mailing has yet been sent for the specified **waveId**.

**Code structure**

```javascript
long getMailingIdByWaveId(String sessionId, long waveId)
```
