What would you test for an endpoint that creates a new user?
Answer
Cover schema and field rules, authentication and authorization, duplicate and concurrent requests, response codes and headers, persistence, downstream effects, rate limits, sensitive-data handling and observability.
Strong answer includes
- more than status-code checks
- security and concurrency
- database and downstream verification
Practical example
For POST /users, a tester checks that a duplicate email returns 409 rather than creating a second account, sends two identical signup requests concurrently to confirm no race condition creates duplicate records, verifies the password never appears in the response body or logs, checks that the created user actually appears in the database with correctly hashed password, and confirms a welcome email gets triggered downstream.