1

I'm designing an API and I need to document a response to a GET request for the following situation:

You (the client) have made a valid GET request.
You have the right to GET this particular resource.
There is absolutely nothing wrong with your request, except...
The resource isn't ready yet. Please try again later.
(Maybe something else in the response suggests an amount of time to wait.)

I've reviewed the list of response codes. 425 ("Too Early") was promising but the description of that status didn't fit. I also considered 404 but that doesn't quite mean "Not Found Yet". 412 ("Precondition Failed") is close but the precondition is the amount of time the client has left, which doesn't quite fit.

Is there an HTTP response code that fits this description or do I need to invent one and hope it gets established widely enough that it eventually gets defined?

1 Answer 1

2

425 doesn't fit as its main purpose is to deny any spam (close to 429 but allowing user in a few seconds/minutes to request again)
412 doesn't fit either as the request has no missing precondition (it is a valid request)

There is no dedicated HTTP code to your use-case (yet).

I will illustrate with boxes on a shelf
404 fits the most if your entity does not exists yet, you went to the shelf and no box has been found, maybe a box will arrive in a few seconds, maybe never, who knowns ?
409 might also be an option if your entity is partially existing (but not fully available yet), you went to the shelf, you found the box, but it wasn't taped and stamped yet. The box is not ready to be returned yet, but maybe in a few seconds the backend will treat it and the box will be ready to be sent.

Sign up to request clarification or add additional context in comments.

1 Comment

I've looked around for more informations on 425 and it might actually fit your use-case depending on context for instance this StackOverflow post. However I do not really recommend to use it for now as it is mainly used in protocols over real application purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.