[{"data":1,"prerenderedAt":2662},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fwebhooks":3},{"id":4,"title":5,"body":6,"description":2654,"extension":2655,"meta":2656,"navigation":1269,"order":447,"path":2657,"seo":2658,"seoTitle":2659,"stem":2660,"__hash__":2661},"docs\u002Fdocs\u002Fwebhooks.md","Webhooks",{"type":7,"value":8,"toc":2636},"minimark",[9,13,22,27,185,194,198,206,292,451,478,482,485,751,783,788,898,938,942,1047,1054,1064,1068,1179,1183,1193,1226,1231,1867,1871,2053,2060,2064,2071,2074,2136,2148,2151,2179,2183,2186,2207,2373,2401,2404,2428,2431,2435,2459,2465,2469,2551,2561,2565,2589,2629,2632],[10,11,5],"h1",{"id":12},"webhooks",[14,15,16,17,21],"p",{},"Webhooks tell your server when something happens without polling: a scheduled post went out, a platform rejected a post, an account needs to reconnect. Pogton sends a signed ",[18,19,20],"code",{},"POST"," with a JSON body to each endpoint you register.",[23,24,26],"h2",{"id":25},"events","Events",[28,29,30,43],"table",{},[31,32,33],"thead",{},[34,35,36,40],"tr",{},[37,38,39],"th",{},"Event",[37,41,42],{},"When",[44,45,46,61,71,81,91,101,111,121,131,141,157,172],"tbody",{},[34,47,48,54],{},[49,50,51],"td",{},[18,52,53],{},"post.scheduled",[49,55,56,57,60],{},"A post was scheduled with ",[18,58,59],{},"scheduled_at"," or added to the queue.",[34,62,63,68],{},[49,64,65],{},[18,66,67],{},"post.published",[49,69,70],{},"Every target of a post was published.",[34,72,73,78],{},[49,74,75],{},[18,76,77],{},"post.partially_published",[49,79,80],{},"Some targets were published and at least one failed for good.",[34,82,83,88],{},[49,84,85],{},[18,86,87],{},"post.failed",[49,89,90],{},"No target could be published, after automatic retries.",[34,92,93,98],{},[49,94,95],{},[18,96,97],{},"post.cancelled",[49,99,100],{},"A draft or scheduled post was cancelled.",[34,102,103,108],{},[49,104,105],{},[18,106,107],{},"post.deleted",[49,109,110],{},"A published post was deleted from one or more platforms.",[34,112,113,118],{},[49,114,115],{},[18,116,117],{},"account.connected",[49,119,120],{},"A user connected an account, or a sandbox account was created.",[34,122,123,128],{},[49,124,125],{},[18,126,127],{},"account.disconnected",[49,129,130],{},"An account was disconnected through the API, by the user, or because the user was deleted.",[34,132,133,138],{},[49,134,135],{},[18,136,137],{},"account.needs_reauth",[49,139,140],{},"An account's token stopped working. Sent once, when the status changes.",[34,142,143,148],{},[49,144,145],{},[18,146,147],{},"message.received",[49,149,150,151,156],{},"A connected account received a direct message. See ",[152,153,155],"a",{"href":154},"\u002Fdocs\u002Finbox#new-messages","Inbox",".",[34,158,159,164],{},[49,160,161],{},[18,162,163],{},"automation.triggered",[49,165,166,167,171],{},"A ",[152,168,170],{"href":169},"\u002Fdocs\u002Finbox#comment-automations","comment automation"," matched a comment and sent (or tried to send) a DM.",[34,173,174,179],{},[49,175,176],{},[18,177,178],{},"webhook.test",[49,180,181,182,156],{},"Sent by ",[18,183,184],{},"POST \u002Fwebhooks\u002F{id}\u002Ftest",[14,186,187,188,190,191,193],{},"Post events fire when a post's status changes, so a post published now sends ",[18,189,67],{}," (or ",[18,192,87],{},") once, and a post that retries sends the final outcome when it is known.",[23,195,197],{"id":196},"register-an-endpoint","Register an endpoint",[14,199,200,201,205],{},"In the dashboard under ",[202,203,204],"strong",{},"Connect → Webhooks",", or with the API:",[207,208,213],"pre",{"className":209,"code":210,"language":211,"meta":212,"style":212},"language-bash shiki shiki-themes github-light github-dark","curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Production\",\n    \"url\": \"https:\u002F\u002Fapi.example.com\u002Fwebhooks\u002Fpogton\",\n    \"events\": [\"post.published\", \"post.partially_published\", \"post.failed\", \"account.needs_reauth\"]\n  }'\n","bash","",[18,214,215,238,249,259,268,274,280,286],{"__ignoreMap":212},[216,217,220,224,228,232,235],"span",{"class":218,"line":219},"line",1,[216,221,223],{"class":222},"sScJk","curl",[216,225,227],{"class":226},"sj4cs"," -X",[216,229,231],{"class":230},"sZZnC"," POST",[216,233,234],{"class":230}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks",[216,236,237],{"class":226}," \\\n",[216,239,241,244,247],{"class":218,"line":240},2,[216,242,243],{"class":226},"  -H",[216,245,246],{"class":230}," \"Authorization: Bearer pk_3f9a...\"",[216,248,237],{"class":226},[216,250,252,254,257],{"class":218,"line":251},3,[216,253,243],{"class":226},[216,255,256],{"class":230}," \"Content-Type: application\u002Fjson\"",[216,258,237],{"class":226},[216,260,262,265],{"class":218,"line":261},4,[216,263,264],{"class":226},"  -d",[216,266,267],{"class":230}," '{\n",[216,269,271],{"class":218,"line":270},5,[216,272,273],{"class":230},"    \"name\": \"Production\",\n",[216,275,277],{"class":218,"line":276},6,[216,278,279],{"class":230},"    \"url\": \"https:\u002F\u002Fapi.example.com\u002Fwebhooks\u002Fpogton\",\n",[216,281,283],{"class":218,"line":282},7,[216,284,285],{"class":230},"    \"events\": [\"post.published\", \"post.partially_published\", \"post.failed\", \"account.needs_reauth\"]\n",[216,287,289],{"class":218,"line":288},8,[216,290,291],{"class":230},"  }'\n",[207,293,297],{"className":294,"code":295,"language":296,"meta":212,"style":212},"language-json shiki shiki-themes github-light github-dark","{\n  \"id\": \"q47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\",\n  \"name\": \"Production\",\n  \"description\": null,\n  \"url\": \"https:\u002F\u002Fapi.example.com\u002Fwebhooks\u002Fpogton\",\n  \"events\": [\"post.published\", \"post.partially_published\", \"post.failed\", \"account.needs_reauth\"],\n  \"enabled\": true,\n  \"created_at\": \"2026-10-21T09:00:00.000Z\",\n  \"updated_at\": \"2026-10-21T09:00:00.000Z\",\n  \"secret\": \"whsec_6a1f0c3b9d2e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e\",\n  \"message\": \"Store the secret now; it is not shown again.\"\n}\n","json",[18,298,299,305,319,331,343,355,385,397,409,421,434,445],{"__ignoreMap":212},[216,300,301],{"class":218,"line":219},[216,302,304],{"class":303},"sVt8B","{\n",[216,306,307,310,313,316],{"class":218,"line":240},[216,308,309],{"class":226},"  \"id\"",[216,311,312],{"class":303},": ",[216,314,315],{"class":230},"\"q47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\"",[216,317,318],{"class":303},",\n",[216,320,321,324,326,329],{"class":218,"line":251},[216,322,323],{"class":226},"  \"name\"",[216,325,312],{"class":303},[216,327,328],{"class":230},"\"Production\"",[216,330,318],{"class":303},[216,332,333,336,338,341],{"class":218,"line":261},[216,334,335],{"class":226},"  \"description\"",[216,337,312],{"class":303},[216,339,340],{"class":226},"null",[216,342,318],{"class":303},[216,344,345,348,350,353],{"class":218,"line":270},[216,346,347],{"class":226},"  \"url\"",[216,349,312],{"class":303},[216,351,352],{"class":230},"\"https:\u002F\u002Fapi.example.com\u002Fwebhooks\u002Fpogton\"",[216,354,318],{"class":303},[216,356,357,360,363,366,369,372,374,377,379,382],{"class":218,"line":276},[216,358,359],{"class":226},"  \"events\"",[216,361,362],{"class":303},": [",[216,364,365],{"class":230},"\"post.published\"",[216,367,368],{"class":303},", ",[216,370,371],{"class":230},"\"post.partially_published\"",[216,373,368],{"class":303},[216,375,376],{"class":230},"\"post.failed\"",[216,378,368],{"class":303},[216,380,381],{"class":230},"\"account.needs_reauth\"",[216,383,384],{"class":303},"],\n",[216,386,387,390,392,395],{"class":218,"line":282},[216,388,389],{"class":226},"  \"enabled\"",[216,391,312],{"class":303},[216,393,394],{"class":226},"true",[216,396,318],{"class":303},[216,398,399,402,404,407],{"class":218,"line":288},[216,400,401],{"class":226},"  \"created_at\"",[216,403,312],{"class":303},[216,405,406],{"class":230},"\"2026-10-21T09:00:00.000Z\"",[216,408,318],{"class":303},[216,410,412,415,417,419],{"class":218,"line":411},9,[216,413,414],{"class":226},"  \"updated_at\"",[216,416,312],{"class":303},[216,418,406],{"class":230},[216,420,318],{"class":303},[216,422,424,427,429,432],{"class":218,"line":423},10,[216,425,426],{"class":226},"  \"secret\"",[216,428,312],{"class":303},[216,430,431],{"class":230},"\"whsec_6a1f0c3b9d2e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e\"",[216,433,318],{"class":303},[216,435,437,440,442],{"class":218,"line":436},11,[216,438,439],{"class":226},"  \"message\"",[216,441,312],{"class":303},[216,443,444],{"class":230},"\"Store the secret now; it is not shown again.\"\n",[216,446,448],{"class":218,"line":447},12,[216,449,450],{"class":303},"}\n",[452,453,454,464,471],"ul",{},[455,456,457,459,460,463],"li",{},[18,458,25],{}," takes any of the events above, or ",[18,461,462],{},"[\"*\"]"," for all of them.",[455,465,466,467,470],{},"URLs must be public HTTPS. Endpoints registered with a test key may use ",[18,468,469],{},"http:\u002F\u002F",", for local tunnels.",[455,472,473,474,477],{},"The ",[18,475,476],{},"secret"," is returned only in this response. Store it with your other secrets.",[23,479,481],{"id":480},"payload","Payload",[14,483,484],{},"Every event has the same envelope:",[207,486,488],{"className":294,"code":487,"language":296,"meta":212,"style":212},"{\n  \"id\": \"evt_3f2a1b0c9d8e7f6a5b4c3d2e\",\n  \"event\": \"post.published\",\n  \"created_at\": \"2026-10-21T09:00:03.000Z\",\n  \"test\": false,\n  \"data\": {\n    \"post\": {\n      \"id\": \"k57c2d9e1f3g5h7j9k1m3n5p7q9r2s4t\",\n      \"status\": \"published\",\n      \"user_id\": \"user_123\",\n      \"content\": \"Our spring collection is out today.\",\n      \"metadata\": { \"campaign_id\": \"spring-26\" },\n      \"targets\": [\n        {\n          \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n          \"platform\": \"linkedin\",\n          \"status\": \"published\",\n          \"platform_post_id\": \"urn:li:share:7234567890\",\n          \"url\": \"https:\u002F\u002Fwww.linkedin.com\u002Ffeed\u002Fupdate\u002Furn:li:share:7234567890\",\n          \"error\": null\n        }\n      ],\n      \"...\": \"the full post object\"\n    }\n  }\n}\n",[18,489,490,494,505,516,527,539,547,554,566,578,590,602,621,630,636,649,662,674,687,700,711,717,723,734,740,746],{"__ignoreMap":212},[216,491,492],{"class":218,"line":219},[216,493,304],{"class":303},[216,495,496,498,500,503],{"class":218,"line":240},[216,497,309],{"class":226},[216,499,312],{"class":303},[216,501,502],{"class":230},"\"evt_3f2a1b0c9d8e7f6a5b4c3d2e\"",[216,504,318],{"class":303},[216,506,507,510,512,514],{"class":218,"line":251},[216,508,509],{"class":226},"  \"event\"",[216,511,312],{"class":303},[216,513,365],{"class":230},[216,515,318],{"class":303},[216,517,518,520,522,525],{"class":218,"line":261},[216,519,401],{"class":226},[216,521,312],{"class":303},[216,523,524],{"class":230},"\"2026-10-21T09:00:03.000Z\"",[216,526,318],{"class":303},[216,528,529,532,534,537],{"class":218,"line":270},[216,530,531],{"class":226},"  \"test\"",[216,533,312],{"class":303},[216,535,536],{"class":226},"false",[216,538,318],{"class":303},[216,540,541,544],{"class":218,"line":276},[216,542,543],{"class":226},"  \"data\"",[216,545,546],{"class":303},": {\n",[216,548,549,552],{"class":218,"line":282},[216,550,551],{"class":226},"    \"post\"",[216,553,546],{"class":303},[216,555,556,559,561,564],{"class":218,"line":288},[216,557,558],{"class":226},"      \"id\"",[216,560,312],{"class":303},[216,562,563],{"class":230},"\"k57c2d9e1f3g5h7j9k1m3n5p7q9r2s4t\"",[216,565,318],{"class":303},[216,567,568,571,573,576],{"class":218,"line":411},[216,569,570],{"class":226},"      \"status\"",[216,572,312],{"class":303},[216,574,575],{"class":230},"\"published\"",[216,577,318],{"class":303},[216,579,580,583,585,588],{"class":218,"line":423},[216,581,582],{"class":226},"      \"user_id\"",[216,584,312],{"class":303},[216,586,587],{"class":230},"\"user_123\"",[216,589,318],{"class":303},[216,591,592,595,597,600],{"class":218,"line":436},[216,593,594],{"class":226},"      \"content\"",[216,596,312],{"class":303},[216,598,599],{"class":230},"\"Our spring collection is out today.\"",[216,601,318],{"class":303},[216,603,604,607,610,613,615,618],{"class":218,"line":447},[216,605,606],{"class":226},"      \"metadata\"",[216,608,609],{"class":303},": { ",[216,611,612],{"class":226},"\"campaign_id\"",[216,614,312],{"class":303},[216,616,617],{"class":230},"\"spring-26\"",[216,619,620],{"class":303}," },\n",[216,622,624,627],{"class":218,"line":623},13,[216,625,626],{"class":226},"      \"targets\"",[216,628,629],{"class":303},": [\n",[216,631,633],{"class":218,"line":632},14,[216,634,635],{"class":303},"        {\n",[216,637,639,642,644,647],{"class":218,"line":638},15,[216,640,641],{"class":226},"          \"account_id\"",[216,643,312],{"class":303},[216,645,646],{"class":230},"\"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\"",[216,648,318],{"class":303},[216,650,652,655,657,660],{"class":218,"line":651},16,[216,653,654],{"class":226},"          \"platform\"",[216,656,312],{"class":303},[216,658,659],{"class":230},"\"linkedin\"",[216,661,318],{"class":303},[216,663,665,668,670,672],{"class":218,"line":664},17,[216,666,667],{"class":226},"          \"status\"",[216,669,312],{"class":303},[216,671,575],{"class":230},[216,673,318],{"class":303},[216,675,677,680,682,685],{"class":218,"line":676},18,[216,678,679],{"class":226},"          \"platform_post_id\"",[216,681,312],{"class":303},[216,683,684],{"class":230},"\"urn:li:share:7234567890\"",[216,686,318],{"class":303},[216,688,690,693,695,698],{"class":218,"line":689},19,[216,691,692],{"class":226},"          \"url\"",[216,694,312],{"class":303},[216,696,697],{"class":230},"\"https:\u002F\u002Fwww.linkedin.com\u002Ffeed\u002Fupdate\u002Furn:li:share:7234567890\"",[216,699,318],{"class":303},[216,701,703,706,708],{"class":218,"line":702},20,[216,704,705],{"class":226},"          \"error\"",[216,707,312],{"class":303},[216,709,710],{"class":226},"null\n",[216,712,714],{"class":218,"line":713},21,[216,715,716],{"class":303},"        }\n",[216,718,720],{"class":218,"line":719},22,[216,721,722],{"class":303},"      ],\n",[216,724,726,729,731],{"class":218,"line":725},23,[216,727,728],{"class":226},"      \"...\"",[216,730,312],{"class":303},[216,732,733],{"class":230},"\"the full post object\"\n",[216,735,737],{"class":218,"line":736},24,[216,738,739],{"class":303},"    }\n",[216,741,743],{"class":218,"line":742},25,[216,744,745],{"class":303},"  }\n",[216,747,749],{"class":218,"line":748},26,[216,750,450],{"class":303},[14,752,753,756,757,759,760,762,763,767,768,771,772,775,776,778,779,782],{},[18,754,755],{},"test"," is ",[18,758,394],{}," for events about test-mode posts and for ",[18,761,178],{},". Post events carry the full ",[152,764,766],{"href":765},"\u002Fdocs\u002Fpublishing#the-post-object","post object"," in ",[18,769,770],{},"data.post",", including your ",[18,773,774],{},"metadata",". ",[18,777,107],{}," also has ",[18,780,781],{},"data.results",", one per account, as in the delete response.",[14,784,785,787],{},[18,786,117],{},":",[207,789,791],{"className":294,"code":790,"language":296,"meta":212,"style":212},"{\n  \"id\": \"evt_8a7b6c5d4e3f2a1b0c9d8e7f\",\n  \"event\": \"account.connected\",\n  \"created_at\": \"2026-10-21T09:00:00.000Z\",\n  \"test\": false,\n  \"data\": {\n    \"platform\": \"instagram\",\n    \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n    \"account_name\": \"Acme Studio\",\n    \"user_id\": \"user_123\"\n  }\n}\n",[18,792,793,797,808,819,829,839,845,857,868,880,890,894],{"__ignoreMap":212},[216,794,795],{"class":218,"line":219},[216,796,304],{"class":303},[216,798,799,801,803,806],{"class":218,"line":240},[216,800,309],{"class":226},[216,802,312],{"class":303},[216,804,805],{"class":230},"\"evt_8a7b6c5d4e3f2a1b0c9d8e7f\"",[216,807,318],{"class":303},[216,809,810,812,814,817],{"class":218,"line":251},[216,811,509],{"class":226},[216,813,312],{"class":303},[216,815,816],{"class":230},"\"account.connected\"",[216,818,318],{"class":303},[216,820,821,823,825,827],{"class":218,"line":261},[216,822,401],{"class":226},[216,824,312],{"class":303},[216,826,406],{"class":230},[216,828,318],{"class":303},[216,830,831,833,835,837],{"class":218,"line":270},[216,832,531],{"class":226},[216,834,312],{"class":303},[216,836,536],{"class":226},[216,838,318],{"class":303},[216,840,841,843],{"class":218,"line":276},[216,842,543],{"class":226},[216,844,546],{"class":303},[216,846,847,850,852,855],{"class":218,"line":282},[216,848,849],{"class":226},"    \"platform\"",[216,851,312],{"class":303},[216,853,854],{"class":230},"\"instagram\"",[216,856,318],{"class":303},[216,858,859,862,864,866],{"class":218,"line":288},[216,860,861],{"class":226},"    \"account_id\"",[216,863,312],{"class":303},[216,865,646],{"class":230},[216,867,318],{"class":303},[216,869,870,873,875,878],{"class":218,"line":411},[216,871,872],{"class":226},"    \"account_name\"",[216,874,312],{"class":303},[216,876,877],{"class":230},"\"Acme Studio\"",[216,879,318],{"class":303},[216,881,882,885,887],{"class":218,"line":423},[216,883,884],{"class":226},"    \"user_id\"",[216,886,312],{"class":303},[216,888,889],{"class":230},"\"user_123\"\n",[216,891,892],{"class":218,"line":436},[216,893,745],{"class":303},[216,895,896],{"class":218,"line":447},[216,897,450],{"class":303},[14,899,900,902,903,368,906,368,909,368,912,915,916,312,919,922,923,926,927,930,931,922,934,937],{},[18,901,127],{}," has ",[18,904,905],{},"platform",[18,907,908],{},"account_id",[18,910,911],{},"account_name",[18,913,914],{},"user_id"," (when known) and ",[18,917,918],{},"reason",[18,920,921],{},"api"," (",[18,924,925],{},"DELETE \u002Faccounts\u002F{id}","), ",[18,928,929],{},"end_user"," (on the connect page) or ",[18,932,933],{},"user_deleted",[18,935,936],{},"DELETE \u002Fusers\u002F{id}",").",[14,939,940,787],{},[18,941,137],{},[207,943,945],{"className":294,"code":944,"language":296,"meta":212,"style":212},"{\n  \"id\": \"evt_1c2d3e4f5a6b7c8d9e0f1a2b\",\n  \"event\": \"account.needs_reauth\",\n  \"created_at\": \"2026-10-21T09:00:00.000Z\",\n  \"test\": false,\n  \"data\": {\n    \"account_id\": \"j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed\",\n    \"platform\": \"linkedin\",\n    \"account_name\": \"Acme Inc.\",\n    \"reason\": \"Token expired and could not be refreshed: LinkedIn tokens can't be refreshed\"\n  }\n}\n",[18,946,947,951,962,972,982,992,998,1008,1018,1029,1039,1043],{"__ignoreMap":212},[216,948,949],{"class":218,"line":219},[216,950,304],{"class":303},[216,952,953,955,957,960],{"class":218,"line":240},[216,954,309],{"class":226},[216,956,312],{"class":303},[216,958,959],{"class":230},"\"evt_1c2d3e4f5a6b7c8d9e0f1a2b\"",[216,961,318],{"class":303},[216,963,964,966,968,970],{"class":218,"line":251},[216,965,509],{"class":226},[216,967,312],{"class":303},[216,969,381],{"class":230},[216,971,318],{"class":303},[216,973,974,976,978,980],{"class":218,"line":261},[216,975,401],{"class":226},[216,977,312],{"class":303},[216,979,406],{"class":230},[216,981,318],{"class":303},[216,983,984,986,988,990],{"class":218,"line":270},[216,985,531],{"class":226},[216,987,312],{"class":303},[216,989,536],{"class":226},[216,991,318],{"class":303},[216,993,994,996],{"class":218,"line":276},[216,995,543],{"class":226},[216,997,546],{"class":303},[216,999,1000,1002,1004,1006],{"class":218,"line":282},[216,1001,861],{"class":226},[216,1003,312],{"class":303},[216,1005,646],{"class":230},[216,1007,318],{"class":303},[216,1009,1010,1012,1014,1016],{"class":218,"line":288},[216,1011,849],{"class":226},[216,1013,312],{"class":303},[216,1015,659],{"class":230},[216,1017,318],{"class":303},[216,1019,1020,1022,1024,1027],{"class":218,"line":411},[216,1021,872],{"class":226},[216,1023,312],{"class":303},[216,1025,1026],{"class":230},"\"Acme Inc.\"",[216,1028,318],{"class":303},[216,1030,1031,1034,1036],{"class":218,"line":423},[216,1032,1033],{"class":226},"    \"reason\"",[216,1035,312],{"class":303},[216,1037,1038],{"class":230},"\"Token expired and could not be refreshed: LinkedIn tokens can't be refreshed\"\n",[216,1040,1041],{"class":218,"line":436},[216,1042,745],{"class":303},[216,1044,1045],{"class":218,"line":447},[216,1046,450],{"class":303},[14,1048,1049,1050,156],{},"When you get it, send the user a ",[152,1051,1053],{"href":1052},"\u002Fdocs\u002Fconnect-links#reconnecting-an-account","reconnect link",[14,1055,1056,1057,1059,1060,156],{},"The full schema of every payload is in the ",[18,1058,12],{}," section of the ",[152,1061,1063],{"href":1062},"\u002Fdocs\u002Fopenapi","OpenAPI spec",[23,1065,1067],{"id":1066},"headers","Headers",[28,1069,1070,1080],{},[31,1071,1072],{},[34,1073,1074,1077],{},[37,1075,1076],{},"Header",[37,1078,1079],{},"Value",[44,1081,1082,1094,1108,1118,1128,1141,1154,1167],{},[34,1083,1084,1089],{},[49,1085,1086],{},[18,1087,1088],{},"X-Pogton-Event",[49,1090,1091,1092,156],{},"The event, e.g. ",[18,1093,67],{},[34,1095,1096,1101],{},[49,1097,1098],{},[18,1099,1100],{},"X-Pogton-Event-Id",[49,1102,1103,1104,1107],{},"The event ID (",[18,1105,1106],{},"evt_…","). The same on every delivery of the event.",[34,1109,1110,1115],{},[49,1111,1112],{},[18,1113,1114],{},"X-Pogton-Delivery",[49,1116,1117],{},"The delivery ID.",[34,1119,1120,1125],{},[49,1121,1122],{},[18,1123,1124],{},"X-Pogton-Attempt",[49,1126,1127],{},"1 for the first attempt, up to 6.",[34,1129,1130,1135],{},[49,1131,1132],{},[18,1133,1134],{},"X-Pogton-Signature-V2",[49,1136,1137,1140],{},[18,1138,1139],{},"t=\u003Cunix seconds>,v1=\u003Csignature>",". Verify this one.",[34,1142,1143,1148],{},[49,1144,1145],{},[18,1146,1147],{},"X-Pogton-Signature",[49,1149,1150,1153],{},[18,1151,1152],{},"sha256=\u003Csignature of the body>",". The first version, kept for existing integrations.",[34,1155,1156,1161],{},[49,1157,1158],{},[18,1159,1160],{},"X-Pogton-Timestamp",[49,1162,1163,1164,156],{},"The same timestamp as ",[18,1165,1166],{},"t",[34,1168,1169,1174],{},[49,1170,1171],{},[18,1172,1173],{},"User-Agent",[49,1175,1176],{},[18,1177,1178],{},"Pogton-Webhooks\u002F1.0",[23,1180,1182],{"id":1181},"verify-the-signature","Verify the signature",[14,1184,1185,1188,1189,1192],{},[18,1186,1187],{},"v1"," is the hex HMAC-SHA256 of ",[18,1190,1191],{},"\u003Ct>.\u003Craw body>",", keyed with the endpoint secret. Because the timestamp is signed, you can reject old requests: anyone who captured a request can't replay it later.",[1194,1195,1196,1199,1210,1216],"ol",{},[455,1197,1198],{},"Read the raw body before any JSON parsing; a re-serialised body won't match.",[455,1200,1201,1202,1204,1205,1207,1208,156],{},"Split ",[18,1203,1134],{}," into ",[18,1206,1166],{}," and ",[18,1209,1187],{},[455,1211,1212,1213,1215],{},"Reject the request if ",[18,1214,1166],{}," is more than 5 minutes from your clock.",[455,1217,1218,1219,1222,1223,1225],{},"Compute the HMAC of ",[18,1220,1221],{},"t + \".\" + body"," and compare it to ",[18,1224,1187],{}," in constant time.",[1227,1228,1230],"h3",{"id":1229},"nodejs","Node.js",[207,1232,1236],{"className":1233,"code":1234,"language":1235,"meta":212,"style":212},"language-js shiki shiki-themes github-light github-dark","import crypto from 'node:crypto'\nimport express from 'express'\n\nconst SECRET = process.env.POGTON_WEBHOOK_SECRET\nconst TOLERANCE_SECONDS = 300\n\nfunction verifyPogtonSignature(rawBody, header, secret) {\n  if (!header) return false\n  const parts = Object.fromEntries(header.split(',').map((part) => {\n    const i = part.indexOf('=')\n    return [part.slice(0, i), part.slice(i + 1)]\n  }))\n  const timestamp = Number(parts.t)\n  if (!timestamp || !parts.v1) return false\n  if (Math.abs(Date.now() \u002F 1000 - timestamp) > TOLERANCE_SECONDS) return false\n\n  const expected = crypto.createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest()\n  const received = Buffer.from(parts.v1, 'hex')\n  return received.length === expected.length && crypto.timingSafeEqual(received, expected)\n}\n\nconst app = express()\n\n\u002F\u002F express.raw keeps the body as bytes, exactly as signed\napp.post('\u002Fwebhooks\u002Fpogton', express.raw({ type: 'application\u002Fjson' }), (req, res) => {\n  const rawBody = req.body.toString('utf8')\n  if (!verifyPogtonSignature(rawBody, req.get('X-Pogton-Signature-V2'), SECRET)) {\n    return res.status(400).send('Invalid signature')\n  }\n  const event = JSON.parse(rawBody)\n  res.sendStatus(200) \u002F\u002F answer first, then do the work\n  handleEvent(event).catch(console.error)\n})\n","js",[18,1237,1238,1253,1265,1271,1288,1300,1304,1331,1350,1397,1421,1454,1459,1474,1498,1540,1544,1594,1616,1646,1650,1654,1668,1672,1678,1720,1742,1773,1801,1806,1827,1846,1861],{"__ignoreMap":212},[216,1239,1240,1244,1247,1250],{"class":218,"line":219},[216,1241,1243],{"class":1242},"szBVR","import",[216,1245,1246],{"class":303}," crypto ",[216,1248,1249],{"class":1242},"from",[216,1251,1252],{"class":230}," 'node:crypto'\n",[216,1254,1255,1257,1260,1262],{"class":218,"line":240},[216,1256,1243],{"class":1242},[216,1258,1259],{"class":303}," express ",[216,1261,1249],{"class":1242},[216,1263,1264],{"class":230}," 'express'\n",[216,1266,1267],{"class":218,"line":251},[216,1268,1270],{"emptyLinePlaceholder":1269},true,"\n",[216,1272,1273,1276,1279,1282,1285],{"class":218,"line":261},[216,1274,1275],{"class":1242},"const",[216,1277,1278],{"class":226}," SECRET",[216,1280,1281],{"class":1242}," =",[216,1283,1284],{"class":303}," process.env.",[216,1286,1287],{"class":226},"POGTON_WEBHOOK_SECRET\n",[216,1289,1290,1292,1295,1297],{"class":218,"line":270},[216,1291,1275],{"class":1242},[216,1293,1294],{"class":226}," TOLERANCE_SECONDS",[216,1296,1281],{"class":1242},[216,1298,1299],{"class":226}," 300\n",[216,1301,1302],{"class":218,"line":276},[216,1303,1270],{"emptyLinePlaceholder":1269},[216,1305,1306,1309,1312,1315,1319,1321,1324,1326,1328],{"class":218,"line":282},[216,1307,1308],{"class":1242},"function",[216,1310,1311],{"class":222}," verifyPogtonSignature",[216,1313,1314],{"class":303},"(",[216,1316,1318],{"class":1317},"s4XuR","rawBody",[216,1320,368],{"class":303},[216,1322,1323],{"class":1317},"header",[216,1325,368],{"class":303},[216,1327,476],{"class":1317},[216,1329,1330],{"class":303},") {\n",[216,1332,1333,1336,1338,1341,1344,1347],{"class":218,"line":288},[216,1334,1335],{"class":1242},"  if",[216,1337,922],{"class":303},[216,1339,1340],{"class":1242},"!",[216,1342,1343],{"class":303},"header) ",[216,1345,1346],{"class":1242},"return",[216,1348,1349],{"class":226}," false\n",[216,1351,1352,1355,1358,1360,1363,1366,1369,1372,1374,1377,1379,1382,1385,1388,1391,1394],{"class":218,"line":411},[216,1353,1354],{"class":1242},"  const",[216,1356,1357],{"class":226}," parts",[216,1359,1281],{"class":1242},[216,1361,1362],{"class":303}," Object.",[216,1364,1365],{"class":222},"fromEntries",[216,1367,1368],{"class":303},"(header.",[216,1370,1371],{"class":222},"split",[216,1373,1314],{"class":303},[216,1375,1376],{"class":230},"','",[216,1378,937],{"class":303},[216,1380,1381],{"class":222},"map",[216,1383,1384],{"class":303},"((",[216,1386,1387],{"class":1317},"part",[216,1389,1390],{"class":303},") ",[216,1392,1393],{"class":1242},"=>",[216,1395,1396],{"class":303}," {\n",[216,1398,1399,1402,1405,1407,1410,1413,1415,1418],{"class":218,"line":423},[216,1400,1401],{"class":1242},"    const",[216,1403,1404],{"class":226}," i",[216,1406,1281],{"class":1242},[216,1408,1409],{"class":303}," part.",[216,1411,1412],{"class":222},"indexOf",[216,1414,1314],{"class":303},[216,1416,1417],{"class":230},"'='",[216,1419,1420],{"class":303},")\n",[216,1422,1423,1426,1429,1432,1434,1437,1440,1442,1445,1448,1451],{"class":218,"line":436},[216,1424,1425],{"class":1242},"    return",[216,1427,1428],{"class":303}," [part.",[216,1430,1431],{"class":222},"slice",[216,1433,1314],{"class":303},[216,1435,1436],{"class":226},"0",[216,1438,1439],{"class":303},", i), part.",[216,1441,1431],{"class":222},[216,1443,1444],{"class":303},"(i ",[216,1446,1447],{"class":1242},"+",[216,1449,1450],{"class":226}," 1",[216,1452,1453],{"class":303},")]\n",[216,1455,1456],{"class":218,"line":447},[216,1457,1458],{"class":303},"  }))\n",[216,1460,1461,1463,1466,1468,1471],{"class":218,"line":623},[216,1462,1354],{"class":1242},[216,1464,1465],{"class":226}," timestamp",[216,1467,1281],{"class":1242},[216,1469,1470],{"class":222}," Number",[216,1472,1473],{"class":303},"(parts.t)\n",[216,1475,1476,1478,1480,1482,1485,1488,1491,1494,1496],{"class":218,"line":632},[216,1477,1335],{"class":1242},[216,1479,922],{"class":303},[216,1481,1340],{"class":1242},[216,1483,1484],{"class":303},"timestamp ",[216,1486,1487],{"class":1242},"||",[216,1489,1490],{"class":1242}," !",[216,1492,1493],{"class":303},"parts.v1) ",[216,1495,1346],{"class":1242},[216,1497,1349],{"class":226},[216,1499,1500,1502,1505,1508,1511,1514,1517,1520,1523,1526,1529,1532,1534,1536,1538],{"class":218,"line":638},[216,1501,1335],{"class":1242},[216,1503,1504],{"class":303}," (Math.",[216,1506,1507],{"class":222},"abs",[216,1509,1510],{"class":303},"(Date.",[216,1512,1513],{"class":222},"now",[216,1515,1516],{"class":303},"() ",[216,1518,1519],{"class":1242},"\u002F",[216,1521,1522],{"class":226}," 1000",[216,1524,1525],{"class":1242}," -",[216,1527,1528],{"class":303}," timestamp) ",[216,1530,1531],{"class":1242},">",[216,1533,1294],{"class":226},[216,1535,1390],{"class":303},[216,1537,1346],{"class":1242},[216,1539,1349],{"class":226},[216,1541,1542],{"class":218,"line":651},[216,1543,1270],{"emptyLinePlaceholder":1269},[216,1545,1546,1548,1551,1553,1556,1559,1561,1564,1567,1570,1572,1575,1578,1581,1583,1586,1588,1591],{"class":218,"line":664},[216,1547,1354],{"class":1242},[216,1549,1550],{"class":226}," expected",[216,1552,1281],{"class":1242},[216,1554,1555],{"class":303}," crypto.",[216,1557,1558],{"class":222},"createHmac",[216,1560,1314],{"class":303},[216,1562,1563],{"class":230},"'sha256'",[216,1565,1566],{"class":303},", secret).",[216,1568,1569],{"class":222},"update",[216,1571,1314],{"class":303},[216,1573,1574],{"class":230},"`${",[216,1576,1577],{"class":303},"timestamp",[216,1579,1580],{"class":230},"}.${",[216,1582,1318],{"class":303},[216,1584,1585],{"class":230},"}`",[216,1587,937],{"class":303},[216,1589,1590],{"class":222},"digest",[216,1592,1593],{"class":303},"()\n",[216,1595,1596,1598,1601,1603,1606,1608,1611,1614],{"class":218,"line":676},[216,1597,1354],{"class":1242},[216,1599,1600],{"class":226}," received",[216,1602,1281],{"class":1242},[216,1604,1605],{"class":303}," Buffer.",[216,1607,1249],{"class":222},[216,1609,1610],{"class":303},"(parts.v1, ",[216,1612,1613],{"class":230},"'hex'",[216,1615,1420],{"class":303},[216,1617,1618,1621,1624,1627,1630,1633,1635,1638,1640,1643],{"class":218,"line":689},[216,1619,1620],{"class":1242},"  return",[216,1622,1623],{"class":303}," received.",[216,1625,1626],{"class":226},"length",[216,1628,1629],{"class":1242}," ===",[216,1631,1632],{"class":303}," expected.",[216,1634,1626],{"class":226},[216,1636,1637],{"class":1242}," &&",[216,1639,1555],{"class":303},[216,1641,1642],{"class":222},"timingSafeEqual",[216,1644,1645],{"class":303},"(received, expected)\n",[216,1647,1648],{"class":218,"line":702},[216,1649,450],{"class":303},[216,1651,1652],{"class":218,"line":713},[216,1653,1270],{"emptyLinePlaceholder":1269},[216,1655,1656,1658,1661,1663,1666],{"class":218,"line":719},[216,1657,1275],{"class":1242},[216,1659,1660],{"class":226}," app",[216,1662,1281],{"class":1242},[216,1664,1665],{"class":222}," express",[216,1667,1593],{"class":303},[216,1669,1670],{"class":218,"line":725},[216,1671,1270],{"emptyLinePlaceholder":1269},[216,1673,1674],{"class":218,"line":736},[216,1675,1677],{"class":1676},"sJ8bj","\u002F\u002F express.raw keeps the body as bytes, exactly as signed\n",[216,1679,1680,1683,1686,1688,1691,1694,1697,1700,1703,1706,1709,1711,1714,1716,1718],{"class":218,"line":742},[216,1681,1682],{"class":303},"app.",[216,1684,1685],{"class":222},"post",[216,1687,1314],{"class":303},[216,1689,1690],{"class":230},"'\u002Fwebhooks\u002Fpogton'",[216,1692,1693],{"class":303},", express.",[216,1695,1696],{"class":222},"raw",[216,1698,1699],{"class":303},"({ type: ",[216,1701,1702],{"class":230},"'application\u002Fjson'",[216,1704,1705],{"class":303}," }), (",[216,1707,1708],{"class":1317},"req",[216,1710,368],{"class":303},[216,1712,1713],{"class":1317},"res",[216,1715,1390],{"class":303},[216,1717,1393],{"class":1242},[216,1719,1396],{"class":303},[216,1721,1722,1724,1727,1729,1732,1735,1737,1740],{"class":218,"line":748},[216,1723,1354],{"class":1242},[216,1725,1726],{"class":226}," rawBody",[216,1728,1281],{"class":1242},[216,1730,1731],{"class":303}," req.body.",[216,1733,1734],{"class":222},"toString",[216,1736,1314],{"class":303},[216,1738,1739],{"class":230},"'utf8'",[216,1741,1420],{"class":303},[216,1743,1745,1747,1749,1751,1754,1757,1760,1762,1765,1767,1770],{"class":218,"line":1744},27,[216,1746,1335],{"class":1242},[216,1748,922],{"class":303},[216,1750,1340],{"class":1242},[216,1752,1753],{"class":222},"verifyPogtonSignature",[216,1755,1756],{"class":303},"(rawBody, req.",[216,1758,1759],{"class":222},"get",[216,1761,1314],{"class":303},[216,1763,1764],{"class":230},"'X-Pogton-Signature-V2'",[216,1766,926],{"class":303},[216,1768,1769],{"class":226},"SECRET",[216,1771,1772],{"class":303},")) {\n",[216,1774,1776,1778,1781,1784,1786,1789,1791,1794,1796,1799],{"class":218,"line":1775},28,[216,1777,1425],{"class":1242},[216,1779,1780],{"class":303}," res.",[216,1782,1783],{"class":222},"status",[216,1785,1314],{"class":303},[216,1787,1788],{"class":226},"400",[216,1790,937],{"class":303},[216,1792,1793],{"class":222},"send",[216,1795,1314],{"class":303},[216,1797,1798],{"class":230},"'Invalid signature'",[216,1800,1420],{"class":303},[216,1802,1804],{"class":218,"line":1803},29,[216,1805,745],{"class":303},[216,1807,1809,1811,1814,1816,1819,1821,1824],{"class":218,"line":1808},30,[216,1810,1354],{"class":1242},[216,1812,1813],{"class":226}," event",[216,1815,1281],{"class":1242},[216,1817,1818],{"class":226}," JSON",[216,1820,156],{"class":303},[216,1822,1823],{"class":222},"parse",[216,1825,1826],{"class":303},"(rawBody)\n",[216,1828,1830,1833,1836,1838,1841,1843],{"class":218,"line":1829},31,[216,1831,1832],{"class":303},"  res.",[216,1834,1835],{"class":222},"sendStatus",[216,1837,1314],{"class":303},[216,1839,1840],{"class":226},"200",[216,1842,1390],{"class":303},[216,1844,1845],{"class":1676},"\u002F\u002F answer first, then do the work\n",[216,1847,1849,1852,1855,1858],{"class":218,"line":1848},32,[216,1850,1851],{"class":222},"  handleEvent",[216,1853,1854],{"class":303},"(event).",[216,1856,1857],{"class":222},"catch",[216,1859,1860],{"class":303},"(console.error)\n",[216,1862,1864],{"class":218,"line":1863},33,[216,1865,1866],{"class":303},"})\n",[1227,1868,1870],{"id":1869},"python","Python",[207,1872,1875],{"className":1873,"code":1874,"language":1869,"meta":212,"style":212},"language-python shiki shiki-themes github-light github-dark","import hashlib\nimport hmac\nimport json\nimport os\nimport time\n\nfrom flask import Flask, abort, request\n\nSECRET = os.environ[\"POGTON_WEBHOOK_SECRET\"].encode()\nTOLERANCE_SECONDS = 300\n\ndef verify_pogton_signature(raw_body: bytes, header: str | None) -> bool:\n    if not header:\n        return False\n    try:\n        parts = dict(part.split(\"=\", 1) for part in header.split(\",\"))\n        timestamp = int(parts[\"t\"])\n        received = parts[\"v1\"]\n    except (KeyError, ValueError):\n        return False\n    if abs(time.time() - timestamp) > TOLERANCE_SECONDS:\n        return False\n    signed = f\"{timestamp}.\".encode() + raw_body\n    expected = hmac.new(SECRET, signed, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(expected, received)\n\napp = Flask(__name__)\n\n@app.post(\"\u002Fwebhooks\u002Fpogton\")\ndef pogton_webhook():\n    raw_body = request.get_data()  # bytes, before any parsing\n    if not verify_pogton_signature(raw_body, request.headers.get(\"X-Pogton-Signature-V2\")):\n        abort(400)\n    event = json.loads(raw_body)\n    queue_for_processing(event)\n    return \"\", 200\n",[18,1876,1877,1882,1887,1892,1897,1902,1906,1911,1915,1920,1925,1929,1934,1939,1944,1949,1954,1959,1964,1969,1973,1978,1982,1987,1992,1997,2001,2006,2010,2015,2020,2025,2030,2035,2041,2047],{"__ignoreMap":212},[216,1878,1879],{"class":218,"line":219},[216,1880,1881],{},"import hashlib\n",[216,1883,1884],{"class":218,"line":240},[216,1885,1886],{},"import hmac\n",[216,1888,1889],{"class":218,"line":251},[216,1890,1891],{},"import json\n",[216,1893,1894],{"class":218,"line":261},[216,1895,1896],{},"import os\n",[216,1898,1899],{"class":218,"line":270},[216,1900,1901],{},"import time\n",[216,1903,1904],{"class":218,"line":276},[216,1905,1270],{"emptyLinePlaceholder":1269},[216,1907,1908],{"class":218,"line":282},[216,1909,1910],{},"from flask import Flask, abort, request\n",[216,1912,1913],{"class":218,"line":288},[216,1914,1270],{"emptyLinePlaceholder":1269},[216,1916,1917],{"class":218,"line":411},[216,1918,1919],{},"SECRET = os.environ[\"POGTON_WEBHOOK_SECRET\"].encode()\n",[216,1921,1922],{"class":218,"line":423},[216,1923,1924],{},"TOLERANCE_SECONDS = 300\n",[216,1926,1927],{"class":218,"line":436},[216,1928,1270],{"emptyLinePlaceholder":1269},[216,1930,1931],{"class":218,"line":447},[216,1932,1933],{},"def verify_pogton_signature(raw_body: bytes, header: str | None) -> bool:\n",[216,1935,1936],{"class":218,"line":623},[216,1937,1938],{},"    if not header:\n",[216,1940,1941],{"class":218,"line":632},[216,1942,1943],{},"        return False\n",[216,1945,1946],{"class":218,"line":638},[216,1947,1948],{},"    try:\n",[216,1950,1951],{"class":218,"line":651},[216,1952,1953],{},"        parts = dict(part.split(\"=\", 1) for part in header.split(\",\"))\n",[216,1955,1956],{"class":218,"line":664},[216,1957,1958],{},"        timestamp = int(parts[\"t\"])\n",[216,1960,1961],{"class":218,"line":676},[216,1962,1963],{},"        received = parts[\"v1\"]\n",[216,1965,1966],{"class":218,"line":689},[216,1967,1968],{},"    except (KeyError, ValueError):\n",[216,1970,1971],{"class":218,"line":702},[216,1972,1943],{},[216,1974,1975],{"class":218,"line":713},[216,1976,1977],{},"    if abs(time.time() - timestamp) > TOLERANCE_SECONDS:\n",[216,1979,1980],{"class":218,"line":719},[216,1981,1943],{},[216,1983,1984],{"class":218,"line":725},[216,1985,1986],{},"    signed = f\"{timestamp}.\".encode() + raw_body\n",[216,1988,1989],{"class":218,"line":736},[216,1990,1991],{},"    expected = hmac.new(SECRET, signed, hashlib.sha256).hexdigest()\n",[216,1993,1994],{"class":218,"line":742},[216,1995,1996],{},"    return hmac.compare_digest(expected, received)\n",[216,1998,1999],{"class":218,"line":748},[216,2000,1270],{"emptyLinePlaceholder":1269},[216,2002,2003],{"class":218,"line":1744},[216,2004,2005],{},"app = Flask(__name__)\n",[216,2007,2008],{"class":218,"line":1775},[216,2009,1270],{"emptyLinePlaceholder":1269},[216,2011,2012],{"class":218,"line":1803},[216,2013,2014],{},"@app.post(\"\u002Fwebhooks\u002Fpogton\")\n",[216,2016,2017],{"class":218,"line":1808},[216,2018,2019],{},"def pogton_webhook():\n",[216,2021,2022],{"class":218,"line":1829},[216,2023,2024],{},"    raw_body = request.get_data()  # bytes, before any parsing\n",[216,2026,2027],{"class":218,"line":1848},[216,2028,2029],{},"    if not verify_pogton_signature(raw_body, request.headers.get(\"X-Pogton-Signature-V2\")):\n",[216,2031,2032],{"class":218,"line":1863},[216,2033,2034],{},"        abort(400)\n",[216,2036,2038],{"class":218,"line":2037},34,[216,2039,2040],{},"    event = json.loads(raw_body)\n",[216,2042,2044],{"class":218,"line":2043},35,[216,2045,2046],{},"    queue_for_processing(event)\n",[216,2048,2050],{"class":218,"line":2049},36,[216,2051,2052],{},"    return \"\", 200\n",[14,2054,2055,2056,2059],{},"The first-version header, ",[18,2057,2058],{},"X-Pogton-Signature: sha256=\u003Chex>",", is the HMAC of the body alone, without a timestamp. It is still sent, but new integrations should check V2.",[23,2061,2063],{"id":2062},"responding-and-retries","Responding and retries",[14,2065,2066,2067,2070],{},"Answer with any ",[18,2068,2069],{},"2xx"," status within 10 seconds. Do the work afterwards, for example in a job queue. Anything else counts as a failure: another status, a timeout, a connection error, or a redirect (redirects aren't followed).",[14,2072,2073],{},"Failed deliveries are retried with the same event ID and body, and a fresh signature:",[28,2075,2076,2086],{},[31,2077,2078],{},[34,2079,2080,2083],{},[37,2081,2082],{},"Attempt",[37,2084,2085],{},"After the previous one",[44,2087,2088,2096,2104,2112,2120,2128],{},[34,2089,2090,2093],{},[49,2091,2092],{},"1",[49,2094,2095],{},"Right away",[34,2097,2098,2101],{},[49,2099,2100],{},"2",[49,2102,2103],{},"1 minute",[34,2105,2106,2109],{},[49,2107,2108],{},"3",[49,2110,2111],{},"5 minutes",[34,2113,2114,2117],{},[49,2115,2116],{},"4",[49,2118,2119],{},"30 minutes",[34,2121,2122,2125],{},[49,2123,2124],{},"5",[49,2126,2127],{},"2 hours",[34,2129,2130,2133],{},[49,2131,2132],{},"6",[49,2134,2135],{},"12 hours",[14,2137,2138,2139,2142,2143,2147],{},"That is six attempts over about 15 hours. After the sixth the delivery is ",[18,2140,2141],{},"failed","; you can still ",[152,2144,2146],{"href":2145},"#redeliver","redeliver"," it by hand. Disabling or deleting an endpoint stops its retries.",[14,2149,2150],{},"Two things to build for:",[452,2152,2153,2165],{},[455,2154,2155,2158,2159,190,2162,2164],{},[202,2156,2157],{},"Duplicates."," A delivery can arrive twice, for example when your server took the request but timed out answering. Use ",[18,2160,2161],{},"id",[18,2163,1100],{},") to skip events you have already handled.",[455,2166,2167,2170,2171,2174,2175,2178],{},[202,2168,2169],{},"Order."," Events can arrive out of order. When order matters, compare ",[18,2172,2173],{},"created_at",", or fetch the post with ",[18,2176,2177],{},"GET \u002Fposts\u002F{id}"," for its current status.",[23,2180,2182],{"id":2181},"deliveries","Deliveries",[14,2184,2185],{},"Every attempt is logged, in the dashboard and through the API:",[207,2187,2189],{"className":209,"code":2188,"language":211,"meta":212,"style":212},"curl \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Fdeliveries?limit=20\" \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,2190,2191,2200],{"__ignoreMap":212},[216,2192,2193,2195,2198],{"class":218,"line":219},[216,2194,223],{"class":222},[216,2196,2197],{"class":230}," \"https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Fdeliveries?limit=20\"",[216,2199,237],{"class":226},[216,2201,2202,2204],{"class":218,"line":240},[216,2203,243],{"class":226},[216,2205,2206],{"class":230}," \"Authorization: Bearer pk_3f9a...\"\n",[207,2208,2210],{"className":294,"code":2209,"language":296,"meta":212,"style":212},"{\n  \"data\": [\n    {\n      \"id\": \"r57g7h8j9k0m1n2p3q4r5s6t7u8v9w0x\",\n      \"event_id\": \"evt_3f2a1b0c9d8e7f6a5b4c3d2e\",\n      \"event\": \"post.published\",\n      \"status\": \"retrying\",\n      \"attempt\": 2,\n      \"status_code\": 503,\n      \"error\": \"HTTP 503\",\n      \"next_attempt_at\": \"2026-10-21T09:06:03.000Z\",\n      \"created_at\": \"2026-10-21T09:00:03.000Z\",\n      \"finished_at\": \"2026-10-21T09:01:04.000Z\"\n    }\n  ],\n  \"next_cursor\": null,\n  \"has_more\": false\n}\n",[18,2211,2212,2216,2222,2227,2238,2249,2260,2271,2282,2294,2306,2318,2329,2339,2343,2348,2359,2369],{"__ignoreMap":212},[216,2213,2214],{"class":218,"line":219},[216,2215,304],{"class":303},[216,2217,2218,2220],{"class":218,"line":240},[216,2219,543],{"class":226},[216,2221,629],{"class":303},[216,2223,2224],{"class":218,"line":251},[216,2225,2226],{"class":303},"    {\n",[216,2228,2229,2231,2233,2236],{"class":218,"line":261},[216,2230,558],{"class":226},[216,2232,312],{"class":303},[216,2234,2235],{"class":230},"\"r57g7h8j9k0m1n2p3q4r5s6t7u8v9w0x\"",[216,2237,318],{"class":303},[216,2239,2240,2243,2245,2247],{"class":218,"line":270},[216,2241,2242],{"class":226},"      \"event_id\"",[216,2244,312],{"class":303},[216,2246,502],{"class":230},[216,2248,318],{"class":303},[216,2250,2251,2254,2256,2258],{"class":218,"line":276},[216,2252,2253],{"class":226},"      \"event\"",[216,2255,312],{"class":303},[216,2257,365],{"class":230},[216,2259,318],{"class":303},[216,2261,2262,2264,2266,2269],{"class":218,"line":282},[216,2263,570],{"class":226},[216,2265,312],{"class":303},[216,2267,2268],{"class":230},"\"retrying\"",[216,2270,318],{"class":303},[216,2272,2273,2276,2278,2280],{"class":218,"line":288},[216,2274,2275],{"class":226},"      \"attempt\"",[216,2277,312],{"class":303},[216,2279,2100],{"class":226},[216,2281,318],{"class":303},[216,2283,2284,2287,2289,2292],{"class":218,"line":411},[216,2285,2286],{"class":226},"      \"status_code\"",[216,2288,312],{"class":303},[216,2290,2291],{"class":226},"503",[216,2293,318],{"class":303},[216,2295,2296,2299,2301,2304],{"class":218,"line":423},[216,2297,2298],{"class":226},"      \"error\"",[216,2300,312],{"class":303},[216,2302,2303],{"class":230},"\"HTTP 503\"",[216,2305,318],{"class":303},[216,2307,2308,2311,2313,2316],{"class":218,"line":436},[216,2309,2310],{"class":226},"      \"next_attempt_at\"",[216,2312,312],{"class":303},[216,2314,2315],{"class":230},"\"2026-10-21T09:06:03.000Z\"",[216,2317,318],{"class":303},[216,2319,2320,2323,2325,2327],{"class":218,"line":447},[216,2321,2322],{"class":226},"      \"created_at\"",[216,2324,312],{"class":303},[216,2326,524],{"class":230},[216,2328,318],{"class":303},[216,2330,2331,2334,2336],{"class":218,"line":623},[216,2332,2333],{"class":226},"      \"finished_at\"",[216,2335,312],{"class":303},[216,2337,2338],{"class":230},"\"2026-10-21T09:01:04.000Z\"\n",[216,2340,2341],{"class":218,"line":632},[216,2342,739],{"class":303},[216,2344,2345],{"class":218,"line":638},[216,2346,2347],{"class":303},"  ],\n",[216,2349,2350,2353,2355,2357],{"class":218,"line":651},[216,2351,2352],{"class":226},"  \"next_cursor\"",[216,2354,312],{"class":303},[216,2356,340],{"class":226},[216,2358,318],{"class":303},[216,2360,2361,2364,2366],{"class":218,"line":664},[216,2362,2363],{"class":226},"  \"has_more\"",[216,2365,312],{"class":303},[216,2367,2368],{"class":226},"false\n",[216,2370,2371],{"class":218,"line":676},[216,2372,450],{"class":303},[14,2374,2375,756,2377,368,2380,368,2383,2386,2387,775,2389,2392,2393,2396,2397,2400],{},[18,2376,1783],{},[18,2378,2379],{},"pending",[18,2381,2382],{},"delivered",[18,2384,2385],{},"retrying"," or ",[18,2388,2141],{},[18,2390,2391],{},"GET \u002Fwebhooks\u002F{id}\u002Fdeliveries\u002F{delivery_id}"," adds ",[18,2394,2395],{},"request_body"," (what was sent) and ",[18,2398,2399],{},"response_body"," (the first 2,000 characters of your answer).",[1227,2402,2403],{"id":2146},"Redeliver",[207,2405,2407],{"className":209,"code":2406,"language":211,"meta":212,"style":212},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Fdeliveries\u002Fr57g7h8j9k0m1n2p3q4r5s6t7u8v9w0x\u002Fredeliver \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,2408,2409,2422],{"__ignoreMap":212},[216,2410,2411,2413,2415,2417,2420],{"class":218,"line":219},[216,2412,223],{"class":222},[216,2414,227],{"class":226},[216,2416,231],{"class":230},[216,2418,2419],{"class":230}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Fdeliveries\u002Fr57g7h8j9k0m1n2p3q4r5s6t7u8v9w0x\u002Fredeliver",[216,2421,237],{"class":226},[216,2423,2424,2426],{"class":218,"line":240},[216,2425,243],{"class":226},[216,2427,2206],{"class":230},[14,2429,2430],{},"Sends the same event again as a new delivery, with the same event ID and a new signature and timestamp. Returns the new delivery with your endpoint's response. Use it after fixing a bug in your handler.",[1227,2432,2434],{"id":2433},"send-a-test-event","Send a test event",[207,2436,2438],{"className":209,"code":2437,"language":211,"meta":212,"style":212},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Ftest \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,2439,2440,2453],{"__ignoreMap":212},[216,2441,2442,2444,2446,2448,2451],{"class":218,"line":219},[216,2443,223],{"class":222},[216,2445,227],{"class":226},[216,2447,231],{"class":230},[216,2449,2450],{"class":230}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Ftest",[216,2452,237],{"class":226},[216,2454,2455,2457],{"class":218,"line":240},[216,2456,243],{"class":226},[216,2458,2206],{"class":230},[14,2460,2461,2462,2464],{},"Sends a signed ",[18,2463,178],{}," event right away and returns the delivery, including the status code and body your endpoint returned. Test events are not retried.",[23,2466,2468],{"id":2467},"manage-endpoints","Manage endpoints",[28,2470,2471,2481],{},[31,2472,2473],{},[34,2474,2475,2478],{},[37,2476,2477],{},"Request",[37,2479,2480],{},"What it does",[44,2482,2483,2497,2507,2531,2541],{},[34,2484,2485,2490],{},[49,2486,2487],{},[18,2488,2489],{},"GET \u002Fapi\u002Fv1\u002Fwebhooks",[49,2491,2492,2493,2496],{},"List endpoints, plus ",[18,2494,2495],{},"available_events",". Secrets are never returned.",[34,2498,2499,2504],{},[49,2500,2501],{},[18,2502,2503],{},"GET \u002Fapi\u002Fv1\u002Fwebhooks\u002F{id}",[49,2505,2506],{},"One endpoint.",[34,2508,2509,2514],{},[49,2510,2511],{},[18,2512,2513],{},"PATCH \u002Fapi\u002Fv1\u002Fwebhooks\u002F{id}",[49,2515,2516,2517,368,2520,368,2523,368,2526,2386,2528,156],{},"Change ",[18,2518,2519],{},"name",[18,2521,2522],{},"description",[18,2524,2525],{},"url",[18,2527,25],{},[18,2529,2530],{},"enabled",[34,2532,2533,2538],{},[49,2534,2535],{},[18,2536,2537],{},"DELETE \u002Fapi\u002Fv1\u002Fwebhooks\u002F{id}",[49,2539,2540],{},"Delete the endpoint. Pending retries stop.",[34,2542,2543,2548],{},[49,2544,2545],{},[18,2546,2547],{},"POST \u002Fapi\u002Fv1\u002Fwebhooks\u002F{id}\u002Frotate-secret",[49,2549,2550],{},"Replace the secret.",[14,2552,2553,2554,2557,2558,156],{},"To pause deliveries, ",[18,2555,2556],{},"PATCH"," with ",[18,2559,2560],{},"\"enabled\": false",[1227,2562,2564],{"id":2563},"rotate-the-secret","Rotate the secret",[207,2566,2568],{"className":209,"code":2567,"language":211,"meta":212,"style":212},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Frotate-secret \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[18,2569,2570,2583],{"__ignoreMap":212},[216,2571,2572,2574,2576,2578,2581],{"class":218,"line":219},[216,2573,223],{"class":222},[216,2575,227],{"class":226},[216,2577,231],{"class":230},[216,2579,2580],{"class":230}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fwebhooks\u002Fq47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\u002Frotate-secret",[216,2582,237],{"class":226},[216,2584,2585,2587],{"class":218,"line":240},[216,2586,243],{"class":226},[216,2588,2206],{"class":230},[207,2590,2592],{"className":294,"code":2591,"language":296,"meta":212,"style":212},"{ \"id\": \"q47f6g7h8j9k0m1n2p3q4r5s6t7u8v9w\", \"secret\": \"whsec_9b8a7c6d...\", \"message\": \"Store the secret now; it is not shown again.\" }\n",[18,2593,2594],{"__ignoreMap":212},[216,2595,2596,2599,2602,2604,2606,2608,2611,2613,2616,2618,2621,2623,2626],{"class":218,"line":219},[216,2597,2598],{"class":303},"{ ",[216,2600,2601],{"class":226},"\"id\"",[216,2603,312],{"class":303},[216,2605,315],{"class":230},[216,2607,368],{"class":303},[216,2609,2610],{"class":226},"\"secret\"",[216,2612,312],{"class":303},[216,2614,2615],{"class":230},"\"whsec_9b8a7c6d...\"",[216,2617,368],{"class":303},[216,2619,2620],{"class":226},"\"message\"",[216,2622,312],{"class":303},[216,2624,2625],{"class":230},"\"Store the secret now; it is not shown again.\"",[216,2627,2628],{"class":303}," }\n",[14,2630,2631],{},"The old secret stops working immediately; retries after this are signed with the new one. To rotate without dropping events, have your handler accept either secret for a few minutes: deploy with both, rotate, then remove the old one.",[2633,2634,2635],"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}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":212,"searchDepth":240,"depth":240,"links":2637},[2638,2639,2640,2641,2642,2646,2647,2651],{"id":25,"depth":240,"text":26},{"id":196,"depth":240,"text":197},{"id":480,"depth":240,"text":481},{"id":1066,"depth":240,"text":1067},{"id":1181,"depth":240,"text":1182,"children":2643},[2644,2645],{"id":1229,"depth":251,"text":1230},{"id":1869,"depth":251,"text":1870},{"id":2062,"depth":240,"text":2063},{"id":2181,"depth":240,"text":2182,"children":2648},[2649,2650],{"id":2146,"depth":251,"text":2403},{"id":2433,"depth":251,"text":2434},{"id":2467,"depth":240,"text":2468,"children":2652},[2653],{"id":2563,"depth":251,"text":2564},"Receive signed events when posts publish, fail or are scheduled and when accounts connect or need to reconnect. Payloads, signature checks in Node and Python, retries.","md",{},"\u002Fdocs\u002Fwebhooks",{"title":5,"description":2654},"Webhooks: Signed Events for Posts and Accounts","docs\u002Fwebhooks","NhuuuvydTYumgxxggqRCSUNGrc49K6cIq_Q-B1hh6HA",1794240387570]