Log inStart Free Trial
easyCoexistence Official APIs

Instagram AI chatbot with human handoff

An Instagram AI chatbot with human handoff answers DMs with AI until a person is needed, then steps aside on that chat and alerts the team. It should also go quiet when you reply in the Instagram app. easyCoexistence's automations, set up from Claude or ChatGPT, do both: a Hand to a person step that pauses the bot and emails you, and a pause after you reply.

4 hours

Default pause on a chat after you reply from the Instagram app; each automation takes 0 to 168.

24 hours

Default length of a Hand to a person pause, settable from 1 to 168 hours, with an email to you.

7 days

Meta's separate Human Agent window, for replies a person writes and an app tags as human agent.

Disclose

Where the law requires it, automated chats say so at the start, after a long pause, and when moving from a person to automation.

is_echo

Flag on a message the account itself sent, which is how easyCoexistence notices a reply typed in the app.

How does handoff work in easyCoexistence's automations?

Through two separate mechanisms, one the flow decides and one you trigger by replying. Hand to a person is a step: "The bot stays quiet on this chat for a while and you get an email." It pauses automatic replies to that person for 1 to 168 hours, 24 by default, and the email carries an optional note, who wrote and what they wrote. The pause after you reply is a setting, Pause on a chat after I answer it (hours), under Advanced: when you answer from the Instagram app, that automation stays quiet on the chat for 4 hours by default, from 0 to 168.

Hand to a person stepPause after you reply
Starts whenThe flow reaches the stepYou answer from the Instagram app
CoversAutomatic replies to that personThat automation, on that chat
Length1 to 168 hours, 24 by default0 to 168 hours, 4 by default
Tells youAn email with your noteNothing: you are already in the chat
EndsWhen the time is up, or Turn back on in ConversationsWhen the time is up

When should the bot hand over?

When the conversation needs judgment, money or a promise the bot cannot make. Common places for the step:

  • The person asks for a human: an AI picks the path step with a path described as asking for a person, a manager or a call.
  • A menu button such as Talk to a person, from an Ask a question step with a path per answer.
  • Keywords such as refund, complaint or cancel, in a keyword automation of their own.
  • An agent's own judgment: its Hand to a person tool is on by default and fires when someone asks for a person, is upset, or it cannot help.
  • A qualified lead, once the details are saved, so a salesperson takes over.

How does the pause after you reply work?

Meta sends the account's own messages back to easyCoexistence marked as echoes. Those easyCoexistence sent are recognised and ignored; a reply typed in the Instagram app, or in another inbox connected to the account, counts as a person taking the chat. From then on, new runs of the automation on that chat are skipped as "You answered this chat from your phone recently" until the pause ends, a run held on a Wait step stops when it resumes, and an AI answer still being written is not sent. Set the pause to 0 to keep the bot answering beside you.

How does the bot come back?

On its own, when the pause ends: the next DM from that person gets automatic replies again, and the first AI message after a person has written opens by saying it is automated, the moment Meta's policy names when a chat moves from a person back to automation. To end a handoff sooner, or keep the bot off, open the person in Conversations, where Automatic replies offers Turn back on, Pause 1 h, Pause 4 h, Pause 24 h, or off until you switch it on. From Claude or ChatGPT, update_contact with pause_hours does the same, and 0 switches it back on.

How do you build it from Claude or ChatGPT?

Save your AI key in the dashboard first, under AI keys, since no tool takes a key through the chat. Then describe the bot and when it should hand over. The AI calls list_social_accounts, then create_automation on the Instagram channel_id with a dm_received trigger, an ai_decide step whose paths lead to a handoff step, and an agent or ai_reply step for the rest, then test_automation. Claude or ChatGPT do not answer the DMs themselves: the automation does, around the clock.

The request, and the create_automation call it becomes
You: Answer our Instagram DMs with our agent, but when someone asks for a
     person or has an order problem, tell them and hand the chat to me.

