Skip to content Are you an AI agent? QIO facts, prices and requests are here

Websites and development4 min read

A 201 response proves nothing: twenty API checks that catch real bugs

API testing works better on one end-to-end scenario than on a list of endpoints. A guide published by the online school Netology on Habr, a large Russian-language IT community site, builds everything around a create-order request: first the successful response is verified, then conditions are changed one at a time. Many of the checks repeat on every project, and they are easy to automate in Postman, so the guide covers both the checks and the way to keep them.

A 201 response proves nothing: twenty API checks that catch real bugs

The scenario everything is built on

The base request creates an order with the required fields and a valid token: product, quantity, delivery address. The server replies 201 Created, a Location header pointing at the created resource, and a body with the identifier, items, status and total.

Under RFC 9110 the 201 status means the request succeeded and resulted in a new resource. The scenario then unfolds: after the POST the order is fetched with GET and compared, changed with PATCH, read again, deleted and checked for absence.

One rule applies before every test: record three things — the original request, the expected response and the state of the system after the operation.

Four trays holding five, five, three and seven tokens
Twenty checks in four trays: five for the successful response, five for input data, three for errors, seven for access and system state. Below, input data and errors share one section.

At acceptance it is rarely the status code that surfaces, it is the gap between the response and the state of the system: the order exists, the stock did not move. That is why our checklist always includes a follow-up request after the operation, not only an assertion on the response body.

The successful response: five checks

The first group answers whether the operation worked correctly, not merely whether a response arrived.

  • 1. Status code: matches the documentation and does not hide an error inside the body.
  • 2. Response structure: every required field present, nothing unexpected.
  • 3. Types and formats: identifier, quantity and creation date match the schema.
  • 4. Data values: what came back is what was sent — product, quantity, address.
  • 5. Business logic: the total follows the formula from the requirements rather than echoing the request; the status has a valid initial value; discount, delivery, taxes and rounding are applied in the right order.

Input data and errors: eight checks

Next the same request is altered one condition at a time. Remove the address and the product together and it is unclear what the server actually rejected.

Five checks cover the input data and three cover the error response. For negative cases a 4xx code (a client-error status) is not enough: the response must explain the reason, point at the specific field, and still not expose internal detail such as a stack trace, an SQL query or a path on disk.

  • 6. Required fields: remove each one in turn, including fields nested inside an order item.
  • 7. Empty and null values.
  • 8. Wrong types and formats.
  • 9. Boundary and invalid values.
  • 10. Unknown and extra fields.
  • 11. Correct error status code.
  • 12. Error body: the reason and the specific field.
  • 13. Safe error response: no stack trace, SQL or secrets.

Access and system state: seven checks

The interesting part starts where a single response ends. Three checks concern access, four concern the state of the system.

Then it looks at the system as a whole. The example given: after ordering two units the stock should fall by two, after cancellation it should recover, and the linked payment or warehouse operation should move to the right state.

Idempotency means that repeating the same request does not change the end result. A client may resend an operation after a dropped connection. In the guide's scenario DELETE is sent twice: the second reply may differ, for example 404 instead of 204, but the order must not come back and the stock must not change again. POST is not idempotent by default, so duplicate protection for a repeated order is tested only when the contract promises it.

A separate requirement concerns contract hygiene: the response must not contain password hashes, internal identifiers or other people's email addresses. OWASP, an open community that publishes web and API security guidance, recommends limiting responses to the minimum necessary set of fields.

  • 14. Requests without valid authentication.
  • 15. Access to other users' objects.
  • 16. Separation by role and function.
  • 17. Object state after the operation.
  • 18. Related business rules and side effects.
  • 19. Repeat requests and idempotency.
  • 20. Consistency across related endpoints.

What gets checked when the contract is bigger

The list does not end at twenty; the set is chosen by contract and architecture: pagination, sorting and filtering, rate limiting, versioning and backward compatibility, concurrent updates and optimistic locking, timeouts and degradation of external dependencies, feature flags, asynchronous operations returning 202 Accepted, webhooks with signatures and retries, caching with ETag and 304 responses.

How to keep it in Postman

Manual checking is right while the expected result is still being clarified. Once a scenario is stable it moves into a collection: base URL and token go into the environment, the order identifier is saved into a collection variable after creation, later requests use it, and the assertions live in the post-response scripts.

The Collection Runner executes the chain end to end, and the same collection runs on a schedule or in CI/CD. Only stable checks are worth automating: while the expected result still moves, the test will break more often than it finds bugs.

The takeaway

Twenty checks are not a ritual but a way to separate "a response arrived" from "the system did the right thing". Four of the twenty, checks 17–20, look past the response at the state of the system and the consequences of the operation, and that is where the expensive bugs usually live.

Sources

  1. How to test an API: 20 checks a QA should be able to run, Netology on Habr
  2. RFC 9110: HTTP Semantics
  • API
  • Postman
  • RFC 9110
  • OpenAPI
  • OWASP

Follow the journal

New pieces on websites, SEO and AI come out in the QIO journal. Follow in Google, by RSS or in Telegram to get them first.

Read next

How can we help?
Discuss a project