Prompt

How do I support both public docs and internal docs from the same API spec?

Technology / Documentation tools1 observationLast seen Oct 4, 2026

Latest observation

Oct 4, 2026OpenAI APIWeb search: off

A good way to support both public docs and internal docs from the same API spec is to treat the spec as the single source of truth, then generate different documentation views from it.

Common patterns

1. One spec, multiple doc outputs

Keep one OpenAPI/Swagger spec and use:

  • tags
  • visibility flags
  • extensions/metadata
  • separate doc generators or filters

For example:

  • x-public: true
  • x-internal: true
  • x-audience: internal

Then your doc pipeline can:

  • publish only public endpoints to the external docs site
  • publish everything to the internal portal

2. Separate sections by audience

Organize endpoints and schemas so they can be filtered cleanly:

  • public endpoints
  • internal/admin endpoints
  • beta/partner endpoints

Use consistent tags like:

  • public
  • internal
  • admin

This makes it easy to hide or show groups.

3. Use security and environment-aware docs

Sometimes the same operation is visible to both audiences, but with different details:

  • public docs show normal usage
  • internal docs show implementation notes, debug fields, edge cases, or support guidance

You can keep those in:

  • descriptions
  • vendor extensions
  • separate markdown linked from the spec

4. Hide internal details in the public spec

Be careful not to leak:

  • internal hostnames
  • private headers
  • internal error codes
  • staff-only fields
  • rollout or migration notes

If you need to expose them internally, keep them in:

  • x-internal-* fields
  • internal-only markdown
  • an internal doc overlay

5. Use overlays or post-processing

If your tooling supports it, create:

  • a base OpenAPI spec
  • a public overlay that removes internal paths/fields
  • an internal overlay that adds extra descriptions/examples

This keeps maintenance low while allowing tailored docs.

Practical implementation options

Option A: Filter by tag

  • Mark internal endpoints with internal
  • Generate public docs by excluding that tag
  • Generate internal docs with all tags included

Option B: Vendor extensions

Example:

paths:
  /users:
    get:
      x-audience: public
  /admin/users:
    get:
      x-audience: internal

Then filter docs based on x-audience.

Option C: Separate doc portals, same spec

Use one spec in source control, then:

  • public docs site runs a filtered build
  • internal docs site runs an unfiltered or enriched build

Best practice

If the distinction is important, explicitly model it in the spec rather than relying on naming conventions alone. That makes the setup easier to automate and less error-prone.

Recommendation

For most teams:

  1. keep one OpenAPI spec
  2. add audience metadata like x-audience
  3. generate two doc outputs via filtering
  4. avoid putting internal-only details in public descriptions

If you want, I can show you a concrete example in OpenAPI YAML and how to filter it into public vs internal docs.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.

How do I support both public docs and internal docs from the same API spec? — Obsurfable Explorer