# Instagram

Before you publish, test from the **Instagram** tab of the inbox's **Test**
page. Your own account is connected in **Channels → Instagram**, once you
publish (`vatio instagram` prints the link). What that page opens depends on
the environment the inbox shows, picked at the top of its rail: on
**preview**, the shared preview account and your test accounts; on **live**,
your own account. Before you publish, the link `vatio instagram` prints opens
preview.

## Test with the shared preview

1. Open **Test → Instagram**. An account you already verified on another
   workspace you own is listed under **You already verified these accounts**:
   choose **Use on preview** and it is connected, with no code.
2. Otherwise, under **Connect your account**, scan the QR code with your
   phone: it opens the DM with the shared preview account. **From the account
   you will test with**, send it the code the page shows. On a computer, where
   ig.me links don't open, DM the account the page names and send the code.
   That DM is what proves the account is yours: Vatio confirms it right there,
   and the page updates by itself.
3. Keep talking to the agent in that DM, and read the conversation in the
   inbox's **Conversations**, on preview.

To start over, send `/new`. The next message begins a new
conversation, signed out, instead of continuing the current one until it has
been quiet for eight hours. It works only on the shared preview account.

Instagram does not let Vatio write first, so your account sends the code
instead of receiving one. A code lasts 15 minutes and works once; the one on
the page renews itself. An account routes to one workspace at a time: sending
another workspace's code from it, or choosing **Use on …** there, moves it to
that workspace.

To test from more accounts, choose **Add another account** under the list; it
shows a new code.

A verified test account reaches `preview`, never live. Up to five are allowed
per workspace.

## Connect your professional account

For live DMs, open **Channels → Instagram** on live and choose
**Connect Instagram**. Complete Meta's consent in the window that opens; the
same page then says whether the account is receiving DMs, and **Verify** runs
that check again. **Publish to live** on the **Test** page publishes through
the same checks as [`vatio publish`](https://vatio.ai/docs/deployments#publishing); after the first
publish, **Published. Next: put it in your app** starts the same consent.

A workspace connects one account; an account connects to one workspace.
Vatio refreshes its access token automatically. If it expires, **Reconnect**
the same account. Delete the integration before switching accounts.

When a contact edits a DM, the inbox marks it **Edited** and the agent reads the
new text from then on; an unsent DM is deleted from Vatio too, leaving the inbox
and the agent's history. Neither is a new message, so the agent does not answer
it. An account connected before edits were supported starts getting them within
a day, or right away with **Verify**.

A private tool needs the contact signed in. With `auth.sign_in_url` set, Vatio
sends them a **Sign in** button that opens your site, and the conversation
carries on once they are back. See [On WhatsApp and Instagram](https://vatio.ai/docs/authentication/sessions#on-whatsapp).
