A REST API testing checklist: 20 things to check before release

Most API bugs that reach production weren't hard to find. Nobody looked. This checklist is the list we go through before an endpoint ships: 20 items, each with the check that catches it.

Copy it into your pull request template, or work through it once per endpoint.

Responses

1. The exact status code. 201 for a create, 204 for a delete with no body, 200 for a read. Not "anything 2xx".

JavaScript
pm.test('creates the order', () => pm.response.to.have.status(201));

2. The fields clients use exist, with the right types. Check every field your frontend reads, or validate the whole body with a JSON schema in the Tests tab (matches JSON schema on $).

3. Content-Type is right. application/json for JSON, and a charset if your clients need one.

4. No internal fields leak. Password hashes, internal IDs, debug info and stack traces don't belong in a response.

JavaScript
pm.test('no internal fields', () => {
  const user = pm.response.json();
  pm.expect(user).to.not.have.property('passwordHash');
  pm.expect(user).to.not.have.property('internalNotes');
});

5. Empty results are empty, not errors. A search with no matches returns 200 with [], not 404.

Authentication and access

6. No token → 401. Duplicate a request, set its auth to No auth, and check the status.

7. Expired or malformed token → 401, not 500.

8. Another user's resource → 403 or 404. The most common serious API bug. Log in as user B and ask for user A's order. See Negative testing for APIs.

9. A read-only role can't write. If you have roles, run one write request with each.

Input validation

10. Missing required fields → 400 or 422, with a message that names the field.

11. Wrong types → 400, not 500. Send "quantity": "two".

12. Limits are enforced. Too long, too large, negative, zero, empty string. A data file turns these into one request with many rows.

13. Unknown fields are ignored or rejected, on purpose. Either is fine; silently storing them usually isn't.

Behaviour

14. Pagination works at the edges. First page, last page, an empty page, a page size over the maximum. See How to test API pagination.

15. Retrying a create doesn't create twice. If the endpoint accepts an idempotency key, send the same request twice. See How to test idempotency keys.

16. Rate limits answer 429 with Retry-After. See Testing rate limits.

17. Updates return or persist what you sent. PATCH, then GET, then compare.

18. Responses are fast enough. A response-time check per request, and a p95 budget for the run:

Terminal
requestarium run-collection "Orders API" --env Staging --max-p95 800

Process

19. The tests run in CI on every pull request. The CLI exits non-zero on failure, so a broken endpoint blocks the merge. See How to run API tests in GitHub Actions.

20. The collection is updated in the same pull request as the API. When the API changes, the test changes with it. Syncing collections with Git makes that a normal part of code review.

The Tests tab with assertions generated from a response, all passing
Items 1 to 3 in two clicks: Generate from response, then tighten the values