> ## 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

> Test Messenger with the HookMyApp sandbox Page before connecting your own.

## How it works

HookMyApp runs a sandbox Facebook Page. You bind your personal Facebook account to it by sending a code over Messenger; from then on, messages you send to the sandbox Page reach your webhook, and your app replies through the sandbox as the Page.

The sandbox covers Messenger messages only. Posts, comments and insights need a [connected Page](/facebook/connect).

## Start a session

In the dashboard, open **Sandbox** and pick the **Facebook** tab. It shows your bind code and an `m.me` link to the sandbox Page. Open the link from the Facebook account you want to test with and send the code as a message. The session activates when it arrives.

Or ask your agent, with the HookMyApp [MCP server](/facebook/mcp-server) connected:

```text theme={null}
Use HookMyApp MCP to start a Facebook sandbox session in my workspace.
```

`start_sandbox_session` with `channelType: "facebook"` returns the same code and link.

From a terminal:

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

The CLI prints the code and the `m.me` link. Message the code to the sandbox Page from the account you want to test with.

A session stays active until you stop it or start a new one. A Facebook account already connected to another workspace is turned away with a Messenger reply saying so.

## Receive messages

Point the session at your receiver:

```text theme={null}
Use HookMyApp MCP to set the sandbox destination for my Facebook session to https://api.example.com/webhook/facebook.
```

`set_sandbox_destination` takes the session and your URL. Messages arrive in the same `object: page` shape as a connected Page, signed the same way. See [Receive webhooks](/facebook/receive-webhooks).

To forward to a local server instead, keep this running while you test:

```bash theme={null}
hookmyapp sandbox listen --session <ssn_id> --path /webhook/facebook
```

Facebook sessions have no phone number, so `--session` selects them. `hookmyapp sandbox env --write .env` writes `FACEBOOK_API_URL`, `FACEBOOK_ACCESS_TOKEN` and `FACEBOOK_PAGE_ID` alongside the webhook secret and verify token.

## Reply

```text theme={null}
Use HookMyApp MCP to reply "Got it, thanks" on my Facebook sandbox session.
```

`send_sandbox_message` sends as the sandbox Page to the account bound to the session. The sandbox only sends to that account; it takes no recipient. Outside the 24-hour window the send is refused with `SESSION_WINDOW_CLOSED`: message the sandbox Page again first.

```bash theme={null}
hookmyapp sandbox send --session <ssn_id> --message "Got it, thanks"
```

## Read the log

```text theme={null}
Use HookMyApp MCP to show the last 20 sandbox messages on my Facebook session.
```

`get_sandbox_logs` returns inbound messages and the forwarding outcome for each. `list_sandbox_sessions` shows every session in the workspace with the bound sender's name. `hookmyapp sandbox logs --session <ssn_id>` prints the same log.

<Note>
  Sandbox sessions are not channels. They have their own `ssn_` id and never appear in `list_channels` or `hookmyapp channels list`.
</Note>

## Next steps

* [Connect a Page](/facebook/connect): Move from the sandbox to your own Page.
* [Send messages](/facebook/send-messages): Text, attachments and the 24-hour window.
