WhereGoes

201 Created

2xx success

The request succeeded and created a new resource, commonly after a POST or PUT, with the new location usually supplied in the Location header.

Common causes

  • A POST to a collection endpoint inserted a new record.
  • A PUT to a previously unused URL created the resource there.
  • An upload or import task registered a new object successfully.

How to fix it

  • Return a Location header pointing at the created resource.
  • Include a representation of the new resource so the client need not refetch immediately.
  • Make the URL in Location absolute and reachable by the same credentials.

What it means for redirects and SEO

Not a redirect, but a POST that returns 201 with a Location header creates a new crawlable URL worth linking. Crawlers do not follow that Location as a redirect. Expose the created resource in a sitemap if it should be indexed.

Related codes