Skip to content

202 Accepted

The server accepted the request for processing, but the work has not finished yet and may still fail later.

What 202 Accepted means

202 is for asynchronous work such as video encoding, report generation or bulk imports. The server queues the job and replies right away.

HTTP has no way to send the real result later, so APIs usually return a link to a status endpoint (in the Location header or the body) that the client can poll.

Headers that go with it

  • Location

Example response

HTTP/1.1 202 Accepted
Location: https://example.com/new-page
Content-Type: text/plain; charset=utf-8

202 Accepted

How to check for a 202 response

cURL

# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/

JavaScript (Node.js)

const res = await fetch("https://example.com/");
if (res.status === 202) {
  console.log(res.status, res.statusText);
}

Python

import requests

res = requests.get("https://example.com/")
if res.status_code == 202:
    print(res.status_code, res.reason)

Go

res, err := http.Get("https://example.com/")
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 202 {
	fmt.Println(res.Status)
}

Specification

202 Accepted is defined in RFC 9110, section 15.3.3.

  • 201

    Created

    The request worked and created a new resource. The Location header usually points to the URL of the new item.

  • 200

    OK

    The request worked. The response body holds the result, such as the page, file or JSON data the client asked for.

  • 303

    See Other

    The server redirects the client to another URL that it must fetch with GET, typically after a form submission or other POST.

← all 63 HTTP status codes

Type to search posts, tools and projects.

Keyboard shortcuts

Search+Kor/
Go to homegthenh
Go to bloggthenb
Go to projectsgthenp
Go to timelinegthent
Show this help?
Close search or helpesc