{"id":18203,"date":"2026-08-20T22:32:04","date_gmt":"2026-08-20T16:32:04","guid":{"rendered":"https:\/\/betterdocs.co\/?post_type=docs&#038;p=18203"},"modified":"2026-08-20T22:32:11","modified_gmt":"2026-08-20T16:32:11","password":"","slug":"generate-api-documentation-with-betterdocs","status":"publish","type":"docs","link":"https:\/\/betterdocs.co\/it\/docs\/generate-api-documentation-with-betterdocs\/","title":{"rendered":"How to Generate API Documentation with BetterDocs?"},"content":{"rendered":"<p class=\"wp-block-paragraph\"><strong><a href=\"https:\/\/betterdocs.co\/it\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/betterdocs.co\/\" rel=\"noreferrer noopener\">BetterDocs<\/a><\/strong> <strong>API Docs<\/strong> feature lets you import an OpenAPI (Swagger) spec or a Postman Collection and turn it into a fully rendered, browsable API reference inside your knowledge base, complete with code samples, request\/response tables, and a live <strong>Try it<\/strong> playground.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of hand-writing endpoint documentation and keeping it in sync manually, you upload your spec once and generate API documentation with BetterDocs, which maintains the docs for you, saving hours of repetitive documentation work every time your API changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Nota:<\/em><\/strong><em> You<\/em> <em>will need an OpenAPI spec (JSON or YAML) or a Postman Collection export (JSON) ready to upload before you start.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1: Open the API Docs Screen<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Head to <strong>wp-admin \u2192 BetterDocs \u2192 API Docs<\/strong>. You&#8217;ll land on the <strong>&#8216;API Documentation&#8217;<\/strong> screen, which lists any API references you have already created and gives you a <strong>&#8216;Create New API&#8217;<\/strong> button in the top right.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"2048\" height=\"1063\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1.png\" alt=\"API Documentation with BetterDocs\" class=\"wp-image-18204\" title=\"\" srcset=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1.png 2048w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1-300x156.png 300w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1-1024x532.png 1024w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1-768x399.png 768w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1-1536x797.png 1536w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1-18x9.png 18w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-1-360x187.png 360w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2: Import Your API Spec<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click <strong>&#8216;Create New API&#8217;<\/strong>. In the panel that opens:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Name<\/strong>: Leave empty to pull the title straight from your spec, or set your own.<\/li>\n\n\n\n<li><strong>OpenAPI or Postman spec<\/strong>: Choose <strong>&#8216;Upload file&#8217;<\/strong> and select your OpenAPI or Postman spec file. BetterDocs automatically detects which format it is and converts it accordingly.<\/li>\n\n\n\n<li><strong>Generate endpoint docs<\/strong>: Set to <strong>&#8216;Yes&#8217;<\/strong> so each endpoint becomes its own editable doc, grouped by tag with method badges. Otherwise, you can choose<strong> \u2018No\u2019<\/strong>.<\/li>\n\n\n\n<li><strong>Create as<\/strong>: Choose whether the reference lives in <strong>&#8216;Its own Knowledge Base&#8217;<\/strong> or an existing one.<\/li>\n\n\n\n<li><strong>AI content<\/strong>: You can leave as <strong>&#8216;None&#8217;<\/strong> or select <strong>\u2018Descriptions\u2019<\/strong>, <strong>\u2018Examples\u2019<\/strong>, or Both from the dropdown.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1280\" height=\"663\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/2.-API-Interface.gif\" alt=\"Import your API docs\" class=\"wp-image-18205\" title=\"\"><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Click <strong>&#8216;Create New API Reference&#8217;<\/strong>. BetterDocs shows a summary confirming the detected format, operation count, and spec title once the import finishes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Nota:<\/em><\/strong><em> When you upload a Postman collection, BetterDocs also builds each endpoint&#8217;s request-body field table from an <\/em><strong><em>inferred schema<\/em><\/strong><em> based on the example values in your collection. OpenAPI specs already define this schema explicitly, so no inference is needed there.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3: Customize Your Reference&#8217;s Appearance And Behavior<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These settings apply the same way regardless of whether you imported an OpenAPI or Postman spec. Scroll down in the same panel to set:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Accent color \/ Accent text color<\/strong>: Your brand color for the Try-it banner and Send button; applies to every endpoint doc under this reference.<\/li>\n\n\n\n<li><strong>Show the Try-it button<\/strong>: Turn it off if you only want the method and path shown, without a live tester.<\/li>\n\n\n\n<li><strong>Code Snippet default mode<\/strong>: Light or Dark styling for generated code blocks.<\/li>\n\n\n\n<li><strong>Try-it proxy \u2192 Use the proxy<\/strong>: Forwards Try-it requests through your server so the browser&#8217;s CORS policy does not block them. You will come back to this in Step 7.<\/li>\n\n\n\n<li><strong>Status<\/strong>: Draft or Published.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1280\" height=\"663\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/3.-Styling-the-doc.gif\" alt=\"Customize Appearance\" class=\"wp-image-18206\" title=\"\"><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4: Generate Endpoint Docs<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once your spec is imported, you can <strong>&#8216;Generate Endpoint Doc&#8217;<\/strong> on the reference. Each endpoint becomes an editable doc with its own URL, grouped by tag with method badges. Titles and content you edit are preserved on re-sync. You can also see the sync status with the AI Chatbot.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"1060\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3.png\" alt=\"Generate Endpoint Docs\" class=\"wp-image-18208\" title=\"\" srcset=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3.png 2048w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3-300x155.png 300w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3-1024x530.png 1024w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3-768x398.png 768w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3-1536x795.png 1536w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3-18x9.png 18w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-3-360x186.png 360w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5: Auto-Generate Missing Descriptions with AI<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your spec was imported without descriptions, open the reference and click <strong>&#8216;AI generate&#8217;<\/strong>. BetterDocs fills in missing descriptions and examples across the reference and reports the number of fields it generated once complete. If your spec is already fully documented, it tells you there&#8217;s nothing to generate.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"1062\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2.png\" alt=\"Auto Generate missing description with AI\" class=\"wp-image-18207\" title=\"\" srcset=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2.png 2048w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2-300x156.png 300w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2-1024x531.png 1024w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2-768x398.png 768w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2-1536x797.png 1536w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2-18x9.png 18w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-2-360x187.png 360w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 6: Test Endpoints with the \u2018Try-It\u2019 Playground<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On any endpoint doc, click <strong>&#8216;Try it&#8217;<\/strong> to open the playground drawer. It shows the <strong>Base URL<\/strong>, an editable request <strong>Body<\/strong>, and a live cURL command that updates as you edit, with a copy button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"642\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/6.-Try-it-Button-Test.gif\" alt=\"Test Endpoints\" class=\"wp-image-18209\" title=\"\"><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 7: Restrict Who Can See Your API Docs<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">API Docs doesn&#8217;t have its own visibility toggle; reference access is controlled at the <strong>category<\/strong> level, the same way as any other BetterDocs content. Go to <strong>BetterDocs \u2192 Access &amp; Restrictions<\/strong>, select the category your endpoint docs live in, and set it to logged-in users only. Open an endpoint doc in a private\/incognito window to confirm an anonymous visitor can no longer see it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"1066\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4.png\" alt=\"Restrict API docs\" class=\"wp-image-18210\" title=\"\" srcset=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4.png 2048w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4-300x156.png 300w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4-1024x533.png 1024w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4-768x400.png 768w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4-1536x800.png 1536w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4-18x9.png 18w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-4-360x187.png 360w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 8: Sync with AI Chatbot<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can sync your API documentation with the BetterDocs AI chatbot. This way, your chatbot can directly answer from the documentation created from the API.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"1065\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5.png\" alt=\"Sync doc with AI Chatbot\" class=\"wp-image-18211\" title=\"\" srcset=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5.png 2048w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5-300x156.png 300w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5-1024x533.png 1024w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5-768x399.png 768w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5-1536x799.png 1536w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5-18x9.png 18w, https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/image-5-360x187.png 360w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 8: Show with Code Snippet<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To show the test of your API documentation, you can add the \u2018Code Snippet\u2019 block for a Gutenberg website and the \u2018Code Snippet\u2019 element for an Elementor website. With this, the code will be automatically showcased in your API documentation.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2880\" height=\"1490\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/10.-Code-Snippet.gif\" alt=\"Show Code Snippet\" class=\"wp-image-18213\" title=\"\"><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Esito finale<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your OpenAPI or Postman spec is now a live, browsable API reference inside your knowledge base, with code samples, request\/response tables, and a working Try-it playground your readers can test directly.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"665\" src=\"https:\/\/betterdocs.co\/wp-content\/uploads\/2026\/08\/8.-Final-Outcome.gif\" alt=\"Final Outcome of BD API Docs\" class=\"wp-image-18212\" title=\"\"><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">This is how, with the help of BetterDocs&#8217; API Docs feature, you can turn any OpenAPI or Postman spec into fully rendered, always-in-sync API documentation without writing it by hand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Essere bloccati? Sentiti libero di contattare il nostro <a href=\"https:\/\/wpdeveloper.com\/support\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Team di supporto dedicato<\/strong><\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Learn step-by-step process of how to generate a documentation directly from API with BetterDocs.<\/p>","protected":false},"author":44,"featured_media":18212,"template":"","meta":{"_eb_attr":"","inline_featured_image":false,"_eb_data_table":"","footnotes":""},"doc_category":[309],"doc_tag":[],"knowledge_base":[282],"class_list":["post-18203","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-configurations","knowledge_base-wordpress"],"year_month":"2026-08","word_count":807,"total_views":"1","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Maahi","author_nicename":"maahi","author_url":"https:\/\/betterdocs.co\/it\/author\/maahi\/"},"doc_category_info":[{"term_name":"Configurations","term_url":"https:\/\/betterdocs.co\/it\/docs\/shopify\/configurations\/"}],"doc_tag_info":[],"knowledge_base_info":[{"term_name":"WordPress","term_url":"https:\/\/betterdocs.co\/it\/docs\/wordpress\/","term_slug":"wordpress"}],"knowledge_base_slug":["wordpress"],"_links":{"self":[{"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/docs\/18203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/users\/44"}],"version-history":[{"count":3,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/docs\/18203\/revisions"}],"predecessor-version":[{"id":18216,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/docs\/18203\/revisions\/18216"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/media\/18212"}],"wp:attachment":[{"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/media?parent=18203"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/doc_category?post=18203"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/doc_tag?post=18203"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/betterdocs.co\/it\/wp-json\/wp\/v2\/knowledge_base?post=18203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}