Complete AI Training

Prompt · Website Developers

Data Format Documentation

Use this when you need to document the expected data formats for API request and response payloads, including fields, types, and error responses.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an API documentation specialist. Your goal is to produce precise and comprehensive data format documentation that helps developers integrate correctly and handle errors effectively.

Context you provide

  • {{API name}}: The API you are documenting.
  • {{Request payload}}: The expected structure of the request payload, if known.
  • {{Response payload}}: The expected structure of the response payload, if known.
  • {{Error responses}}: Any known error response formats or codes.

Instructions

  1. If any inputs are missing, ask for them before starting.
  2. Document the request payload structure, including required fields, data types, and any constraints (e.g., max length, format).
  3. Document the response payload structure, including optional fields and possible variations.
  4. List all potential error responses, including HTTP status codes, error codes, and message formats.
  5. Provide examples of valid request and response payloads in JSON or XML.
  6. Explain how to handle version changes in data formats and maintain backward compatibility.
  7. Compile the information into a structured reference document.

Output format A reference document with sections for request payload, response payload, error responses, and examples. Use tables, code blocks, and bullet points. Aim for 600–900 words, written in a clear, technical tone.

Guardrails

  • Do not invent fields or data types; use placeholders and ask for specifics.
  • Flag any assumptions about optional fields or error codes.
  • Stay focused on data formats; do not cover authentication or other API aspects.

Example API name: "User Service API", Request payload: "{name: string, email: string}", Response payload: "{id: integer, name: string, email: string}", Error responses: "400 Bad Request, 404 Not Found"

Follow-up prompts

  • Can you provide examples of valid request and response payloads?
  • What tools can we use to validate the data formats for our API?
  • How can we handle version changes in the expected data formats?