AmbiguousMatchException: The request matched multiple endpoints. Matches: X, Y
Two controller actions or minimal API endpoints have the same route and HTTP method.
Seen on:
.NET
Meaning
Duplicate [HttpGet] routes, overloaded actions without distinct routes/constraints, or both a conventional and attribute route match the URL.
Common causes
- Two actions with identical route templates and verbs
- Overloads differing only by parameter types
- Missing route constraints ({id:int})
⚡ Quick fix
- Give each action a unique route or verb
- Add route constraints
- Remove duplicate endpoint registrations
Detailed fix by platform
C#
- csharp
[HttpGet("{id:int}")] public IActionResult GetById(int id) => ... [HttpGet("{slug}")] public IActionResult GetBySlug(string slug) => ...
How to diagnose
- Matches — Endpoints listed in the message
- Routes — Templates and constraints
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in .NET
- NullReferenceException System.NullReferenceException: Object reference not set to an instance of an object
- FileNotFoundException assembly Could not load file or assembly 'X, Version=…' or one of its dependencies
- InvalidOperationException InvalidOperationException: Unable to resolve service for type 'X' while attempting to activate 'Y'
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026