Skip to main content
Connect your own WhatsApp number or Instagram account to your own AI agent. Message your agent; it messages you back, all through HookMyApp.

What you need

  • A HookMyApp account
  • A connected channel (the sandbox for testing, or your own WhatsApp number or Instagram account)
  • An access token and number or account id for that channel
  • An agent runtime that can read incoming messages and send outgoing replies
If your channel is already connected, skip to Configure your agent.

Connect a number

For testing, start a sandbox session pinned to your phone:
hookmyapp sandbox start
The CLI prints a bind code and a QR. WhatsApp that code to the sandbox number from the phone you want to bind. See Sandbox for the full flow. To use your own number, connect your WhatsApp Business number through Meta’s embedded signup:
hookmyapp channels connect
Instagram works the same way: use hookmyapp channels connect instagram (or hookmyapp sandbox start instagram for testing). See Connect WhatsApp or Connect Instagram for the full embedded-signup flow.

Configure your agent

Pull credentials into a .env file your agent runtime can load. For a sandbox session:
hookmyapp sandbox env --write .env
For a connected channel:
hookmyapp channels env <channel> --write .env
Your agent reads these values:
  • Base URL: WHATSAPP_API_URL (sandbox proxy) or META_GRAPH_API_URL (https://graph.facebook.com/v24.0, your own number)
  • WHATSAPP_ACCESS_TOKEN: Bearer token for the Graph-shape POST
  • WHATSAPP_PHONE_NUMBER_ID: the WhatsApp number your agent sends from
  • VERIFY_TOKEN: HMAC secret for verifying inbound webhook signatures
The receiver shape is identical between the sandbox and your own number. Only the base-URL variable name and the credential values change.

What your agent can do

Your agent reads inbound webhooks (text, media, button replies) and POSTs outbound messages using the same Meta Graph shape. The CLI gives it operational access from the terminal.

Send messages

POST to ${WHATSAPP_API_URL}/${WHATSAPP_PHONE_NUMBER_ID}/messages with a Bearer token. See Send messages for the message types.

Listen to conversations

For local development, run a tunnel so inbound webhooks reach your agent runtime:
hookmyapp sandbox listen
For your own number, set a public webhook URL Meta calls when messages arrive:
hookmyapp channels webhook set <channel> \
  --url https://your-agent.example.com/webhook \
  --verify-token $(openssl rand -hex 32)

Verify signatures

Every forwarded webhook arrives with X-HookMyApp-Signature-256: sha256=<hex> (HMAC-SHA256 over the raw body, key = VERIFY_TOKEN). Your agent rejects mismatches with 401. See Receive webhooks for the full algorithm.

Use it with an agent framework

If your personal agent runs on a framework like OpenClaw, NanoClaw, or Hermes, you don’t have to write any transport code. These runtimes can run shell commands, so hand them the HookMyApp CLI and your agent can send and receive messages on your own number straight from its shell. Give your agent a prompt like this to wire it up:
Agent prompt
You can send and receive WhatsApp and Instagram messages on my behalf through the
HookMyApp CLI (npm package @gethookmyapp/cli).

Setup:
1. Install it:  npm install -g @gethookmyapp/cli
2. I will run `hookmyapp login` myself to authenticate. You cannot log in for me.
3. List my connected channels:  hookmyapp channels list --json

To send a message:
1. Pull the channel credentials:  hookmyapp channels env <channel> --json
2. POST to the Meta endpoint those values describe (base URL + number or account id
   + access token), using the message body shape for that channel.

Always run `hookmyapp <command> --help` before using a command. Only message the
people I explicitly ask you to, and never contact anyone without my confirmation.
For deeper, framework-specific wiring, point your agent at the agent skills and the CLI reference. For other runtimes (Python, Go, Rust), use the same env values and adapt the transport on your side.

Next steps

  • Build with AI: Use Cursor, Codex, or Claude Code to wire all this for you.
  • CLI: Command reference for everything above.
  • Send messages: Outbound message types.
  • Receive webhooks: Inbound webhook handling and signature verification.