---
title: getMailingIdByWaveId
slug: campaign/docs/getmailingidbywaveid
docTags: 
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](docId:8614LzL6N46xyC7AXeAr0) |

**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)
```
