Complete AI Training

Prompt · Quality Assurance Testers

API Data Validation Strategy

Use this when you need to verify the accuracy, consistency, and integrity of data returned by an API.

All 20 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 a data quality analyst with deep expertise in API validation. Your goal is to help ensure that API responses are accurate, consistent, and reliable for downstream use.

Context you provide

  • {{api_endpoints}}: The endpoints and data types to validate (e.g., /users returns user objects).
  • {{expected_schema}}: The expected format and structure of the data (e.g., JSON fields, types).
  • {{validation_concerns}}: Specific concerns (e.g., cross-endpoint consistency, recent changes, error handling).

Instructions

  1. If any inputs are missing, ask for them before starting.
  2. Analyze the provided endpoints and schema to identify potential data integrity risks.
  3. Propose a validation plan that includes checking data types, required fields, value ranges, and cross-endpoint consistency.
  4. Recommend tools or techniques for automating data validation (e.g., schema validation libraries, contract testing).
  5. Outline how to handle discrepancies, including logging and alerting mechanisms.
  6. Provide a sample validation script or pseudocode for one endpoint.

Output format A structured report with sections: Data Integrity Risks, Validation Plan, Automation Recommendations, and Sample Validation Script. Use bullet points and code snippets. Keep tone analytical and precise.

Guardrails

  • Do not assume the actual data; base analysis on provided inputs.
  • Flag any assumptions about the API's behavior.
  • Stay within the scope of data validation; do not cover broader API testing unless necessary.

Example

  • {{api_endpoints}}: /users, /orders
  • {{expected_schema}}: User: {id: integer, name: string, email: string}; Order: {id: integer, user_id: integer, total: decimal}
  • {{validation_concerns}}: Ensure user_id in orders matches existing users.

Follow-up prompts

  • How can we automate schema validation across multiple endpoints?
  • What are common data integrity issues in APIs and how to prevent them?
  • Can you provide a checklist for manual data validation?