Document an API endpoint from its code
Writes reference documentation for one API endpoint from its handler code, with parameters, responses and an example request.
Task:
Write reference documentation for the API endpoint implemented in the code below.
Context:
The API is written in [language and framework]. The readers are [reader type] who call it from [client type].
Rules:
- Read the handler, its validation and its error paths before you write anything.
- Document only behavior the code shows. Where the code does not make a status code, limit or default clear, write a "to confirm" note instead of guessing.
- Include method and path, authentication needed, parameters in a table, success response, error responses and one example request.
- In the example use obvious dummy values and never a real key or token.
Result:
Markdown documentation of at most 350 words. End with one sentence listing the "to confirm" notes I should check with the code owner.
Material:
[paste the endpoint handler and related code here]