---
title: getMaxRecipients
slug: campaign-dev-docs/getmaxrecipients
createdAt: 2026-07-02T19:01:44.226Z
---

**Type**: float

**Parameters**

| Name      | Type   | Value             |
| --------- | ------ | ----------------- |
| sessionId | String | ID of the session |
| mailingId | long   | ID of the mailing |

**Return values**

Number of recipients or the percentage of recipients that will receive the mailing after it has been started

The percentage is returned as a float from 0 to 1 (1 meaning 100%, see also: [isMaxRecipientsPercentage](https://docs.optimizely.com/campaign-dev-docs/ismaxrecipientspercentage). The return value -1 means **All**. See also [setMaxRecipients](https://docs.optimizely.com/campaign-dev-docs/setmaxrecipients).

**Code structure**

```javascript
float getMaxRecipients(String sessionId, long mailingId)
```
