Briefle words · Code & architecture
201 Created
The success code meaning a new record was made, rather than something simply read.
Say it to an AI
FastAPI POST /appointments that returns 201 Created with the new appointment. Use proper HTTP status codes for failures via HTTPException: 404 if the slot doesn't exist, 409 if it's already taken, 422 if the start time is in the past. Never return 200 with an ok/error flag.
How an expert would brief the stronger version of “Booking endpoint”.
See it
Try it as a puzzle →The API endpoint a clinic's patient app calls to book an appointment slot.
Why: B sets status_code=201 on the POST so the app knows an appointment now exists.
Related words
Room 5 · APIs & data
Learn “201 Created” in a five-minute lesson