[{"data":1,"prerenderedAt":483},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fopenapi":3},{"id":4,"title":5,"body":6,"description":475,"extension":476,"meta":477,"navigation":178,"order":364,"path":478,"seo":479,"seoTitle":480,"stem":481,"__hash__":482},"docs\u002Fdocs\u002Fopenapi.md","OpenAPI",{"type":7,"value":8,"toc":470},"minimark",[9,13,17,28,31,64,71,76,79,83,93,135,377,386,431,454,458,466],[10,11,5],"h1",{"id":12},"openapi",[14,15,16],"p",{},"The whole v1 API is described in one OpenAPI 3.1 document:",[18,19,24],"pre",{"className":20,"code":22,"language":23},[21],"language-text","https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fopenapi.json\n","text",[25,26,22],"code",{"__ignoreMap":27},"",[14,29,30],{},"It needs no API key. It covers every endpoint with its parameters, request bodies, responses and error codes, plus:",[32,33,34,45,57],"ul",{},[35,36,37,40,41,44],"li",{},[25,38,39],{},"components.schemas.PlatformOptions",": one schema per platform for ",[25,42,43],{},"platform_options",", built from the same definitions the API validates with.",[35,46,47,50,51,56],{},[25,48,49],{},"webhooks",": the payload and headers of every ",[52,53,55],"a",{"href":54},"\u002Fdocs\u002Fwebhooks","webhook event",".",[35,58,59,60,63],{},"The ",[25,61,62],{},"Idempotency-Key"," header on the endpoints that accept it, and the rate limit headers on every response.",[14,65,66,67,70],{},"The document is generated from the API's own validation code, so it changes when the API does. Fields marked ",[25,68,69],{},"deprecated"," are kept for clients of the first API version.",[72,73,75],"h2",{"id":74},"import-into-an-api-client","Import into an API client",[14,77,78],{},"Postman, Insomnia, Bruno and Hoppscotch can import the URL directly. Set the Bearer token to your API key once at the collection level.",[72,80,82],{"id":81},"generate-a-client","Generate a client",[14,84,85,86,92],{},"TypeScript types with ",[52,87,91],{"href":88,"rel":89},"https:\u002F\u002Fopenapi-ts.dev",[90],"nofollow","openapi-typescript",", and a small typed fetch client:",[18,94,98],{"className":95,"code":96,"language":97,"meta":27,"style":27},"language-bash shiki shiki-themes github-light github-dark","npx openapi-typescript https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fopenapi.json -o pogton.d.ts\nnpm install openapi-fetch\n","bash",[25,99,100,123],{"__ignoreMap":27},[101,102,105,109,113,116,120],"span",{"class":103,"line":104},"line",1,[101,106,108],{"class":107},"sScJk","npx",[101,110,112],{"class":111},"sZZnC"," openapi-typescript",[101,114,115],{"class":111}," https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fopenapi.json",[101,117,119],{"class":118},"sj4cs"," -o",[101,121,122],{"class":111}," pogton.d.ts\n",[101,124,126,129,132],{"class":103,"line":125},2,[101,127,128],{"class":107},"npm",[101,130,131],{"class":111}," install",[101,133,134],{"class":111}," openapi-fetch\n",[18,136,140],{"className":137,"code":138,"language":139,"meta":27,"style":27},"language-ts shiki shiki-themes github-light github-dark","import createClient from 'openapi-fetch'\nimport type { paths } from '.\u002Fpogton'\n\nconst pogton = createClient\u003Cpaths>({\n  baseUrl: 'https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1',\n  headers: { Authorization: `Bearer ${process.env.POGTON_KEY}` },\n})\n\nconst { data, error } = await pogton.POST('\u002Fposts', {\n  body: { user_id: 'user_123', platforms: ['linkedin'], content: 'Hello', queue: true },\n  params: { header: { 'Idempotency-Key': crypto.randomUUID() } },\n})\nif (error) console.error(error.data.error.code)\nelse console.log(data.status, data.targets)\n","ts",[25,141,142,158,173,180,204,216,244,250,255,296,325,343,348,362],{"__ignoreMap":27},[101,143,144,148,152,155],{"class":103,"line":104},[101,145,147],{"class":146},"szBVR","import",[101,149,151],{"class":150},"sVt8B"," createClient ",[101,153,154],{"class":146},"from",[101,156,157],{"class":111}," 'openapi-fetch'\n",[101,159,160,162,165,168,170],{"class":103,"line":125},[101,161,147],{"class":146},[101,163,164],{"class":146}," type",[101,166,167],{"class":150}," { paths } ",[101,169,154],{"class":146},[101,171,172],{"class":111}," '.\u002Fpogton'\n",[101,174,176],{"class":103,"line":175},3,[101,177,179],{"emptyLinePlaceholder":178},true,"\n",[101,181,183,186,189,192,195,198,201],{"class":103,"line":182},4,[101,184,185],{"class":146},"const",[101,187,188],{"class":118}," pogton",[101,190,191],{"class":146}," =",[101,193,194],{"class":107}," createClient",[101,196,197],{"class":150},"\u003C",[101,199,200],{"class":107},"paths",[101,202,203],{"class":150},">({\n",[101,205,207,210,213],{"class":103,"line":206},5,[101,208,209],{"class":150},"  baseUrl: ",[101,211,212],{"class":111},"'https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1'",[101,214,215],{"class":150},",\n",[101,217,219,222,225,228,230,233,235,238,241],{"class":103,"line":218},6,[101,220,221],{"class":150},"  headers: { Authorization: ",[101,223,224],{"class":111},"`Bearer ${",[101,226,227],{"class":150},"process",[101,229,56],{"class":111},[101,231,232],{"class":150},"env",[101,234,56],{"class":111},[101,236,237],{"class":118},"POGTON_KEY",[101,239,240],{"class":111},"}`",[101,242,243],{"class":150}," },\n",[101,245,247],{"class":103,"line":246},7,[101,248,249],{"class":150},"})\n",[101,251,253],{"class":103,"line":252},8,[101,254,179],{"emptyLinePlaceholder":178},[101,256,258,260,263,266,269,272,275,278,281,284,287,290,293],{"class":103,"line":257},9,[101,259,185],{"class":146},[101,261,262],{"class":150}," { ",[101,264,265],{"class":118},"data",[101,267,268],{"class":150},", ",[101,270,271],{"class":118},"error",[101,273,274],{"class":150}," } ",[101,276,277],{"class":146},"=",[101,279,280],{"class":146}," await",[101,282,283],{"class":150}," pogton.",[101,285,286],{"class":107},"POST",[101,288,289],{"class":150},"(",[101,291,292],{"class":111},"'\u002Fposts'",[101,294,295],{"class":150},", {\n",[101,297,299,302,305,308,311,314,317,320,323],{"class":103,"line":298},10,[101,300,301],{"class":150},"  body: { user_id: ",[101,303,304],{"class":111},"'user_123'",[101,306,307],{"class":150},", platforms: [",[101,309,310],{"class":111},"'linkedin'",[101,312,313],{"class":150},"], content: ",[101,315,316],{"class":111},"'Hello'",[101,318,319],{"class":150},", queue: ",[101,321,322],{"class":118},"true",[101,324,243],{"class":150},[101,326,328,331,334,337,340],{"class":103,"line":327},11,[101,329,330],{"class":150},"  params: { header: { ",[101,332,333],{"class":111},"'Idempotency-Key'",[101,335,336],{"class":150},": crypto.",[101,338,339],{"class":107},"randomUUID",[101,341,342],{"class":150},"() } },\n",[101,344,346],{"class":103,"line":345},12,[101,347,249],{"class":150},[101,349,351,354,357,359],{"class":103,"line":350},13,[101,352,353],{"class":146},"if",[101,355,356],{"class":150}," (error) console.",[101,358,271],{"class":107},[101,360,361],{"class":150},"(error.data.error.code)\n",[101,363,365,368,371,374],{"class":103,"line":364},14,[101,366,367],{"class":146},"else",[101,369,370],{"class":150}," console.",[101,372,373],{"class":107},"log",[101,375,376],{"class":150},"(data.status, data.targets)\n",[14,378,379,380,385],{},"Other languages with ",[52,381,384],{"href":382,"rel":383},"https:\u002F\u002Fopenapi-generator.tech",[90],"OpenAPI Generator",":",[18,387,389],{"className":95,"code":388,"language":97,"meta":27,"style":27},"npx @openapitools\u002Fopenapi-generator-cli generate \\\n  -i https:\u002F\u002Fpogton.com\u002Fapi\u002Fv1\u002Fopenapi.json \\\n  -g python \\\n  -o .\u002Fpogton-client\n",[25,390,391,404,413,423],{"__ignoreMap":27},[101,392,393,395,398,401],{"class":103,"line":104},[101,394,108],{"class":107},[101,396,397],{"class":111}," @openapitools\u002Fopenapi-generator-cli",[101,399,400],{"class":111}," generate",[101,402,403],{"class":118}," \\\n",[101,405,406,409,411],{"class":103,"line":125},[101,407,408],{"class":118},"  -i",[101,410,115],{"class":111},[101,412,403],{"class":118},[101,414,415,418,421],{"class":103,"line":175},[101,416,417],{"class":118},"  -g",[101,419,420],{"class":111}," python",[101,422,403],{"class":118},[101,424,425,428],{"class":103,"line":182},[101,426,427],{"class":118},"  -o",[101,429,430],{"class":111}," .\u002Fpogton-client\n",[14,432,433,434,437,438,268,441,268,444,268,447,268,450,453],{},"Replace ",[25,435,436],{},"python"," with ",[25,439,440],{},"go",[25,442,443],{},"java",[25,445,446],{},"ruby",[25,448,449],{},"php",[25,451,452],{},"csharp"," or any other generator. Pin the generated client in your repository and regenerate it when you need new fields.",[72,455,457],{"id":456},"for-ai-tools","For AI tools",[14,459,460,461,465],{},"Coding assistants work better with the spec in context. Point them at the URL above, or connect them to the ",[52,462,464],{"href":463},"\u002Fdocs\u002Fmcp","MCP server"," to call the API directly.",[467,468,469],"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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":27,"searchDepth":125,"depth":125,"links":471},[472,473,474],{"id":74,"depth":125,"text":75},{"id":81,"depth":125,"text":82},{"id":456,"depth":125,"text":457},"The Pogton Connect API as an OpenAPI 3.1 document: import it into Postman or Insomnia, or generate a typed client for TypeScript, Python, Go and other languages.","md",{},"\u002Fdocs\u002Fopenapi",{"title":5,"description":475},"OpenAPI 3.1 Spec and Client Generation","docs\u002Fopenapi","S4HQRr4Ns3VimmWg2NAskYCkwYzyyJ6VRiDZXT2ht7Y",1794240386378]