[{"data":1,"prerenderedAt":1795},["ShallowReactive",2],{"docs-\u002Fdocs\u002Finbox":3},{"id":4,"title":5,"body":6,"description":1785,"extension":1786,"meta":1787,"navigation":1788,"order":1789,"path":1790,"seo":1791,"seoTitle":1792,"stem":1793,"__hash__":1794},"docs\u002Fdocs\u002Finbox.md","Inbox and comment automations",{"type":7,"value":8,"toc":1771},"minimark",[9,13,22,136,155,160,173,235,320,323,504,526,534,538,559,815,830,834,854,871,874,923,930,958,968,1009,1016,1020,1044,1050,1054,1064,1275,1278,1306,1316,1321,1331,1334,1342,1418,1581,1584,1620,1657,1661,1669,1673,1711,1715,1721,1758,1767],[10,11,5],"h1",{"id":12},"inbox-and-comment-automations",[14,15,16,17,21],"p",{},"One set of endpoints for direct messages on every platform whose API allows them, a ",[18,19,20],"code",{},"message.received"," webhook for new DMs, and comment-to-DM rules for Instagram and Facebook.",[23,24,25,53],"table",{},[26,27,28],"thead",{},[29,30,31,35,38,41,44,47,50],"tr",{},[32,33,34],"th",{},"Platform",[32,36,37],{},"List and read",[32,39,40],{},"Reply",[32,42,43],{},"Media in replies",[32,45,46],{},"Mark read",[32,48,49],{},"New messages arrive by",[32,51,52],{},"Comment automations",[54,55,56,78,96,116],"tbody",{},[29,57,58,62,65,68,71,73,76],{},[59,60,61],"td",{},"Facebook Pages (Messenger)",[59,63,64],{},"Yes",[59,66,67],{},"Yes, within 24 h",[59,69,70],{},"Images, video, files",[59,72,64],{},[59,74,75],{},"Meta webhook, else polling every 5 min",[59,77,64],{},[29,79,80,83,85,87,90,92,94],{},[59,81,82],{},"Instagram (professional)",[59,84,64],{},[59,86,67],{},[59,88,89],{},"Images, video",[59,91,64],{},[59,93,75],{},[59,95,64],{},[29,97,98,101,103,105,108,110,113],{},[59,99,100],{},"Bluesky",[59,102,64],{},[59,104,64],{},[59,106,107],{},"No (text only)",[59,109,64],{},[59,111,112],{},"Polling every minute",[59,114,115],{},"No",[29,117,118,121,124,126,129,131,134],{},[59,119,120],{},"X",[59,122,123],{},"Yes (last 30 days)",[59,125,64],{},[59,127,128],{},"One image, GIF or video",[59,130,115],{},[59,132,133],{},"Polling every 15 min",[59,135,115],{},[14,137,138,139,142,143,146,147,150,151,154],{},"LinkedIn, TikTok, YouTube, Pinterest, Threads and Google Business Profile have no DM API open to apps; inbox calls for their accounts return ",[18,140,141],{},"400 unsupported_platform",". ",[18,144,145],{},"GET \u002Fapi\u002Fv1\u002Fplatforms"," shows each platform's ",[18,148,149],{},"inbox"," capabilities (",[18,152,153],{},"null"," when there are none).",[156,157,159],"h2",{"id":158},"permissions","Permissions",[14,161,162,163,166,167,172],{},"DM permissions are not part of a normal connection, because users would see them on every consent screen and Meta only grants them after App Review. Ask for them with ",[18,164,165],{},"features: [\"inbox\"]"," on the ",[168,169,171],"a",{"href":170},"\u002Fdocs\u002Fconnect-links","connect link",":",[174,175,180],"pre",{"className":176,"code":177,"language":178,"meta":179,"style":179},"language-bash shiki shiki-themes github-light github-dark","curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fconnect-link \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"user_id\": \"user_123\", \"platforms\": [\"instagram\"], \"features\": [\"inbox\"] }'\n","bash","",[18,181,182,205,216,226],{"__ignoreMap":179},[183,184,187,191,195,199,202],"span",{"class":185,"line":186},"line",1,[183,188,190],{"class":189},"sScJk","curl",[183,192,194],{"class":193},"sj4cs"," -X",[183,196,198],{"class":197},"sZZnC"," POST",[183,200,201],{"class":197}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fconnect-link",[183,203,204],{"class":193}," \\\n",[183,206,208,211,214],{"class":185,"line":207},2,[183,209,210],{"class":193},"  -H",[183,212,213],{"class":197}," \"Authorization: Bearer pk_3f9a...\"",[183,215,204],{"class":193},[183,217,219,221,224],{"class":185,"line":218},3,[183,220,210],{"class":193},[183,222,223],{"class":197}," \"Content-Type: application\u002Fjson\"",[183,225,204],{"class":193},[183,227,229,232],{"class":185,"line":228},4,[183,230,231],{"class":193},"  -d",[183,233,234],{"class":197}," '{ \"user_id\": \"user_123\", \"platforms\": [\"instagram\"], \"features\": [\"inbox\"] }'\n",[23,236,237,251],{},[26,238,239],{},[29,240,241,243,248],{},[32,242,34],{},[32,244,245,246],{},"Extra permissions with ",[18,247,165],{},[32,249,250],{},"Notes",[54,252,253,270,285,305],{},[29,254,255,258,267],{},[59,256,257],{},"Facebook",[59,259,260,263,264],{},[18,261,262],{},"pages_messaging",", ",[18,265,266],{},"pages_manage_metadata",[59,268,269],{},"Advanced access needs Meta App Review.",[29,271,272,275,282],{},[59,273,274],{},"Instagram",[59,276,277,263,280],{},[18,278,279],{},"instagram_manage_messages",[18,281,266],{},[59,283,284],{},"Advanced access needs Meta App Review. The Instagram account must be linked to a Facebook Page.",[29,286,287,289,297],{},[59,288,120],{},[59,290,291,263,294],{},[18,292,293],{},"dm.read",[18,295,296],{},"dm.write",[59,298,299,300,304],{},"X bills DM reads; see ",[168,301,303],{"href":302},"#costs-on-x","costs",".",[29,306,307,309,312],{},[59,308,100],{},[59,310,311],{},"None",[59,313,314,315,319],{},"The user must create the app password with ",[316,317,318],"strong",{},"Allow access to your direct messages"," turned on.",[14,321,322],{},"The permissions a user granted are stored on the account. If an account lacks them, inbox calls return:",[174,324,328],{"className":325,"code":326,"language":327,"meta":179,"style":179},"language-json shiki shiki-themes github-light github-dark","{\n  \"statusCode\": 403,\n  \"statusMessage\": \"The instagram account was connected without instagram_manage_messages. Reconnect it with a connect link that has features: [\\\"inbox\\\"] and account_id.\",\n  \"data\": {\n    \"error\": {\n      \"code\": \"missing_scope\",\n      \"message\": \"…\",\n      \"details\": {\n        \"platform\": \"instagram\",\n        \"missing_scopes\": [\"instagram_manage_messages\"],\n        \"reconnect\": { \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\", \"features\": [\"inbox\"] }\n      }\n    }\n  }\n}\n","json",[18,329,330,336,350,372,380,388,401,414,422,435,450,480,486,492,498],{"__ignoreMap":179},[183,331,332],{"class":185,"line":186},[183,333,335],{"class":334},"sVt8B","{\n",[183,337,338,341,344,347],{"class":185,"line":207},[183,339,340],{"class":193},"  \"statusCode\"",[183,342,343],{"class":334},": ",[183,345,346],{"class":193},"403",[183,348,349],{"class":334},",\n",[183,351,352,355,357,360,363,365,367,370],{"class":185,"line":218},[183,353,354],{"class":193},"  \"statusMessage\"",[183,356,343],{"class":334},[183,358,359],{"class":197},"\"The instagram account was connected without instagram_manage_messages. Reconnect it with a connect link that has features: [",[183,361,362],{"class":193},"\\\"",[183,364,149],{"class":197},[183,366,362],{"class":193},[183,368,369],{"class":197},"] and account_id.\"",[183,371,349],{"class":334},[183,373,374,377],{"class":185,"line":228},[183,375,376],{"class":193},"  \"data\"",[183,378,379],{"class":334},": {\n",[183,381,383,386],{"class":185,"line":382},5,[183,384,385],{"class":193},"    \"error\"",[183,387,379],{"class":334},[183,389,391,394,396,399],{"class":185,"line":390},6,[183,392,393],{"class":193},"      \"code\"",[183,395,343],{"class":334},[183,397,398],{"class":197},"\"missing_scope\"",[183,400,349],{"class":334},[183,402,404,407,409,412],{"class":185,"line":403},7,[183,405,406],{"class":193},"      \"message\"",[183,408,343],{"class":334},[183,410,411],{"class":197},"\"…\"",[183,413,349],{"class":334},[183,415,417,420],{"class":185,"line":416},8,[183,418,419],{"class":193},"      \"details\"",[183,421,379],{"class":334},[183,423,425,428,430,433],{"class":185,"line":424},9,[183,426,427],{"class":193},"        \"platform\"",[183,429,343],{"class":334},[183,431,432],{"class":197},"\"instagram\"",[183,434,349],{"class":334},[183,436,438,441,444,447],{"class":185,"line":437},10,[183,439,440],{"class":193},"        \"missing_scopes\"",[183,442,443],{"class":334},": [",[183,445,446],{"class":197},"\"instagram_manage_messages\"",[183,448,449],{"class":334},"],\n",[183,451,453,456,459,462,464,467,469,472,474,477],{"class":185,"line":452},11,[183,454,455],{"class":193},"        \"reconnect\"",[183,457,458],{"class":334},": { ",[183,460,461],{"class":193},"\"account_id\"",[183,463,343],{"class":334},[183,465,466],{"class":197},"\"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\"",[183,468,263],{"class":334},[183,470,471],{"class":193},"\"features\"",[183,473,443],{"class":334},[183,475,476],{"class":197},"\"inbox\"",[183,478,479],{"class":334},"] }\n",[183,481,483],{"class":185,"line":482},12,[183,484,485],{"class":334},"      }\n",[183,487,489],{"class":185,"line":488},13,[183,490,491],{"class":334},"    }\n",[183,493,495],{"class":185,"line":494},14,[183,496,497],{"class":334},"  }\n",[183,499,501],{"class":185,"line":500},15,[183,502,503],{"class":334},"}\n",[14,505,506,507,263,510,513,514,517,518,521,522,525],{},"Create a connect link with ",[18,508,509],{},"user_id",[18,511,512],{},"account_id"," and ",[18,515,516],{},"features"," from ",[18,519,520],{},"details.reconnect"," and send it to the user. For Bluesky, ",[18,523,524],{},"missing_scope"," means the app password has no DM access; the user reconnects with a new app password.",[14,527,528,529,533],{},"If you use ",[168,530,532],{"href":531},"\u002Fdocs\u002Fconnect-links#your-own-oauth-apps","your own Meta app",", it is your app that needs App Review for these permissions. Until then, only people with a role on the app (admins, developers, testers) can grant them.",[156,535,537],{"id":536},"list-conversations","List conversations",[174,539,541],{"className":176,"code":540,"language":178,"meta":179,"style":179},"curl https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,542,543,552],{"__ignoreMap":179},[183,544,545,547,550],{"class":185,"line":186},[183,546,190],{"class":189},[183,548,549],{"class":197}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations",[183,551,204],{"class":193},[183,553,554,556],{"class":185,"line":207},[183,555,210],{"class":193},[183,557,558],{"class":197}," \"Authorization: Bearer pk_3f9a...\"\n",[174,560,562],{"className":325,"code":561,"language":327,"meta":179,"style":179},"{\n  \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n  \"platform\": \"instagram\",\n  \"data\": [\n    {\n      \"id\": \"aWdfZAG06MTpJR01lc3NhZA2VUaHJlYWQ6...\",\n      \"participants\": [{ \"id\": \"6543210987654321\", \"name\": null, \"username\": \"maria.design\", \"avatar_url\": null }],\n      \"updated_at\": \"2026-11-05T14:02:11+0000\",\n      \"unread_count\": 1,\n      \"last_message\": {\n        \"id\": \"aWdfZAG1faXRlbToxOklHTWVzc2FnZA...\",\n        \"conversation_id\": \"aWdfZAG06MTpJR01lc3NhZA2VUaHJlYWQ6...\",\n        \"text\": \"Do you ship to Norway?\",\n        \"sender_id\": \"6543210987654321\",\n        \"sender_name\": \"maria.design\",\n        \"from_me\": false,\n        \"created_at\": \"2026-11-05T14:02:11+0000\",\n        \"attachments\": []\n      }\n    }\n  ],\n  \"next_cursor\": \"QVFIUm...\"\n}\n",[18,563,564,568,579,590,597,602,614,661,673,685,692,704,715,727,738,749,762,774,783,788,793,799,810],{"__ignoreMap":179},[183,565,566],{"class":185,"line":186},[183,567,335],{"class":334},[183,569,570,573,575,577],{"class":185,"line":207},[183,571,572],{"class":193},"  \"account_id\"",[183,574,343],{"class":334},[183,576,466],{"class":197},[183,578,349],{"class":334},[183,580,581,584,586,588],{"class":185,"line":218},[183,582,583],{"class":193},"  \"platform\"",[183,585,343],{"class":334},[183,587,432],{"class":197},[183,589,349],{"class":334},[183,591,592,594],{"class":185,"line":228},[183,593,376],{"class":193},[183,595,596],{"class":334},": [\n",[183,598,599],{"class":185,"line":382},[183,600,601],{"class":334},"    {\n",[183,603,604,607,609,612],{"class":185,"line":390},[183,605,606],{"class":193},"      \"id\"",[183,608,343],{"class":334},[183,610,611],{"class":197},"\"aWdfZAG06MTpJR01lc3NhZA2VUaHJlYWQ6...\"",[183,613,349],{"class":334},[183,615,616,619,622,625,627,630,632,635,637,639,641,644,646,649,651,654,656,658],{"class":185,"line":403},[183,617,618],{"class":193},"      \"participants\"",[183,620,621],{"class":334},": [{ ",[183,623,624],{"class":193},"\"id\"",[183,626,343],{"class":334},[183,628,629],{"class":197},"\"6543210987654321\"",[183,631,263],{"class":334},[183,633,634],{"class":193},"\"name\"",[183,636,343],{"class":334},[183,638,153],{"class":193},[183,640,263],{"class":334},[183,642,643],{"class":193},"\"username\"",[183,645,343],{"class":334},[183,647,648],{"class":197},"\"maria.design\"",[183,650,263],{"class":334},[183,652,653],{"class":193},"\"avatar_url\"",[183,655,343],{"class":334},[183,657,153],{"class":193},[183,659,660],{"class":334}," }],\n",[183,662,663,666,668,671],{"class":185,"line":416},[183,664,665],{"class":193},"      \"updated_at\"",[183,667,343],{"class":334},[183,669,670],{"class":197},"\"2026-11-05T14:02:11+0000\"",[183,672,349],{"class":334},[183,674,675,678,680,683],{"class":185,"line":424},[183,676,677],{"class":193},"      \"unread_count\"",[183,679,343],{"class":334},[183,681,682],{"class":193},"1",[183,684,349],{"class":334},[183,686,687,690],{"class":185,"line":437},[183,688,689],{"class":193},"      \"last_message\"",[183,691,379],{"class":334},[183,693,694,697,699,702],{"class":185,"line":452},[183,695,696],{"class":193},"        \"id\"",[183,698,343],{"class":334},[183,700,701],{"class":197},"\"aWdfZAG1faXRlbToxOklHTWVzc2FnZA...\"",[183,703,349],{"class":334},[183,705,706,709,711,713],{"class":185,"line":482},[183,707,708],{"class":193},"        \"conversation_id\"",[183,710,343],{"class":334},[183,712,611],{"class":197},[183,714,349],{"class":334},[183,716,717,720,722,725],{"class":185,"line":488},[183,718,719],{"class":193},"        \"text\"",[183,721,343],{"class":334},[183,723,724],{"class":197},"\"Do you ship to Norway?\"",[183,726,349],{"class":334},[183,728,729,732,734,736],{"class":185,"line":494},[183,730,731],{"class":193},"        \"sender_id\"",[183,733,343],{"class":334},[183,735,629],{"class":197},[183,737,349],{"class":334},[183,739,740,743,745,747],{"class":185,"line":500},[183,741,742],{"class":193},"        \"sender_name\"",[183,744,343],{"class":334},[183,746,648],{"class":197},[183,748,349],{"class":334},[183,750,752,755,757,760],{"class":185,"line":751},16,[183,753,754],{"class":193},"        \"from_me\"",[183,756,343],{"class":334},[183,758,759],{"class":193},"false",[183,761,349],{"class":334},[183,763,765,768,770,772],{"class":185,"line":764},17,[183,766,767],{"class":193},"        \"created_at\"",[183,769,343],{"class":334},[183,771,670],{"class":197},[183,773,349],{"class":334},[183,775,777,780],{"class":185,"line":776},18,[183,778,779],{"class":193},"        \"attachments\"",[183,781,782],{"class":334},": []\n",[183,784,786],{"class":185,"line":785},19,[183,787,485],{"class":334},[183,789,791],{"class":185,"line":790},20,[183,792,491],{"class":334},[183,794,796],{"class":185,"line":795},21,[183,797,798],{"class":334},"  ],\n",[183,800,802,805,807],{"class":185,"line":801},22,[183,803,804],{"class":193},"  \"next_cursor\"",[183,806,343],{"class":334},[183,808,809],{"class":197},"\"QVFIUm...\"\n",[183,811,813],{"class":185,"line":812},23,[183,814,503],{"class":334},[14,816,817,818,821,822,825,826,829],{},"Pass ",[18,819,820],{},"next_cursor"," as ",[18,823,824],{},"cursor"," for the next page. ",[18,827,828],{},"participants"," leaves out the connected account itself.",[156,831,833],{"id":832},"read-a-conversation","Read a conversation",[174,835,837],{"className":176,"code":836,"language":178,"meta":179,"style":179},"curl \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations\u002FCONVERSATION_ID\u002Fmessages\" \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,838,839,848],{"__ignoreMap":179},[183,840,841,843,846],{"class":185,"line":186},[183,842,190],{"class":189},[183,844,845],{"class":197}," \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations\u002FCONVERSATION_ID\u002Fmessages\"",[183,847,204],{"class":193},[183,849,850,852],{"class":185,"line":207},[183,851,210],{"class":193},[183,853,558],{"class":197},[14,855,856,857,860,861,864,865,513,868,304],{},"Messages come newest first, in the same shape as ",[18,858,859],{},"last_message"," above. ",[18,862,863],{},"from_me"," is true for messages the account sent. URL-encode the conversation ID; Instagram IDs can contain ",[18,866,867],{},"=",[18,869,870],{},"\u002F",[156,872,40],{"id":873},"reply",[174,875,877],{"className":176,"code":876,"language":178,"meta":179,"style":179},"curl -X POST \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations\u002FCONVERSATION_ID\u002Fmessages\" \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Idempotency-Key: 6f1c2b7e-reply-1\" \\\n  -d '{ \"text\": \"Yes, we ship to Norway in 3–5 days.\", \"media\": [\"https:\u002F\u002Fcdn.example.com\u002Fshipping.jpg\"] }'\n",[18,878,879,891,899,907,916],{"__ignoreMap":179},[183,880,881,883,885,887,889],{"class":185,"line":186},[183,882,190],{"class":189},[183,884,194],{"class":193},[183,886,198],{"class":197},[183,888,845],{"class":197},[183,890,204],{"class":193},[183,892,893,895,897],{"class":185,"line":207},[183,894,210],{"class":193},[183,896,213],{"class":197},[183,898,204],{"class":193},[183,900,901,903,905],{"class":185,"line":218},[183,902,210],{"class":193},[183,904,223],{"class":197},[183,906,204],{"class":193},[183,908,909,911,914],{"class":185,"line":228},[183,910,210],{"class":193},[183,912,913],{"class":197}," \"Idempotency-Key: 6f1c2b7e-reply-1\"",[183,915,204],{"class":193},[183,917,918,920],{"class":185,"line":382},[183,919,231],{"class":193},[183,921,922],{"class":197}," '{ \"text\": \"Yes, we ship to Norway in 3–5 days.\", \"media\": [\"https:\u002F\u002Fcdn.example.com\u002Fshipping.jpg\"] }'\n",[14,924,925,926,929],{},"The response (",[18,927,928],{},"201",") is the sent message. Rules per platform:",[931,932,933,948,953],"ul",{},[934,935,936,939,940,943,944,947],"li",{},[316,937,938],{},"Facebook and Instagram"," only allow replies within 24 hours of the person's last message. After that the API returns ",[18,941,942],{},"422 invalid_request",". With ",[18,945,946],{},"\"tag\": \"HUMAN_AGENT\""," you can reply for up to 7 days if Meta approved the Human Agent permission for your app. Each media item is sent as its own message, text last.",[934,949,950,952],{},[316,951,120],{}," takes one image, GIF or video per message. The recipient must accept DMs from the account.",[934,954,955,957],{},[316,956,100],{}," is text only (up to 1,000 characters).",[14,959,960,961,964,965,967],{},"To message someone by their ID, for example the ",[18,962,963],{},"sender_id"," of a ",[18,966,20],{}," event (Meta webhooks don't say which conversation a message belongs to), use:",[174,969,971],{"className":176,"code":970,"language":178,"meta":179,"style":179},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fmessages \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"recipient_id\": \"6543210987654321\", \"text\": \"Thanks for your message!\" }'\n",[18,972,973,986,994,1002],{"__ignoreMap":179},[183,974,975,977,979,981,984],{"class":185,"line":186},[183,976,190],{"class":189},[183,978,194],{"class":193},[183,980,198],{"class":197},[183,982,983],{"class":197}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fmessages",[183,985,204],{"class":193},[183,987,988,990,992],{"class":185,"line":207},[183,989,210],{"class":193},[183,991,213],{"class":197},[183,993,204],{"class":193},[183,995,996,998,1000],{"class":185,"line":218},[183,997,210],{"class":193},[183,999,223],{"class":197},[183,1001,204],{"class":193},[183,1003,1004,1006],{"class":185,"line":228},[183,1005,231],{"class":193},[183,1007,1008],{"class":197}," '{ \"recipient_id\": \"6543210987654321\", \"text\": \"Thanks for your message!\" }'\n",[14,1010,1011,1012,1015],{},"On Bluesky (",[18,1013,1014],{},"recipient_id"," is a DID) and X (a numeric user ID) this starts a conversation if there is none, as long as the person accepts DMs from the account. Facebook and Instagram only reach people who wrote to the account in the last 24 hours.",[156,1017,1019],{"id":1018},"mark-as-read","Mark as read",[174,1021,1023],{"className":176,"code":1022,"language":178,"meta":179,"style":179},"curl -X POST \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations\u002FCONVERSATION_ID\u002Fread\" \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,1024,1025,1038],{"__ignoreMap":179},[183,1026,1027,1029,1031,1033,1036],{"class":185,"line":186},[183,1028,190],{"class":189},[183,1030,194],{"class":193},[183,1032,198],{"class":197},[183,1034,1035],{"class":197}," \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts\u002Fj97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\u002Fconversations\u002FCONVERSATION_ID\u002Fread\"",[183,1037,204],{"class":193},[183,1039,1040,1042],{"class":185,"line":207},[183,1041,210],{"class":193},[183,1043,558],{"class":197},[14,1045,1046,1047,304],{},"Works on Facebook, Instagram and Bluesky. X has no API for it and returns ",[18,1048,1049],{},"400 not_supported",[156,1051,1053],{"id":1052},"new-messages","New messages",[14,1055,1056,1057,1061,1062,172],{},"Subscribe a ",[168,1058,1060],{"href":1059},"\u002Fdocs\u002Fwebhooks","webhook endpoint"," to ",[18,1063,20],{},[174,1065,1067],{"className":325,"code":1066,"language":327,"meta":179,"style":179},"{\n  \"id\": \"evt_5b0c1f8a9e2d4c6b7a8f9e0d\",\n  \"event\": \"message.received\",\n  \"created_at\": \"2026-11-05T14:02:13.000Z\",\n  \"test\": false,\n  \"data\": {\n    \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n    \"platform\": \"instagram\",\n    \"user_id\": \"user_123\",\n    \"source\": \"webhook\",\n    \"message\": {\n      \"id\": \"aWdfZAG1faXRlbToxOklHTWVzc2FnZA...\",\n      \"conversation_id\": null,\n      \"text\": \"Do you ship to Norway?\",\n      \"sender_id\": \"6543210987654321\",\n      \"sender_name\": null,\n      \"from_me\": false,\n      \"created_at\": \"2026-11-05T14:02:11.000Z\",\n      \"attachments\": []\n    }\n  }\n}\n",[18,1068,1069,1073,1085,1097,1109,1120,1126,1137,1148,1160,1172,1179,1189,1200,1211,1222,1233,1244,1256,1263,1267,1271],{"__ignoreMap":179},[183,1070,1071],{"class":185,"line":186},[183,1072,335],{"class":334},[183,1074,1075,1078,1080,1083],{"class":185,"line":207},[183,1076,1077],{"class":193},"  \"id\"",[183,1079,343],{"class":334},[183,1081,1082],{"class":197},"\"evt_5b0c1f8a9e2d4c6b7a8f9e0d\"",[183,1084,349],{"class":334},[183,1086,1087,1090,1092,1095],{"class":185,"line":218},[183,1088,1089],{"class":193},"  \"event\"",[183,1091,343],{"class":334},[183,1093,1094],{"class":197},"\"message.received\"",[183,1096,349],{"class":334},[183,1098,1099,1102,1104,1107],{"class":185,"line":228},[183,1100,1101],{"class":193},"  \"created_at\"",[183,1103,343],{"class":334},[183,1105,1106],{"class":197},"\"2026-11-05T14:02:13.000Z\"",[183,1108,349],{"class":334},[183,1110,1111,1114,1116,1118],{"class":185,"line":382},[183,1112,1113],{"class":193},"  \"test\"",[183,1115,343],{"class":334},[183,1117,759],{"class":193},[183,1119,349],{"class":334},[183,1121,1122,1124],{"class":185,"line":390},[183,1123,376],{"class":193},[183,1125,379],{"class":334},[183,1127,1128,1131,1133,1135],{"class":185,"line":403},[183,1129,1130],{"class":193},"    \"account_id\"",[183,1132,343],{"class":334},[183,1134,466],{"class":197},[183,1136,349],{"class":334},[183,1138,1139,1142,1144,1146],{"class":185,"line":416},[183,1140,1141],{"class":193},"    \"platform\"",[183,1143,343],{"class":334},[183,1145,432],{"class":197},[183,1147,349],{"class":334},[183,1149,1150,1153,1155,1158],{"class":185,"line":424},[183,1151,1152],{"class":193},"    \"user_id\"",[183,1154,343],{"class":334},[183,1156,1157],{"class":197},"\"user_123\"",[183,1159,349],{"class":334},[183,1161,1162,1165,1167,1170],{"class":185,"line":437},[183,1163,1164],{"class":193},"    \"source\"",[183,1166,343],{"class":334},[183,1168,1169],{"class":197},"\"webhook\"",[183,1171,349],{"class":334},[183,1173,1174,1177],{"class":185,"line":452},[183,1175,1176],{"class":193},"    \"message\"",[183,1178,379],{"class":334},[183,1180,1181,1183,1185,1187],{"class":185,"line":482},[183,1182,606],{"class":193},[183,1184,343],{"class":334},[183,1186,701],{"class":197},[183,1188,349],{"class":334},[183,1190,1191,1194,1196,1198],{"class":185,"line":488},[183,1192,1193],{"class":193},"      \"conversation_id\"",[183,1195,343],{"class":334},[183,1197,153],{"class":193},[183,1199,349],{"class":334},[183,1201,1202,1205,1207,1209],{"class":185,"line":494},[183,1203,1204],{"class":193},"      \"text\"",[183,1206,343],{"class":334},[183,1208,724],{"class":197},[183,1210,349],{"class":334},[183,1212,1213,1216,1218,1220],{"class":185,"line":500},[183,1214,1215],{"class":193},"      \"sender_id\"",[183,1217,343],{"class":334},[183,1219,629],{"class":197},[183,1221,349],{"class":334},[183,1223,1224,1227,1229,1231],{"class":185,"line":751},[183,1225,1226],{"class":193},"      \"sender_name\"",[183,1228,343],{"class":334},[183,1230,153],{"class":193},[183,1232,349],{"class":334},[183,1234,1235,1238,1240,1242],{"class":185,"line":764},[183,1236,1237],{"class":193},"      \"from_me\"",[183,1239,343],{"class":334},[183,1241,759],{"class":193},[183,1243,349],{"class":334},[183,1245,1246,1249,1251,1254],{"class":185,"line":776},[183,1247,1248],{"class":193},"      \"created_at\"",[183,1250,343],{"class":334},[183,1252,1253],{"class":197},"\"2026-11-05T14:02:11.000Z\"",[183,1255,349],{"class":334},[183,1257,1258,1261],{"class":185,"line":785},[183,1259,1260],{"class":193},"      \"attachments\"",[183,1262,782],{"class":334},[183,1264,1265],{"class":185,"line":790},[183,1266,491],{"class":334},[183,1268,1269],{"class":185,"line":795},[183,1270,497],{"class":334},[183,1272,1273],{"class":185,"line":801},[183,1274,503],{"class":334},[14,1276,1277],{},"Each message is sent once (deduplicated by message ID). How Pogton learns about it depends on the platform:",[931,1279,1280,1294,1300],{},[934,1281,1282,1285,1286,1289,1290,1293],{},[316,1283,1284],{},"Facebook and Instagram:"," Meta pushes new messages to Pogton (",[18,1287,1288],{},"source: \"webhook\"","). For accounts whose events don't arrive that way, Pogton checks every 5 minutes (",[18,1291,1292],{},"source: \"polling\"",").",[934,1295,1296,1299],{},[316,1297,1298],{},"Bluesky:"," checked every minute.",[934,1301,1302,1305],{},[316,1303,1304],{},"X:"," checked every 15 minutes.",[14,1307,1308,1309,1311,1312,1315],{},"Polling only runs for organizations with an endpoint subscribed to ",[18,1310,20],{}," (or ",[18,1313,1314],{},"*","), and only for accounts that have the inbox permissions. Pogton does not store message text; it keeps message IDs for 14 days to avoid duplicates.",[1317,1318,1320],"h3",{"id":1319},"costs-on-x","Costs on X",[14,1322,1323,1324,1327,1328,1330],{},"X charges for DM reads under its pay-per-use pricing (or requires a paid tier). Every conversation list, message page and poll is a read on the X app the account was connected with: Pogton's, or ",[168,1325,1326],{"href":531},"your own",". Polling one X account costs about 96 reads a day. Unsubscribe from ",[18,1329,20],{}," to stop polling.",[156,1332,52],{"id":1333},"comment-automations",[14,1335,1336,1337,1341],{},"A comment automation sends a DM to anyone who comments a keyword on an Instagram or Facebook post, and can also reply to the comment publicly. The DM is a Meta ",[1338,1339,1340],"em",{},"private reply",", which works even if the person never messaged the account, once per comment and within 7 days of it.",[174,1343,1345],{"className":176,"code":1344,"language":178,"meta":179,"style":179},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fcomment-automations \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n    \"name\": \"Spring guide\",\n    \"keywords\": [\"guide\", \"link\"],\n    \"post_ids\": [\"17895695668004550\"],\n    \"dm_text\": \"Hi {name}! Here is the guide: https:\u002F\u002Fexample.com\u002Fguide\",\n    \"reply_text\": \"Sent you a DM 📩\"\n  }'\n",[18,1346,1347,1360,1368,1376,1383,1388,1393,1398,1403,1408,1413],{"__ignoreMap":179},[183,1348,1349,1351,1353,1355,1358],{"class":185,"line":186},[183,1350,190],{"class":189},[183,1352,194],{"class":193},[183,1354,198],{"class":197},[183,1356,1357],{"class":197}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fcomment-automations",[183,1359,204],{"class":193},[183,1361,1362,1364,1366],{"class":185,"line":207},[183,1363,210],{"class":193},[183,1365,213],{"class":197},[183,1367,204],{"class":193},[183,1369,1370,1372,1374],{"class":185,"line":218},[183,1371,210],{"class":193},[183,1373,223],{"class":197},[183,1375,204],{"class":193},[183,1377,1378,1380],{"class":185,"line":228},[183,1379,231],{"class":193},[183,1381,1382],{"class":197}," '{\n",[183,1384,1385],{"class":185,"line":382},[183,1386,1387],{"class":197},"    \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n",[183,1389,1390],{"class":185,"line":390},[183,1391,1392],{"class":197},"    \"name\": \"Spring guide\",\n",[183,1394,1395],{"class":185,"line":403},[183,1396,1397],{"class":197},"    \"keywords\": [\"guide\", \"link\"],\n",[183,1399,1400],{"class":185,"line":416},[183,1401,1402],{"class":197},"    \"post_ids\": [\"17895695668004550\"],\n",[183,1404,1405],{"class":185,"line":424},[183,1406,1407],{"class":197},"    \"dm_text\": \"Hi {name}! Here is the guide: https:\u002F\u002Fexample.com\u002Fguide\",\n",[183,1409,1410],{"class":185,"line":437},[183,1411,1412],{"class":197},"    \"reply_text\": \"Sent you a DM 📩\"\n",[183,1414,1415],{"class":185,"line":452},[183,1416,1417],{"class":197},"  }'\n",[23,1419,1420,1436],{},[26,1421,1422],{},[29,1423,1424,1427,1430,1433],{},[32,1425,1426],{},"Field",[32,1428,1429],{},"Type",[32,1431,1432],{},"Required",[32,1434,1435],{},"Description",[54,1437,1438,1452,1468,1493,1513,1535,1549,1563],{},[29,1439,1440,1444,1447,1449],{},[59,1441,1442],{},[18,1443,512],{},[59,1445,1446],{},"string",[59,1448,64],{},[59,1450,1451],{},"An Instagram or Facebook account with the inbox permissions.",[29,1453,1454,1459,1463,1465],{},[59,1455,1456],{},[18,1457,1458],{},"keywords",[59,1460,1446,1461],{},[183,1462],{},[59,1464,115],{},[59,1466,1467],{},"A comment matches when it contains any of them, ignoring case. Empty or left out: every comment matches.",[29,1469,1470,1475,1477,1479],{},[59,1471,1472],{},[18,1473,1474],{},"match",[59,1476,1446],{},[59,1478,115],{},[59,1480,1481,1484,1485,1488,1489,1492],{},[18,1482,1483],{},"contains"," (default), ",[18,1486,1487],{},"word"," (whole word) or ",[18,1490,1491],{},"exact"," (the whole comment).",[29,1494,1495,1500,1504,1506],{},[59,1496,1497],{},[18,1498,1499],{},"post_ids",[59,1501,1446,1502],{},[183,1503],{},[59,1505,115],{},[59,1507,1508,1509,1512],{},"Platform post IDs (",[18,1510,1511],{},"targets[].platform_post_id","). Left out: every post.",[29,1514,1515,1520,1522,1524],{},[59,1516,1517],{},[18,1518,1519],{},"dm_text",[59,1521,1446],{},[59,1523,64],{},[59,1525,1526,1527,1530,1531,1534],{},"The DM, up to 1,000 characters. ",[18,1528,1529],{},"{name}"," becomes the commenter's first name, ",[18,1532,1533],{},"{username}"," their username.",[29,1536,1537,1542,1544,1546],{},[59,1538,1539],{},[18,1540,1541],{},"reply_text",[59,1543,1446],{},[59,1545,115],{},[59,1547,1548],{},"A public reply to the comment, with the same placeholders.",[29,1550,1551,1556,1558,1560],{},[59,1552,1553],{},[18,1554,1555],{},"name",[59,1557,1446],{},[59,1559,115],{},[59,1561,1562],{},"Your label.",[29,1564,1565,1570,1573,1575],{},[59,1566,1567],{},[18,1568,1569],{},"enabled",[59,1571,1572],{},"boolean",[59,1574,115],{},[59,1576,1577,1578,304],{},"Default ",[18,1579,1580],{},"true",[14,1582,1583],{},"How it behaves:",[931,1585,1586,1592,1595,1601],{},[934,1587,1588,1591],{},[316,1589,1590],{},"One DM per person per rule and post."," A second comment by the same person on the same post doesn't trigger the rule again.",[934,1593,1594],{},"Only comments made after the rule was created count. The account's own comments never trigger it.",[934,1596,1597,1598,1600],{},"With Meta webhooks set up, comments are handled within seconds. Otherwise Pogton checks the watched posts every 5 minutes; for rules without ",[18,1599,1499],{}," that means the account's posts published through Pogton in the last 7 days.",[934,1602,1603,1604,1607,1608,1611,1612,1615,1616,1619],{},"Every time a rule fires, Pogton sends ",[18,1605,1606],{},"automation.triggered"," to endpoints subscribed to it, with ",[18,1609,1610],{},"dm_sent",", the comment, and ",[18,1613,1614],{},"error"," if the DM or the public reply failed. ",[18,1617,1618],{},"trigger_count"," on the rule counts the DMs sent.",[14,1621,1622,1623,1626,1627,1630,1631,263,1634,513,1637,142,1640,1642,1643,1646,1647,1649,1650,263,1652,1654,1655,304],{},"Manage rules with ",[18,1624,1625],{},"GET \u002Fcomment-automations"," (optionally ",[18,1628,1629],{},"?account_id=","), ",[18,1632,1633],{},"GET",[18,1635,1636],{},"PATCH",[18,1638,1639],{},"DELETE \u002Fcomment-automations\u002F{id}",[18,1641,1636],{}," with ",[18,1644,1645],{},"\"enabled\": false"," pauses a rule; ",[18,1648,153],{}," clears ",[18,1651,1555],{},[18,1653,1499],{}," or ",[18,1656,1541],{},[156,1658,1660],{"id":1659},"sandbox","Sandbox",[14,1662,1663,1664,1668],{},"With a test key, inbox calls on a ",[168,1665,1667],{"href":1666},"\u002Fdocs\u002Fsandbox","sandbox account"," of a supported platform return a fixed conversation and simulate sending, and comment automations can be created and edited (they never fire).",[156,1670,1672],{"id":1671},"mcp","MCP",[14,1674,1675,1676,1680,1681,263,1684,263,1687,263,1690,263,1693,263,1696,263,1699,263,1702,263,1705,513,1708,304],{},"The ",[168,1677,1679],{"href":1678},"\u002Fdocs\u002Fmcp","MCP server"," has the same calls as tools: ",[18,1682,1683],{},"list_conversations",[18,1685,1686],{},"list_messages",[18,1688,1689],{},"send_message",[18,1691,1692],{},"send_direct_message",[18,1694,1695],{},"mark_conversation_read",[18,1697,1698],{},"list_comment_automations",[18,1700,1701],{},"get_comment_automation",[18,1703,1704],{},"create_comment_automation",[18,1706,1707],{},"update_comment_automation",[18,1709,1710],{},"delete_comment_automation",[156,1712,1714],{"id":1713},"setting-up-meta-webhooks-self-hosted-apps","Setting up Meta webhooks (self-hosted apps)",[14,1716,1717,1718,1720],{},"For accounts connected through Pogton's Meta app, Pogton receives these webhooks. If you connect accounts through ",[168,1719,532],{"href":531},", set up its webhooks so DMs and comments arrive in real time instead of by polling:",[1722,1723,1724,1731,1748],"ol",{},[934,1725,1726,1727,1730],{},"In the Meta app dashboard, add the ",[316,1728,1729],{},"Webhooks"," product.",[934,1732,1733,1734,1737,1738,1741,1742,513,1745,304],{},"For the ",[316,1735,1736],{},"Page"," object, set the callback URL to ",[18,1739,1740],{},"https:\u002F\u002Fpogton.com\u002Fapi\u002Fwebhooks\u002Fmeta?org=YOUR_ORG_SLUG",", use the verify token Pogton support gives you, and subscribe to ",[18,1743,1744],{},"messages",[18,1746,1747],{},"feed",[934,1749,1733,1750,1752,1753,513,1755,304],{},[316,1751,274],{}," object, use the same callback URL and subscribe to ",[18,1754,1744],{},[18,1756,1757],{},"comments",[14,1759,1760,1761,1764,1765,304],{},"Pogton subscribes each connected Page to the app's webhooks (",[18,1762,1763],{},"subscribed_apps",") the first time it polls the account or a comment automation is created, which needs ",[18,1766,266],{},[1768,1769,1770],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":179,"searchDepth":207,"depth":207,"links":1772},[1773,1774,1775,1776,1777,1778,1781,1782,1783,1784],{"id":158,"depth":207,"text":159},{"id":536,"depth":207,"text":537},{"id":832,"depth":207,"text":833},{"id":873,"depth":207,"text":40},{"id":1018,"depth":207,"text":1019},{"id":1052,"depth":207,"text":1053,"children":1779},[1780],{"id":1319,"depth":218,"text":1320},{"id":1333,"depth":207,"text":52},{"id":1659,"depth":207,"text":1660},{"id":1671,"depth":207,"text":1672},{"id":1713,"depth":207,"text":1714},"Read and answer direct messages on Facebook, Instagram, Bluesky and X through one API, get a webhook for every new DM, and send a DM automatically when someone comments a keyword.","md",{},true,10.5,"\u002Fdocs\u002Finbox",{"title":5,"description":1785},"Unified DM Inbox API and Comment-to-DM Automations","docs\u002Finbox","p61yS5fILm9fYIUMIIakThoEIa9aY25flYH2AnAWFlw",1794240388094]