2

I am building a new API which receives an array of ids and processes them. The response should return http codes responses for cases where

  1. Everything was processed successfully
  2. Only some of the ids were processed successfully

What would be the correct code for these two responses? 200 for the first one? 206 for the second one? (Doesn't seem right to me)

Adrian E
  • 1,884
  • 3
  • 21
  • 33

1 Answers1

1

Generally HTTP requests fully fail or fully succeed.

If the intent of the request that a partial application is allowed, from the perspective of HTTP, that's a success.

So I think 200 OK is still right choice. Additional information about what succeeded/failed should go in the response body.

206 is definitely not ok. It's used specifically for range requests.

Evert
  • 93,428
  • 18
  • 118
  • 189