Ad space (top)
Home β€Ί Prompt Library β€Ί Prompt for Writing API Documentation

Prompt for Writing API Documentation

Generate clear, complete API docs for an endpoint from your code or a description.

Coding Β· Works great in Any AI

Copy-ready prompt

Write API documentation for this endpoint:
[paste code or describe: method, path, purpose]
Include:
- Description and purpose.
- Request: method, URL, headers, parameters, body schema.
- Response: status codes, body schema, example.
- A working example request and response.
- Error cases.
Format in clean Markdown.

Want a version tailored to you?

Answer a few quick questions and the Code Prompt Generator builds a custom prompt from your exact details.

πŸ’» Open the Code Prompt Generator
Ad space (inline)

Why this prompt works

Undocumented APIs waste everyone's time. This prompt produces complete, example-driven docs covering requests, responses, and errors in Markdown, so other developers can integrate without reading your source.

How to customize it

  • Paste the real code for accurate parameter and schema docs.
  • Include realistic example requests and responses.
  • Document error cases; they're what devs actually search for.

Tip: replace the parts in [square brackets] with your own details before you send. The more specific you are β€” audience, tone, goal, constraints β€” the better the AI output.

Ad space (sidebar)