> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pushnotif.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Identify a user

> Link a device to your user id, and optionally update that user's metadata.

Events the device sent before this call are attributed to the user as well.

## Body

**device** `object` *required*

The [device](https://docs.pushnotif.ai/api/overview.md#the-device-object) to link.

**user\_id** `string` *required*

Your own stable user id, at most 256 characters.

**metadata** `object`

Values to merge onto the user. Keys you send are set, keys you leave out are
unchanged, and a `null` value removes the key. Values are strings, numbers,
booleans or `null`, and keep their type.

Limits: 64 keys per user, keys up to 128 characters, string values up to
1,024 characters, 32 KB in total.

## Response

**user\_id** `string`

Our id for this user.

**back\_attributed** `number`

How many of the device's earlier events were attributed to the user.

```bash cURL theme={null}
curl https://api.pushnotif.ai/v1/identify \
  -H "Authorization: Bearer pna_..." \
  -H "Content-Type: application/json" \
  -d '{
    "device": { "install_id": "6f1c..." },
    "user_id": "user_4821",
    "metadata": { "plan": "pro", "signup_days": 14 }
  }'
```

```json 200 theme={null}
{ "user_id": "9d2a...", "back_attributed": 12 }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.