[{"data":1,"prerenderedAt":686},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fapi-keys":3},{"id":4,"title":5,"body":6,"description":676,"extension":677,"meta":678,"navigation":679,"order":680,"path":681,"seo":682,"seoTitle":683,"stem":684,"__hash__":685},"docs\u002Fdocs\u002Fapi-keys.md","API keys",{"type":7,"value":8,"toc":669},"minimark",[9,13,27,32,35,94,128,132,167,367,377,381,426,437,441,448,489,587,601,605,630,644,665],[10,11,5],"h1",{"id":12},"api-keys",[14,15,16,17,21,22,26],"p",{},"You can manage keys in the dashboard (",[18,19,20],"strong",{},"Connect → API",") or through the API, for example to rotate keys from a deploy pipeline. Every endpoint here takes the usual ",[23,24,25],"code",{},"Authorization: Bearer \u003Ckey>"," header.",[28,29,31],"h2",{"id":30},"rules","Rules",[14,33,34],{},"A key can never give itself, or another key, more access than it has:",[36,37,38,60],"table",{},[39,40,41],"thead",{},[42,43,44,47,54],"tr",{},[45,46],"th",{},[45,48,49,50,53],{},"Live key (",[23,51,52],{},"pk_…",")",[45,55,56,57,53],{},"Test key (",[23,58,59],{},"pk_test_…",[61,62,63,75,85],"tbody",{},[42,64,65,69,72],{},[66,67,68],"td",{},"List",[66,70,71],{},"Live and test keys",[66,73,74],{},"Test keys only",[42,76,77,80,83],{},[66,78,79],{},"Create",[66,81,82],{},"Live or test keys",[66,84,74],{},[42,86,87,90,92],{},[66,88,89],{},"Revoke, roll",[66,91,71],{},[66,93,74],{},[95,96,97,105,111,118,121],"ul",{},[98,99,100,101,104],"li",{},"Keys only see keys of their own organization. A key ID from another organization returns ",[23,102,103],{},"404 api_key_not_found",".",[98,106,107,108,104],{},"A test key that tries to create, revoke or roll a live key gets ",[23,109,110],{},"403 insufficient_privilege",[98,112,113,114,117],{},"The secret is returned once, when a key is created or rolled. Pogton stores only a hash. These endpoints don't accept an ",[23,115,116],{},"Idempotency-Key",", because the stored response would contain the secret.",[98,119,120],{},"A key can revoke or roll itself, for example right after it leaked.",[98,122,123,124,127],{},"An organization can have up to 50 active keys (",[23,125,126],{},"409 api_key_limit_reached",").",[28,129,131],{"id":130},"list-keys","List keys",[133,134,139],"pre",{"className":135,"code":136,"language":137,"meta":138,"style":138},"language-bash shiki shiki-themes github-light github-dark","curl https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n","bash","",[23,140,141,158],{"__ignoreMap":138},[142,143,146,150,154],"span",{"class":144,"line":145},"line",1,[142,147,149],{"class":148},"sScJk","curl",[142,151,153],{"class":152},"sZZnC"," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys",[142,155,157],{"class":156},"sj4cs"," \\\n",[142,159,161,164],{"class":144,"line":160},2,[142,162,163],{"class":156},"  -H",[142,165,166],{"class":152}," \"Authorization: Bearer pk_3f9a...\"\n",[133,168,172],{"className":169,"code":170,"language":171,"meta":138,"style":138},"language-json shiki shiki-themes github-light github-dark","{\n  \"data\": [\n    {\n      \"id\": \"kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e\",\n      \"name\": \"Production backend\",\n      \"mode\": \"live\",\n      \"prefix\": \"pk_3f9a1c2\",\n      \"status\": \"active\",\n      \"current\": true,\n      \"created_at\": \"2026-09-01T08:00:00.000Z\",\n      \"last_used_at\": \"2026-10-21T09:00:00.000Z\",\n      \"expires_at\": null,\n      \"revoked_at\": null,\n      \"created_via\": \"dashboard\",\n      \"replaced_by\": null\n    }\n  ]\n}\n","json",[23,173,174,180,188,194,209,222,235,248,261,274,287,300,313,325,338,349,355,361],{"__ignoreMap":138},[142,175,176],{"class":144,"line":145},[142,177,179],{"class":178},"sVt8B","{\n",[142,181,182,185],{"class":144,"line":160},[142,183,184],{"class":156},"  \"data\"",[142,186,187],{"class":178},": [\n",[142,189,191],{"class":144,"line":190},3,[142,192,193],{"class":178},"    {\n",[142,195,197,200,203,206],{"class":144,"line":196},4,[142,198,199],{"class":156},"      \"id\"",[142,201,202],{"class":178},": ",[142,204,205],{"class":152},"\"kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e\"",[142,207,208],{"class":178},",\n",[142,210,212,215,217,220],{"class":144,"line":211},5,[142,213,214],{"class":156},"      \"name\"",[142,216,202],{"class":178},[142,218,219],{"class":152},"\"Production backend\"",[142,221,208],{"class":178},[142,223,225,228,230,233],{"class":144,"line":224},6,[142,226,227],{"class":156},"      \"mode\"",[142,229,202],{"class":178},[142,231,232],{"class":152},"\"live\"",[142,234,208],{"class":178},[142,236,238,241,243,246],{"class":144,"line":237},7,[142,239,240],{"class":156},"      \"prefix\"",[142,242,202],{"class":178},[142,244,245],{"class":152},"\"pk_3f9a1c2\"",[142,247,208],{"class":178},[142,249,251,254,256,259],{"class":144,"line":250},8,[142,252,253],{"class":156},"      \"status\"",[142,255,202],{"class":178},[142,257,258],{"class":152},"\"active\"",[142,260,208],{"class":178},[142,262,264,267,269,272],{"class":144,"line":263},9,[142,265,266],{"class":156},"      \"current\"",[142,268,202],{"class":178},[142,270,271],{"class":156},"true",[142,273,208],{"class":178},[142,275,277,280,282,285],{"class":144,"line":276},10,[142,278,279],{"class":156},"      \"created_at\"",[142,281,202],{"class":178},[142,283,284],{"class":152},"\"2026-09-01T08:00:00.000Z\"",[142,286,208],{"class":178},[142,288,290,293,295,298],{"class":144,"line":289},11,[142,291,292],{"class":156},"      \"last_used_at\"",[142,294,202],{"class":178},[142,296,297],{"class":152},"\"2026-10-21T09:00:00.000Z\"",[142,299,208],{"class":178},[142,301,303,306,308,311],{"class":144,"line":302},12,[142,304,305],{"class":156},"      \"expires_at\"",[142,307,202],{"class":178},[142,309,310],{"class":156},"null",[142,312,208],{"class":178},[142,314,316,319,321,323],{"class":144,"line":315},13,[142,317,318],{"class":156},"      \"revoked_at\"",[142,320,202],{"class":178},[142,322,310],{"class":156},[142,324,208],{"class":178},[142,326,328,331,333,336],{"class":144,"line":327},14,[142,329,330],{"class":156},"      \"created_via\"",[142,332,202],{"class":178},[142,334,335],{"class":152},"\"dashboard\"",[142,337,208],{"class":178},[142,339,341,344,346],{"class":144,"line":340},15,[142,342,343],{"class":156},"      \"replaced_by\"",[142,345,202],{"class":178},[142,347,348],{"class":156},"null\n",[142,350,352],{"class":144,"line":351},16,[142,353,354],{"class":178},"    }\n",[142,356,358],{"class":144,"line":357},17,[142,359,360],{"class":178},"  ]\n",[142,362,364],{"class":144,"line":363},18,[142,365,366],{"class":178},"}\n",[14,368,369,372,373,376],{},[23,370,371],{},"current"," marks the key that made the request. Add ",[23,374,375],{},"?include_revoked=true"," to include revoked keys.",[28,378,380],{"id":379},"create-a-key","Create a key",[133,382,384],{"className":135,"code":383,"language":137,"meta":138,"style":138},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"name\": \"CI tests\", \"mode\": \"test\" }'\n",[23,385,386,400,409,418],{"__ignoreMap":138},[142,387,388,390,393,396,398],{"class":144,"line":145},[142,389,149],{"class":148},[142,391,392],{"class":156}," -X",[142,394,395],{"class":152}," POST",[142,397,153],{"class":152},[142,399,157],{"class":156},[142,401,402,404,407],{"class":144,"line":160},[142,403,163],{"class":156},[142,405,406],{"class":152}," \"Authorization: Bearer pk_3f9a...\"",[142,408,157],{"class":156},[142,410,411,413,416],{"class":144,"line":190},[142,412,163],{"class":156},[142,414,415],{"class":152}," \"Content-Type: application\u002Fjson\"",[142,417,157],{"class":156},[142,419,420,423],{"class":144,"line":196},[142,421,422],{"class":156},"  -d",[142,424,425],{"class":152}," '{ \"name\": \"CI tests\", \"mode\": \"test\" }'\n",[14,427,428,429,432,433,436],{},"The response is the key as listed above plus ",[23,430,431],{},"key",", the secret. Store it now. ",[23,434,435],{},"mode"," defaults to the mode of the key making the request.",[28,438,440],{"id":439},"roll-a-key","Roll a key",[14,442,443,444,447],{},"Rolling creates a new key with the same name and mode and retires the old one. Give ",[23,445,446],{},"expires_in"," (seconds, up to 604800 = 7 days) to keep the old key working while you deploy the new one:",[133,449,451],{"className":135,"code":450,"language":137,"meta":138,"style":138},"curl -X POST https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys\u002Fkd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e\u002Froll \\\n  -H \"Authorization: Bearer pk_3f9a...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"expires_in\": 3600 }'\n",[23,452,453,466,474,482],{"__ignoreMap":138},[142,454,455,457,459,461,464],{"class":144,"line":145},[142,456,149],{"class":148},[142,458,392],{"class":156},[142,460,395],{"class":152},[142,462,463],{"class":152}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys\u002Fkd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e\u002Froll",[142,465,157],{"class":156},[142,467,468,470,472],{"class":144,"line":160},[142,469,163],{"class":156},[142,471,406],{"class":152},[142,473,157],{"class":156},[142,475,476,478,480],{"class":144,"line":190},[142,477,163],{"class":156},[142,479,415],{"class":152},[142,481,157],{"class":156},[142,483,484,486],{"class":144,"line":196},[142,485,422],{"class":156},[142,487,488],{"class":152}," '{ \"expires_in\": 3600 }'\n",[133,490,492],{"className":169,"code":491,"language":171,"meta":138,"style":138},"{\n  \"id\": \"km1n2p3q4r5s6t7v8w9x0y1z2a3b4c5d\",\n  \"name\": \"Production backend\",\n  \"mode\": \"live\",\n  \"key\": \"pk_8e2d…\",\n  \"replaces\": { \"id\": \"kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e\", \"expires_at\": \"2026-10-21T10:00:00.000Z\" },\n  \"message\": \"Store the key now; it is not shown again.\"\n}\n",[23,493,494,498,510,521,532,544,573,583],{"__ignoreMap":138},[142,495,496],{"class":144,"line":145},[142,497,179],{"class":178},[142,499,500,503,505,508],{"class":144,"line":160},[142,501,502],{"class":156},"  \"id\"",[142,504,202],{"class":178},[142,506,507],{"class":152},"\"km1n2p3q4r5s6t7v8w9x0y1z2a3b4c5d\"",[142,509,208],{"class":178},[142,511,512,515,517,519],{"class":144,"line":190},[142,513,514],{"class":156},"  \"name\"",[142,516,202],{"class":178},[142,518,219],{"class":152},[142,520,208],{"class":178},[142,522,523,526,528,530],{"class":144,"line":196},[142,524,525],{"class":156},"  \"mode\"",[142,527,202],{"class":178},[142,529,232],{"class":152},[142,531,208],{"class":178},[142,533,534,537,539,542],{"class":144,"line":211},[142,535,536],{"class":156},"  \"key\"",[142,538,202],{"class":178},[142,540,541],{"class":152},"\"pk_8e2d…\"",[142,543,208],{"class":178},[142,545,546,549,552,555,557,559,562,565,567,570],{"class":144,"line":224},[142,547,548],{"class":156},"  \"replaces\"",[142,550,551],{"class":178},": { ",[142,553,554],{"class":156},"\"id\"",[142,556,202],{"class":178},[142,558,205],{"class":152},[142,560,561],{"class":178},", ",[142,563,564],{"class":156},"\"expires_at\"",[142,566,202],{"class":178},[142,568,569],{"class":152},"\"2026-10-21T10:00:00.000Z\"",[142,571,572],{"class":178}," },\n",[142,574,575,578,580],{"class":144,"line":237},[142,576,577],{"class":156},"  \"message\"",[142,579,202],{"class":178},[142,581,582],{"class":152},"\"Store the key now; it is not shown again.\"\n",[142,584,585],{"class":144,"line":250},[142,586,366],{"class":178},[14,588,589,590,593,594,597,598,600],{},"Until ",[23,591,592],{},"expires_at"," the old key has ",[23,595,596],{},"status: \"expiring\"",". Without ",[23,599,446],{}," it stops working immediately. A key can be rolled once; roll its replacement next time.",[28,602,604],{"id":603},"revoke-a-key","Revoke a key",[133,606,608],{"className":135,"code":607,"language":137,"meta":138,"style":138},"curl -X DELETE https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys\u002Fkd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e \\\n  -H \"Authorization: Bearer pk_3f9a...\"\n",[23,609,610,624],{"__ignoreMap":138},[142,611,612,614,616,619,622],{"class":144,"line":145},[142,613,149],{"class":148},[142,615,392],{"class":156},[142,617,618],{"class":152}," DELETE",[142,620,621],{"class":152}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fapi-keys\u002Fkd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e",[142,623,157],{"class":156},[142,625,626,628],{"class":144,"line":160},[142,627,163],{"class":156},[142,629,166],{"class":152},[14,631,632,633,638,639,643],{},"The key stops working immediately. ",[634,635,637],"a",{"href":636},"\u002Fdocs\u002Fconnect-links","Connect links"," and ",[634,640,642],{"href":641},"\u002Fdocs\u002Fheadless-connect","headless connect"," URLs signed with it stop working too, so roll with a grace period when links may still be open.",[14,645,646,647,651,652,561,655,561,658,638,661,664],{},"The ",[634,648,650],{"href":649},"\u002Fdocs\u002Fmcp","MCP server"," has the same operations as ",[23,653,654],{},"list_api_keys",[23,656,657],{},"create_api_key",[23,659,660],{},"revoke_api_key",[23,662,663],{},"roll_api_key",", with the same rules.",[666,667,668],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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":138,"searchDepth":160,"depth":160,"links":670},[671,672,673,674,675],{"id":30,"depth":160,"text":31},{"id":130,"depth":160,"text":131},{"id":379,"depth":160,"text":380},{"id":439,"depth":160,"text":440},{"id":603,"depth":160,"text":604},"Manage Connect API keys from your own code: list, create, roll with a grace period and revoke keys, and the rules that stop a key from gaining more access than it has.","md",{},true,2.5,"\u002Fdocs\u002Fapi-keys",{"title":5,"description":676},"API Keys: Create, Roll and Revoke Through the API","docs\u002Fapi-keys","AHeigS7ouEEoBaUFXgcWtg-Hbhcm-6q_UrtSCu7Jm-I",1794240387938]