[{"data":1,"prerenderedAt":701},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fconnect-links":3},{"id":4,"title":5,"body":6,"description":692,"extension":693,"meta":694,"navigation":695,"order":84,"path":696,"seo":697,"seoTitle":698,"stem":699,"__hash__":700},"docs\u002Fdocs\u002Fconnect-links.md","Connect links",{"type":7,"value":8,"toc":685},"minimark",[9,13,17,26,31,39,131,207,360,363,367,390,400,404,416,437,454,458,477,480,520,532,543,547,550,592,632,639,681],[10,11,5],"h1",{"id":12},"connect-links",[14,15,16],"p",{},"A connect link is a signed URL to your branded connect page. Your user opens it, picks a platform and signs in with that platform. Pogton stores the tokens and keeps them fresh. You never handle OAuth.",[14,18,19,20,25],{},"To show your own account picker instead of the hosted page, use ",[21,22,24],"a",{"href":23},"\u002Fdocs\u002Fheadless-connect","headless connect",".",[27,28,30],"h2",{"id":29},"create-a-link","Create a link",[14,32,33,34,38],{},"Call this from your server, then redirect the user to ",[35,36,37],"code",{},"url"," or send it to them.",[40,41,46],"pre",{"className":42,"code":43,"language":44,"meta":45,"style":45},"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 '{\n    \"user_id\": \"user_123\",\n    \"platforms\": [\"linkedin\", \"instagram\"],\n    \"redirect_url\": \"https:\u002F\u002Fapp.example.com\u002Fsettings\u002Fsocial\",\n    \"expires_in\": 3600\n  }'\n","bash","",[35,47,48,71,82,92,101,107,113,119,125],{"__ignoreMap":45},[49,50,53,57,61,65,68],"span",{"class":51,"line":52},"line",1,[49,54,56],{"class":55},"sScJk","curl",[49,58,60],{"class":59},"sj4cs"," -X",[49,62,64],{"class":63},"sZZnC"," POST",[49,66,67],{"class":63}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fconnect-link",[49,69,70],{"class":59}," \\\n",[49,72,74,77,80],{"class":51,"line":73},2,[49,75,76],{"class":59},"  -H",[49,78,79],{"class":63}," \"Authorization: Bearer pk_3f9a...\"",[49,81,70],{"class":59},[49,83,85,87,90],{"class":51,"line":84},3,[49,86,76],{"class":59},[49,88,89],{"class":63}," \"Content-Type: application\u002Fjson\"",[49,91,70],{"class":59},[49,93,95,98],{"class":51,"line":94},4,[49,96,97],{"class":59},"  -d",[49,99,100],{"class":63}," '{\n",[49,102,104],{"class":51,"line":103},5,[49,105,106],{"class":63},"    \"user_id\": \"user_123\",\n",[49,108,110],{"class":51,"line":109},6,[49,111,112],{"class":63},"    \"platforms\": [\"linkedin\", \"instagram\"],\n",[49,114,116],{"class":51,"line":115},7,[49,117,118],{"class":63},"    \"redirect_url\": \"https:\u002F\u002Fapp.example.com\u002Fsettings\u002Fsocial\",\n",[49,120,122],{"class":51,"line":121},8,[49,123,124],{"class":63},"    \"expires_in\": 3600\n",[49,126,128],{"class":51,"line":127},9,[49,129,130],{"class":63},"  }'\n",[40,132,136],{"className":133,"code":134,"language":135,"meta":45,"style":45},"language-json shiki shiki-themes github-light github-dark","{\n  \"url\": \"https:\u002F\u002Fpogton.com\u002Fp\u002Fyour-org?token=eyJ1c2VyX2lkIjoi...\",\n  \"expires_at\": \"2026-10-21T10:00:00.000Z\",\n  \"user_id\": \"user_123\",\n  \"platforms\": [\"linkedin\", \"instagram\"]\n}\n","json",[35,137,138,144,158,170,182,202],{"__ignoreMap":45},[49,139,140],{"class":51,"line":52},[49,141,143],{"class":142},"sVt8B","{\n",[49,145,146,149,152,155],{"class":51,"line":73},[49,147,148],{"class":59},"  \"url\"",[49,150,151],{"class":142},": ",[49,153,154],{"class":63},"\"https:\u002F\u002Fpogton.com\u002Fp\u002Fyour-org?token=eyJ1c2VyX2lkIjoi...\"",[49,156,157],{"class":142},",\n",[49,159,160,163,165,168],{"class":51,"line":84},[49,161,162],{"class":59},"  \"expires_at\"",[49,164,151],{"class":142},[49,166,167],{"class":63},"\"2026-10-21T10:00:00.000Z\"",[49,169,157],{"class":142},[49,171,172,175,177,180],{"class":51,"line":94},[49,173,174],{"class":59},"  \"user_id\"",[49,176,151],{"class":142},[49,178,179],{"class":63},"\"user_123\"",[49,181,157],{"class":142},[49,183,184,187,190,193,196,199],{"class":51,"line":103},[49,185,186],{"class":59},"  \"platforms\"",[49,188,189],{"class":142},": [",[49,191,192],{"class":63},"\"linkedin\"",[49,194,195],{"class":142},", ",[49,197,198],{"class":63},"\"instagram\"",[49,200,201],{"class":142},"]\n",[49,203,204],{"class":51,"line":109},[49,205,206],{"class":142},"}\n",[208,209,210,229],"table",{},[211,212,213],"thead",{},[214,215,216,220,223,226],"tr",{},[217,218,219],"th",{},"Field",[217,221,222],{},"Type",[217,224,225],{},"Required",[217,227,228],{},"Description",[230,231,232,249,266,288,306,330,345],"tbody",{},[214,233,234,240,243,246],{},[235,236,237],"td",{},[35,238,239],{},"user_id",[235,241,242],{},"string",[235,244,245],{},"Yes",[235,247,248],{},"Your ID for the user, up to 255 characters. The user is created now if new.",[214,250,251,256,260,263],{},[235,252,253],{},[35,254,255],{},"platforms",[235,257,242,258],{},[49,259],{},[235,261,262],{},"No",[235,264,265],{},"Only offer these platforms on the page. Default: every platform enabled for your page.",[214,267,268,273,275,277],{},[235,269,270],{},[35,271,272],{},"redirect_url",[235,274,242],{},[235,276,262],{},[235,278,279,280,283,284,25],{},"Where to send the user afterwards. HTTPS, or ",[35,281,282],{},"http:\u002F\u002Flocalhost"," for development. Default: the Redirect URL set under ",[285,286,287],"strong",{},"Dashboard → Connect → Page",[214,289,290,295,297,299],{},[235,291,292],{},[35,293,294],{},"account_id",[235,296,242],{},[235,298,262],{},[235,300,301,302,25],{},"Reconnect this account. The page offers only its platform. See ",[21,303,305],{"href":304},"#reconnecting-an-account","Reconnecting",[214,307,308,313,317,319],{},[235,309,310],{},[35,311,312],{},"features",[235,314,242,315],{},[49,316],{},[235,318,262],{},[235,320,321,322,325,326,25],{},"Extra permissions to ask for. ",[35,323,324],{},"[\"inbox\"]"," adds the direct-message permissions (Facebook, Instagram, X) for the ",[21,327,329],{"href":328},"\u002Fdocs\u002Finbox#permissions","inbox",[214,331,332,337,340,342],{},[235,333,334],{},[35,335,336],{},"expires_in",[235,338,339],{},"integer",[235,341,262],{},[235,343,344],{},"Seconds until the link expires: 60 to 86400. Default 3600.",[214,346,347,352,355,357],{},[235,348,349],{},[35,350,351],{},"metadata",[235,353,354],{},"object",[235,356,262],{},[235,358,359],{},"Stored on the user.",[14,361,362],{},"The link is signed with the API key that created it. Revoking that key invalidates its links. A link can be opened more than once until it expires, so treat it like a password reset link: send it only to that user.",[27,364,366],{"id":365},"what-the-user-sees","What the user sees",[368,369,370,376,379],"ol",{},[371,372,373,374,25],"li",{},"Your logo and colours, set under ",[285,375,287],{},[371,377,378],{},"The platforms you offer. Platforms with several accounts, such as LinkedIn pages or Facebook pages, ask the user which ones to connect.",[371,380,381,382,385,386,389],{},"After connecting, the user goes to the redirect URL with ",[35,383,384],{},"connected=\u003Cplatform>"," added, for example ",[35,387,388],{},"https:\u002F\u002Fapp.example.com\u002Fsettings\u002Fsocial?connected=linkedin",". Without a redirect URL they return to the connect page.",[14,391,392,393,399],{},"Bluesky has no OAuth: the page asks for the user's handle and an ",[21,394,398],{"href":395,"rel":396},"https:\u002F\u002Fbsky.app\u002Fsettings\u002Fapp-passwords",[397],"nofollow","app password"," instead. Telegram asks for the token of the user's own bot and the channel to post to, and Mastodon asks for the user's server before sending them there to sign in. You don't need to build anything for these.",[27,401,403],{"id":402},"after-connecting","After connecting",[14,405,406,407,410,411,415],{},"Pogton sends an ",[35,408,409],{},"account.connected"," ",[21,412,414],{"href":413},"\u002Fdocs\u002Fwebhooks","webhook"," with the new account's ID. Or list the user's accounts:",[40,417,419],{"className":42,"code":418,"language":44,"meta":45,"style":45},"curl \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts?user_id=user_123\" \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[35,420,421,430],{"__ignoreMap":45},[49,422,423,425,428],{"class":51,"line":52},[49,424,56],{"class":55},[49,426,427],{"class":63}," \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Faccounts?user_id=user_123\"",[49,429,70],{"class":59},[49,431,432,434],{"class":51,"line":73},[49,433,76],{"class":59},[49,435,436],{"class":63}," \"Authorization: Bearer pk_3f9a...\"\n",[14,438,439,440,443,444,446,447,449,450,25],{},"Then publish with those ",[35,441,442],{},"account_ids",", or with ",[35,445,239],{}," and ",[35,448,255],{},". See ",[21,451,453],{"href":452},"\u002Fdocs\u002Fpublishing","Publishing",[27,455,457],{"id":456},"reconnecting-an-account","Reconnecting an account",[14,459,460,461,464,465,468,469,472,473,476],{},"Tokens stop working when a user changes their password, removes your app's access, or when a platform's token can't be refreshed (LinkedIn tokens last about 60 days). Pogton then sets the account's ",[35,462,463],{},"status"," to ",[35,466,467],{},"needs_reauth"," and sends ",[35,470,471],{},"account.needs_reauth",". Publishing to it fails with ",[35,474,475],{},"auth_expired"," until the user reconnects.",[14,478,479],{},"To reconnect, create a link with the account's ID:",[40,481,483],{"className":42,"code":482,"language":44,"meta":45,"style":45},"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\", \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\" }'\n",[35,484,485,497,505,513],{"__ignoreMap":45},[49,486,487,489,491,493,495],{"class":51,"line":52},[49,488,56],{"class":55},[49,490,60],{"class":59},[49,492,64],{"class":63},[49,494,67],{"class":63},[49,496,70],{"class":59},[49,498,499,501,503],{"class":51,"line":73},[49,500,76],{"class":59},[49,502,79],{"class":63},[49,504,70],{"class":59},[49,506,507,509,511],{"class":51,"line":84},[49,508,76],{"class":59},[49,510,89],{"class":63},[49,512,70],{"class":59},[49,514,515,517],{"class":51,"line":94},[49,516,97],{"class":59},[49,518,519],{"class":63}," '{ \"user_id\": \"user_123\", \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\" }'\n",[14,521,522,523,526,527,531],{},"The page offers only that account's platform. When the user signs in again, the same account gets new tokens and goes back to ",[35,524,525],{},"active","; its ID doesn't change. Then ",[21,528,530],{"href":529},"\u002Fdocs\u002Fpublishing#retry","retry"," any posts that failed in the meantime.",[14,533,534,536,537,539,540,25],{},[35,535,294],{}," must belong to ",[35,538,239],{},"; otherwise the API returns ",[35,541,542],{},"422 account_user_mismatch",[27,544,546],{"id":545},"your-own-oauth-apps","Your own OAuth apps",[14,548,549],{},"By default users sign in through Pogton's app for each platform. To show your own app name on the consent screen, add your app's credentials:",[40,551,553],{"className":42,"code":552,"language":44,"meta":45,"style":45},"curl -X PUT https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fplatform-credentials\u002Flinkedin \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"client_id\": \"86abc...\", \"client_secret\": \"WPL_AP1...\" }'\n",[35,554,555,569,577,585],{"__ignoreMap":45},[49,556,557,559,561,564,567],{"class":51,"line":52},[49,558,56],{"class":55},[49,560,60],{"class":59},[49,562,563],{"class":63}," PUT",[49,565,566],{"class":63}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fplatform-credentials\u002Flinkedin",[49,568,70],{"class":59},[49,570,571,573,575],{"class":51,"line":73},[49,572,76],{"class":59},[49,574,79],{"class":63},[49,576,70],{"class":59},[49,578,579,581,583],{"class":51,"line":84},[49,580,76],{"class":59},[49,582,89],{"class":63},[49,584,70],{"class":59},[49,586,587,589],{"class":51,"line":94},[49,588,97],{"class":59},[49,590,591],{"class":63}," '{ \"client_id\": \"86abc...\", \"client_secret\": \"WPL_AP1...\" }'\n",[40,593,595],{"className":133,"code":594,"language":135,"meta":45,"style":45},"{ \"platform\": \"linkedin\", \"client_id\": \"86abc...\", \"message\": \"Credentials saved. client_secret is stored encrypted and will not be returned.\" }\n",[35,596,597],{"__ignoreMap":45},[49,598,599,602,605,607,609,611,614,616,619,621,624,626,629],{"class":51,"line":52},[49,600,601],{"class":142},"{ ",[49,603,604],{"class":59},"\"platform\"",[49,606,151],{"class":142},[49,608,192],{"class":63},[49,610,195],{"class":142},[49,612,613],{"class":59},"\"client_id\"",[49,615,151],{"class":142},[49,617,618],{"class":63},"\"86abc...\"",[49,620,195],{"class":142},[49,622,623],{"class":59},"\"message\"",[49,625,151],{"class":142},[49,627,628],{"class":63},"\"Credentials saved. client_secret is stored encrypted and will not be returned.\"",[49,630,631],{"class":142}," }\n",[14,633,634,635,638],{},"Set the redirect URI in your app to ",[35,636,637],{},"https:\u002F\u002Fpogton.com\u002Fapi\u002Foauth\u002F\u003Cplatform>\u002Fcallback",". New connections use your app from then on. Accounts connected through another app keep refreshing through that app; to move them, have the users reconnect.",[14,640,641,642,645,646,195,649,195,652,195,655,195,658,195,661,195,664,195,667,195,670,195,673,676,677,680],{},"Setting or deleting credentials needs a live key, since they decide where live users' tokens go. ",[35,643,644],{},"DELETE \u002Fapi\u002Fv1\u002Fplatform-credentials\u002F{platform}"," goes back to Pogton's app. Accounts connected through your app can no longer refresh their tokens and must reconnect. Platforms: ",[35,647,648],{},"twitter",[35,650,651],{},"linkedin",[35,653,654],{},"instagram",[35,656,657],{},"facebook",[35,659,660],{},"tiktok",[35,662,663],{},"youtube",[35,665,666],{},"pinterest",[35,668,669],{},"threads",[35,671,672],{},"google_business",[35,674,675],{},"discord",". Bluesky, Telegram and Mastodon need no app. For Discord, add ",[35,678,679],{},"https:\u002F\u002Fpogton.com\u002Fapi\u002Foauth\u002Fdiscord\u002Fcallback"," as a redirect in your Discord application's OAuth2 settings.",[682,683,684],"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":45,"searchDepth":73,"depth":73,"links":686},[687,688,689,690,691],{"id":29,"depth":73,"text":30},{"id":365,"depth":73,"text":366},{"id":402,"depth":73,"text":403},{"id":456,"depth":73,"text":457},{"id":545,"depth":73,"text":546},"Create short-lived signed connect links so your users connect their social accounts over OAuth on your branded page, limit the platforms offered and reconnect accounts.","md",{},true,"\u002Fdocs\u002Fconnect-links",{"title":5,"description":692},"Connect Links: Let Users Connect Social Accounts","docs\u002Fconnect-links","b88uCnLKHRHLLnEfK5pQSf1cLMo4z0B1BhtqLUgXXj0",1794240385890]