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

# Sandbox

> Use a HookMyApp test Instagram account before connecting your own.

## Start session

```bash theme={null}
hookmyapp sandbox start instagram
hookmyapp sandbox status
```

The CLI opens a DM to the HookMyApp test Instagram account.
Send the prefilled message from your Instagram account.
That account is now connected to this sandbox session.

## Listen for messages locally

```bash theme={null}
hookmyapp sandbox listen --path /webhook/instagram
```

Keep the command running while you test.
HookMyApp sends sandbox Instagram DMs to that route.

## Send test message

```bash theme={null}
hookmyapp sandbox send --message "hello from my app"
```

The sandbox only sends to your connected Instagram account.
There is no `--to` flag on `sandbox send`.

## Env values

Write the sandbox env values to a `.env` file your server can load.

```bash theme={null}
hookmyapp sandbox env --write .env
```

For an Instagram sandbox session:

* `WEBHOOK_HMAC_SECRET`: the HMAC secret your server uses to verify `X-HookMyApp-Signature-256` on incoming webhooks.
* `VERIFY_TOKEN`: the value your server echoes back on the one-time verification `GET` when you run `sandbox webhook set`. Not the HMAC secret.
* `PORT`: where your local server listens.<br />
  Defaults to `3000`.
* `INSTAGRAM_API_URL`: the sandbox send URL.
* `INSTAGRAM_ACCESS_TOKEN`: the sandbox channel token used to send DMs.
* `INSTAGRAM_ACCOUNT_ID`: the ID of the test Instagram account.

The sandbox uses `INSTAGRAM_ACCOUNT_ID`.<br />
A connected Instagram channel also emits `INSTAGRAM_ACCOUNT_ID`.

## Manage session

* Activate: `hookmyapp sandbox start instagram` opens a new sandbox session.
* Connect: send the prefilled DM from the Instagram account you want to test with.
* Lifetime: a session stays active until you stop it or start a new one.
* Reactivate: run `hookmyapp sandbox start instagram` again and DM the sandbox account from the same user.<br />
  You get fresh env values.
* Stop early: `hookmyapp sandbox stop` tears down the session immediately.
* Multiple sessions: use `--username <@handle>` with `sandbox env`, `sandbox send`, `sandbox logs`, and `sandbox webhook`.

## Inspect messages

* `hookmyapp sandbox logs` streams the session delivery log.<br />
  Add `--follow` to tail it live and `--verbose` for full bodies.
* `hookmyapp sandbox webhook show` prints where sandbox messages are delivered. `hookmyapp sandbox webhook set` overrides it and `hookmyapp sandbox webhook clear` reverts to the CLI-managed default.

## Limitations

* You can only message your connected Instagram account.
* Connect your own Instagram account when you are ready for real customers.

## Next steps

* [Instagram quickstart](/instagram/quickstart): Start sending and receiving Instagram DMs.
* [Webhook routing](/instagram/webhook-routing): Choose where incoming DMs are delivered.
* [Send text](/instagram/send-messages/text): Send Instagram DMs.
