---
title: "Step 1: Authenticate"
slug: "step-2-authenticate-your-user"
updated: 2025-11-13T13:48:07Z
published: 2025-11-13T13:48:07Z
---

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

# Step 2: Authenticate Your User

Some Rocket.Chat endpoints require user authentication before you can access them. For an overview of how authentication works, refer to the [Authentication API guide](https://developer.rocket.chat/apidocs/authentication-api).

For this example, use the [**Login with Username and Password**](https://developer.rocket.chat/apidocs/login-with-username-and-password) endpoint to obtain your `userId` and generate an `authToken`.

On the [Login with Username and Password](/v1-api/apidocs/login-with-username-and-password) endpoint page, enter the same username and password you used in [**Step 1: Register Yourself as a User.**](https://developer.rocket.chat/apidocs/step-1-register-yourself-as-a-user)****For example:

```json
{
 "username": "rogersmith",
 "password": "passw0rd"
}
```

Click **Try it!**

If the request is successful, the response will include your user details, along with the `userId` and `authToken`. Make sure to copy these values, they will not persist if you leave the page, and you would need to run the request again.

You must include these values as the `X-User-Id` and `X-Auth-Token` headers when calling any endpoint that requires authentication.

Next, let’s look at how to send authenticated requests using these parameters.
