---
title: getMandatorId
slug: campaign/dev-docs/getmandatorid-mailid
createdAt: 2026-08-06T15:53:54.958Z
---

Throws an exception if the current logged in user has no permission for the client to which the mail ID belongs.

**Type**: long

**Parameters**

| Name      | Type   | Value             |
| --------- | ------ | ----------------- |
| sessionId | String | ID of the session |
| mailId    | String | Mail ID           |

**Return values**

Client ID

**Code structure**

```javascript
long getMandatorId(String sessionId, String mailId)
```
