What are applicable scenarios in using HTTP status 207 in REST API?

If you perform a destructive operation like POST, PUT, DELETE against more than one resource and the operations against each individual resource did not share a common outcome then you can go for 207.

For example,

  • If you DELETEd two resources and both were deleted you can expect
  • If both DELETEs were forbidden, you’d expect 403.
  • If one DELETE was successful but one was forbidden, you would receive 207.

Some more discussion on 207 status.

Leave a Comment