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

# Identify a user

> Identifying users, and using external events as triggers in journeys.

> [!NOTE]
>
> For a walkthrough check out this [guide](getting-started/setting-up-events)

**Authorization** `string` *required*

Header for authenticating with Laudspeaker. Starts with `Api-Key` followed by the API key, for example `Api-Key M4jxXt6diYz1Dds1YmhHe93KGPAUi24PlXgaiRXi`.

**batch** `Event[]` *required*

This field contains the array of events.

An identify event looks like:

```
{
    "batch": [
    {
      "timestamp": "2024-03-15T02:31:05.295Z",
      "event": "$identify",
      "source": "custom",
      "correlationKey": "_id",
      "payload": {
        "distinct_id": "example@youremail.com"
      },
      "correlationValue": "FBBBCB26-B75E-4342-B40B-568BF879F7C5"
    }
  ]
}
```

An identify event is a special case of our regular event. It contains an **event** field equal to **\$identify**, and a **payload** object with a **distinct\_id** which is equal to the primary key of your user. The correlationValue should also be a `uuid` that you keep consistent in your backend in subsequent calls to the same user.

As a reminder the primary key of your user is defined in your user schema:

![search](https://mintcdn.com/laudspeaker/In84ceyly56-IgdR/images/developer/sdks/user_schema.png?fit=max\&auto=format\&n=In84ceyly56-IgdR\&q=85\&s=064dd57b06242115e5c6ab9952c4d98b)

If you are using one of our sdks, you can simply use the **Laudspeaker.identify()** call. If you are accessing our endpoint directly for example from your backend you will need to match the event structure described above.

### Idenfitying and triggering a journey:

If you want to trigger a message to a specific user that you have previously created in laudspeaker with an event, and are not using our sdk. You will want to send events to our batch endpoint. It will consist of two events in the batch - an identify call, follwed by a regular event like below:

```
{
    "batch": [
    {
      "timestamp": "2024-03-15T02:31:05.295Z",
      "event": "$identify",
      "source": "custom",
      "correlationKey": "_id",
      "payload": {
        "distinct_id": "example@youremail.com"
      },
      "correlationValue": "FBBBCB26-B75E-4342-B40B-568BF879F7C5"
    },
    {
      "timestamp": "2024-03-15T02:31:05.295Z",
      "event": "trigger_some_message",
      "source": "custom",
      "correlationKey": "_id",
      "payload": {
        "some_value":"the_value"
      },
      "correlationValue": "FBBBCB26-B75E-4342-B40B-568BF879F7C5"
    }
  ]
}
```

Remember the correlationValue should also be a `uuid` that you keep consistent in your backend in subsequent calls to the same user.


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