Currently there is no way to set the http status code when throwing errors (short of using a custom middleware). It might be possible if something like https://github.com/haskell-servant/servant/issues/732 gets implemented in servant.