1

I have a GET /reports endpoint which is having pre-condition - list of particular forms should be filled before we fetch data for reports. In case any of those forms are not filled, an error should be sent to the client saying "X form should be filled before fetching report". Is 412 - Precondition failed valid HTTP status code for this scenario or should I use 424 - Failed Dependency?

Dharita Chokshi
  • 1,133
  • 3
  • 16
  • 39

1 Answers1

1

The most appropriate status code is probably 409. 409 is often used in cases where a request could not be completed, due the state of another resource not being right.

Unless you are doing something with the 409 specifically though, 400 is fine too.

Evert
  • 93,428
  • 18
  • 118
  • 189