---
title: "Return 405 with the allowed methods · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/resources-and-methods/method-not-allowed
updated: 2026-10-20
licence: "All rights reserved"
---

# Return 405 with the allowed methods

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Resources and methods](https://agentwranglers.se/playbook/api-design/resources-and-methods)
- Rule: When a path exists but the method doesn't apply, answer 405 and list what works in the `Allow` header.
- How: RFC 9110 requires the `Allow` header on a 405. Let the router produce it from the routes it knows, so it stays correct. Answer 404, not 405, when the path itself doesn't exist.
- Check: `curl -i -X DELETE https://api.example.com/orders` returns 405 with `Allow: GET, POST`.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/resources-and-methods/method-not-allowed`.

- Previous: [Answer with the right status code](https://agentwranglers.se/playbook/api-design/resources-and-methods/status-codes)
- Next: [Keep addresses stable](https://agentwranglers.se/playbook/api-design/resources-and-methods/stable-addresses)
- [Resources and methods](https://agentwranglers.se/playbook/api-design/resources-and-methods)
