The resource has permanently moved to a new URL given in the Location header.
301 Moved Permanently is the redirect that tells search engines and clients "this URL is dead, use the new one forever". Browsers update bookmarks. Search engines transfer most of the SEO ranking signal to the new URL. CDN edges and HTTP caches cache the redirect aggressively. Use 301 only when you are confident the change is permanent; if there is any chance of moving back, use 302 or 307 instead.
When servers should return it: Return 301 when a URL has permanently changed. Common cases: domain migration, restructuring URL paths, switching from www to apex (or vice versa), HTTP-to-HTTPS upgrades.
curl -i https://old.example.com/page
HTTP/2 301
location: https://new.example.com/page
cache-control: public, max-age=31536000
For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.