To create a Meta app for the Instagram API you need an Instagram professional account, a Meta developer account, an app with the Instagram product added, three permissions, an access token and, if you want real time events, a webhook. For an account you own, none of this requires App Review. Expect about 15 to 20 minutes if you follow the steps in order.
Before you start
Have these ready:
- An Instagram professional account, business or creator. With Instagram Login you do not need a Facebook Page.
- A login for the Meta developer dashboard.
- If you plan to use webhooks, a public HTTPS address that can receive requests. A tool or your own server provides this.
- A second Instagram account to test with.
Meta renames buttons and rearranges its dashboard from time to time. The steps below describe what you are doing at each stage, so you can find the matching screen even when a label has changed.
How to create a Meta app for the Instagram API
Switch to a professional account. In the Instagram app, open your account settings and change the account type to business or creator. The API does not work with personal accounts.
Register as a developer. Go to developers.facebook.com, sign in and complete the developer registration. This gives you access to the app dashboard.
Create the app. In the dashboard, choose to create a new app, give it a name and a contact email. When asked what the app is for, pick the option that covers Instagram messaging and content.
Add the Instagram product. Inside the app, add Instagram and choose the setup that uses Instagram Login. This is the path that does not need a Facebook Page.
Add the three permissions. A comment to DM setup needs these:
instagram_business_basicto read your account's basic information and media.instagram_business_manage_commentsto read comments and reply to them.instagram_business_manage_messagesto send and receive messages.
Connect your account and generate a token. Add your Instagram account to the app, log in with it when prompted and approve the permissions. The dashboard then gives you an access token. A short-lived token lasts 1 hour and a long-lived token lasts 60 days. Use a long-lived one, store it somewhere private and never paste it into a chat, a screenshot or public code.
Set up the webhook. Enter your callback URL and a verify token of your choice, then subscribe to the fields you need, such as messages and comments. Meta sends a verification request to the URL, and your endpoint has to answer it correctly before the subscription is saved. Every later payload is signed with the
X-Hub-Signature-256header, a SHA256 signature made with your app secret and prefixed withsha256=. Your endpoint should check that signature and reject anything that does not match.Test it. From your second account, comment on one of your posts. Confirm you can read the comment through the API, send a private reply and see it arrive. Then send a DM from the second account and confirm you can answer it.
One thing to know about the comments webhook
The webhooks documentation states that Advanced Access is required to receive comments and live_comments notifications, that the app must be Live, and that the media owner's account must be public. The messages webhook carries no such statement.
So with Standard Access, you may receive message events but no comment events. That does not block you. A tool can ask the API for new comments on a schedule, which is called polling. It is a little slower than a webhook and works fine for a campaign on your own account. The difference between the two levels is explained in Instagram API standard access vs advanced access.
Troubleshooting
The account cannot be connected. Check that it is a professional account and that you are logged into the right one in your browser. Being signed into a personal account in the same browser is the most common cause.
A permission is missing from the login screen. Go back to the app and confirm all three permissions were added to the Instagram product before you generated the token. Generate a new token after adding one.
The webhook will not verify. Your endpoint must be reachable over public HTTPS and must answer Meta's verification request using the same verify token you typed into the dashboard. A local address on your laptop will not work.
The webhook verified but no comment events arrive. See the section above. Without Advanced Access this is expected, so use polling.
Sending a message returns an error about direct message access. The account owner has disabled access to Instagram direct messages. Open the message settings in the Instagram app and allow access for connected tools.
The API says the person is not receiving messages right now. That is about the recipient, not your app. You cannot change it. Reply publicly and invite them to DM you.
Everything worked and then stopped weeks later. The token probably expired. See Instagram access token expires after 60 days for the refresh routine.
What you have at the end
You now have an app that can read comments on your own account, reply to them and send private replies, all through the official API and without App Review. Serving other people's accounts is a different matter and needs Advanced Access.
This is the same setup the first version of CometoDM asks for: you connect through your own Meta app, and a wizard checks each of these steps as you complete it. The product is in development with a waitlist. If you are building your own integration, the eight steps and the troubleshooting list above are everything you need to get to a working test.