Element API: Get Entries Related to Category with Query Parameter
Are you passing the projectCategory parameter as a string or ID? In any case, the relatedTo parameter will receive a string in your code, which might trip up the query. If the parameter is passed as an ID, passing it as an integer instead of a string might be enough:
'relatedTo' =&gt; (int) $projectCategory,

However, it might be cleaner to get the actual category element based on the ID and pass that to relatedTo. This will also allow you to check if the specified category actually exists (and optionally return an HTTP error for invalid parameters).
$criteria = ['section' =&gt; 'projects'];
$projectCategory = \Craft::$app-&gt;request-&gt;getQueryParam('projectCategory');
// this assumes the category is passed as an ID
$category = \craft\elements\Category::find()-&gt;id((int) $projectCategory)-&gt;one();
if ($category) {
    $criteria['relatedTo'] = $category;
}