An endpoint is a network-accessible entry point of a web API. Clients use endpoints through HTTP and formats such as JSON or XML to interact with exposed data or operations. section 1.1
In ASP.NET Core, an endpoint can be implemented as a controller action or a Minimal API route. For example, /auth/test/4 can be restricted to authenticated users with the SuperAdmin role. section 9.5.4 section 11.2.7
Treat endpoints as both working API entry points and documented contracts:
- Create operations such as Account/Register for user creation. section 9.5.2
- Protect sensitive operations by declaring authorization requirements. section 9.5.4 section 11.5
- Group related endpoints by controller or explicit OpenAPI tags so SwaggerUI remains navigable. section 11.2.7
- Document inputs, responses, samples, and authorization requirements for clients and implementers. section 11.5
A protected test endpoint
Map /auth/test/4 with Minimal API and require the SuperAdmin role. A related Minimal API endpoint can receive the Auth tag so SwaggerUI places it with authorization-related operations. section 9.5.4 section 11.2.7
app.MapGet("/auth/test/1",
[Authorize]
[EnableCors("AnyOrigin")]
[SwaggerOperation(
Tags = new[] { "Auth" }, #1
Summary = "Auth test #1 (authenticated users).",
Description = "Returns 200 - OK if called by " +
"an authenticated user regardless of its role(s).")]
Inspect the Minimal API mapping pattern, authorization attribute, CORS setting, Swagger tag, summary, and description together. section 11.2.7

























