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

# Connect Instagram

> Connect an Instagram professional account with Instagram OAuth.

## Prerequisites

* A HookMyApp account.<br />
  Sign in with `hookmyapp login`.
* An Instagram professional account (Business or Creator).<br />
  Personal accounts cannot receive the messaging webhooks.

## Run connect command

Start the Instagram OAuth flow with the CLI.<br />
Pass `instagram` as the channel type.

```bash theme={null}
hookmyapp channels connect instagram
```

Your browser opens Instagram's authorization page.<br />
Sign in to Instagram.<br />
Grant HookMyApp the requested permissions.<br />
You do not use Facebook Login or WhatsApp Embedded Signup for this flow.

For Meta setup details, see [Meta Instagram messaging docs](https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login).

## What you get back

* **Channel ID** (`ch_xxxxxxxx`): use it in channel commands, like `hookmyapp channels env <channel>`, `hookmyapp channels webhook set <channel>`, and `hookmyapp channels health <channel>`.<br />
  Find it with `hookmyapp channels list`. You can also use the Instagram handle, like `@yourhandle`.
* **`INSTAGRAM_ACCESS_TOKEN`**: the token your app sends in the `Authorization: Bearer` header.<br />
  Get it with `hookmyapp channels env <channel>` or `hookmyapp channels token <channel>`, or copy it from the channel page.
* **`INSTAGRAM_ACCOUNT_ID`**: the account ID used in the send URL.

## Token lifetimes and rotation

Your channel token does not expire.<br />
If the channel loses permission to send, the channel health page shows it and `hookmyapp channels connect instagram` re-links the account.

If your channel token leaks, rotate it: `hookmyapp channels token <channel> --rotate`, or the Rotate button on the channel page.<br />
The old token stops working immediately. Print the current token anytime with `hookmyapp channels token <channel>`.

## Reconnect

If you connected your Instagram account before [publishing](/instagram/publish-content), [insights](/instagram/insights), and [comments](/instagram/comments) were available, reconnect once: open the channel's detail page in the dashboard and use **Reconnect**. The channel updates in place and DMs keep working throughout.

## Next steps

* [Webhook routing](/instagram/webhook-routing): Find and set your own webhook URL.
* [Send text](/instagram/send-messages/text): Send your first Instagram DM.
