Element API — Endpoint has an invalid elementType
Your second example has the correct elementType value (Entry::class with a corresponding Entry import at the top of the file). Alternatively you could do



'elementType' =&gt; 'craft\elements\Entry',


The error you’re getting in that example is because you changed the endpoint to just news.json rather than api/news.json. So the request isn’t getting routed to this endpoint in the first place.