Passing multiple parameters to the Element API How should I go about passing multiple parameters to the Element API? 

The scenario is that I would like to display all my categories for a given section in a form, and allow the user to select categories, and send them to the API. I would like to receive back a json object of all the entries that have the categories assigned.

I am aware that I can dynamically catch url segments, but I'm not understanding how I would pass something like a GET parameter as a segment.

Thanks for the help!
You can fetch GET parameters using HttpRequestService::getQuery() or getRequiredQuery():

'entries-by-category' =&gt; function() {
    $categoryIds = craft()-&gt;request-&gt;getRequiredQuery('categoryIds');

    return [
        'elementType' =&gt; 'Entry',
        'criteria' =&gt; [
            'relatedTo' =&gt; ['targetElement' =&gt; $categoryIds],
        ],
        // ...
    ];
},