---
url: /process-functions/security-getuserid.md
description: Get the id of a user from their email; returns 0 when the user is not found.
---

# security.getUserId&#x20;

Get the id of a user from their email; returns 0 when the user is not found.

::: warning Deprecated
Use [`userSecurity.users.getFromEmail(email).getId()`](/process-functions/userSecurity-user#getid) instead.
:::

```js
security.getUserId(email)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `email` | `string` | User's email address. |

## Returns

The user's numeric id, or `0` if the user was not found.

## Examples

```js
const userId = security.getUserId("jane.doe@example.com"); // 1234
```
