Below code might help the people who started learning nextjs api calls. to get dynamic routing id.
app/api/events/[event]/route.js
export async function GET(request, { params }) {
const slug = (await params).event //event id
}
this slug will return to get [event] value