> For the complete documentation index, see [llms.txt](https://tools.docs.sendbird.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tools.docs.sendbird.com/readme/chat/create-test-users.md).

# Create test users

Create two test users, Alice and Bob, and open two terminals so you can send messages as one user and receive them as the other. The other Chat tutorials use these users.

This tutorial is for running commands yourself in a terminal. If you use an AI coding agent, such as Claude Code or Codex, describe what you want in plain words instead, and the agent runs the commands. See [Example requests](/readme/ai-agents.md#example-requests).

## Before you begin

* Install the CLI, log in, and select a test app by following Steps 1 to 3 of the [Quickstart](/readme/quickstart.md). The tutorials create and delete users and channels in this app, so use one that doesn't serve real users.
* The tutorials create users and channels, invite users, and list channel members with your Sendbird account, so its Dashboard role must allow these. See [Your account and Chat users](/readme/commands/command-reference.md#your-account-and-chat-users).
* Open two terminals on the same computer, terminal A and terminal B. On Windows, use Git Bash in both.

## Step 1. Check your test app

The tutorials run every command against the app you selected in the Quickstart. In terminal A, show that app:

```bash
sendbird --profile prod app get
```

Check that the app is your test app, and note its **App ID**. If it isn't your test app, [select your test app](/readme/quickstart.md#step-3-select-your-app) again.

## Step 2. Check that the user IDs are free

The tutorials use the user ID `tutorial_alice` for Alice and `tutorial_bob` for Bob. In terminal A, check that no user has these IDs yet:

```bash
sendbird --profile prod chat user get --id tutorial_alice
sendbird --profile prod chat user get --id tutorial_bob
```

Both lookups should return `E_NOT_FOUND`. This error is the expected result. It means that no user has that ID yet.

If a user exists, check whether you created it in an earlier run of these tutorials. If you did, [delete the test users](/readme/chat.md#delete-the-test-users), then run the lookups again. If you didn't, or you aren't sure, don't delete it. Choose another ID instead, such as `tutorial_alice2`, and use it in place of `tutorial_alice` or `tutorial_bob` in every command and expected result in the tutorials.

## Step 3. Create the users

`--issue-access-token true` gives each user an access token, which the CLI uses when it runs commands as that user. `--dry-run` shows the request without creating the user. In terminal A, preview the requests:

```bash
sendbird --profile prod chat user create --user-id tutorial_alice --nickname Alice --issue-access-token true --dry-run
sendbird --profile prod chat user create --user-id tutorial_bob --nickname Bob --issue-access-token true --dry-run
```

Check that the **App** row in each preview shows the App ID from Step 1. Then create the users:

```bash
sendbird --profile prod chat user create --user-id tutorial_alice --nickname Alice --issue-access-token true
sendbird --profile prod chat user create --user-id tutorial_bob --nickname Bob --issue-access-token true
```

From now on, commands with `--as-user tutorial_alice` or `--as-user tutorial_bob` run as that user with the access token you just issued, so you don't handle tokens yourself. Commands without `--as-user` run with your Sendbird account, which manages the app, for example by creating users and channels.

Check that each user can connect:

```bash
sendbird --profile prod chat sdk status --as-user tutorial_alice
sendbird --profile prod chat sdk status --as-user tutorial_bob
```

Each status command prints `Connected as` followed by that user's ID. If either one fails, see [Troubleshooting](/readme/troubleshooting.md) before you continue.

Next, follow [Send and receive messages](/readme/chat/send-and-receive-messages.md).