→ list_social_accounts
→ list_agents
→ create_automation {
    "connection_id": "…Instagram channel_id…",
    "name": "Agent with handoff",
    "trigger": { "type": "dm_received", "match": "any" },
    "steps": [{
      "type": "ai_decide",
      "provider": "anthropic",
      "model": "<your model id>",
      "paths": [
        {
          "name": "Wants a person",
          "description": "Asks for a human, a manager or a call, or is upset",
          "steps": [
            { "type": "reply_text", "text": "Sure! Someone from our team will answer you here soon." },
            { "type": "handoff", "hours": 24, "note": "{{name}} asked for a person: {{message}}" }
          ]
        },
        {
          "name": "Order problem",
          "description": "A late, wrong or damaged order, or a refund",
          "steps": [
            { "type": "reply_text", "text": "Sorry about that! A person from our team will check your order here." },
            { "type": "handoff", "hours": 48, "note": "Order problem from {{name}}: {{message}}" }
          ]
        }
      ],
      "otherwise": [{ "type": "agent", "agent_id": "…from list_agents…" }]
    }],
    "settings": { "takeover_hours": 4 }
  }
→ test_automation { "automation_id": "…", "text": "I want to talk to a real person" }

What does Meta allow once a person takes over?

A person who takes over still works inside Meta's rules for apps. Replies sent through the API go out within 24 hours of the person's latest message, and easyCoexistence's Conversations follows that rule: after 24 hours it waits for them to write again. Meta also has a separate 7-day Human Agent window, for replies a person writes and an app tags as human agent. easyCoexistence never sends that tag, so for a late answer, reply from the Instagram app itself.

How to set it up

  1. Save your AI keyIn Automations, click AI keys, paste an Anthropic, OpenAI or OpenRouter key and click Test and save.
  2. Start an empty Instagram automationClick New automation, choose Manual, open the Instagram tab and pick Start from scratch; it starts on any DM.
  3. Add AI picks the pathDelete Send a DM, add AI picks the path, and describe a path such as Wants a person: asks for a human, a manager or a call, or is upset.
  4. Hand that path to a personIn that path add Send a DM, saying someone will answer soon, then Hand to a person with the hours and a note for the email. Put Agent answers or Reply by DM with AI under Otherwise.
  5. Check the pause and try itUnder Advanced, check Pause on a chat after I answer it, 4 hours by default. Then click Try it as a customer and write "I want to talk to a person".

Common mistakes

  • Telling the AI to say a person will answer, with no Hand to a person step. The bot says it, then keeps replying to the next DMs, because only the step pauses it.
  • Setting the pause after you reply to 0. The bot then answers in the same chat while you are typing, and the person gets replies from both of you.
  • A pause longer than anyone covers. Handed off for 168 hours with nobody answering, the person waits a week with no reply at all; pick hours your team can cover.
  • Answering a handed-off chat from easyCoexistence's Conversations after 24 hours. Meta refuses API replies by then, so answer from the Instagram app.
Doing this with EasyCoexistence

easyCoexistence runs an AI chatbot on your Instagram DMs with your own Anthropic, OpenAI or OpenRouter key, hands a chat to a person with a Hand to a person step that pauses the bot and emails you, and stays quiet for 4 hours by default when you reply from the Instagram app. Claude or ChatGPT can build it through the connector. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.

easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook, Google Business Profile and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.

Connect Instagram to ChatGPT and Claude

Frequently asked questions

Does the person know the chat went to a person?

Only if the flow tells them. Put a Send a DM step before Hand to a person, such as "Sure, someone from our team will answer you here soon." An AI reply asked for a person also says one will answer soon, because its built-in instructions require it.

Who gets the handoff email?

The easyCoexistence account's owner, with the automation's name, who wrote, their message and your note. After 30 handoff emails from one automation in an hour, no more are sent that hour, but each chat is still paused.

Does a handoff stop comment automations too?

No. It pauses automatic replies in that person's DMs; comment automations still answer their new comments.

Can the handoff alert my team's own tool?

Yes. Add Call my webhook or Call an API next to Hand to a person: the first posts the DM and recent messages, signed, to your system; the second sends the fields you choose to any HTTPS API, such as a helpdesk.

Keep reading

Connect your first channel in two minutes.

No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.

  • 3 days free
  • Cancel any time
  • Official APIs only
  • Monitored 24/7

Verified on