The request matched multiple endpoints 🟪 .NET

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

  1. Give each action a unique route or verb
  2. Add route constraints
  3. Remove duplicate endpoint registrations

Detailed fix by platform

C#

  1. csharp
    [HttpGet("{id:int}")] public IActionResult GetById(int id) => ...
    [HttpGet("{slug}")]    public IActionResult GetBySlug(string slug) => ...

How to diagnose

  1. Matches — Endpoints listed in the message
  2. 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:

🧠 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.