getting the current user entries from elementapi How do I use the elementapi to get the list of entries for the logged in user?

I've tried a couple of options to no avail, like 

'api/v1/user/&lt;userId:\d+&gt;.json' =&gt; function($userId) {

            $author = craft()-&gt;users-&gt;getUserById($userId);

            return [
                'elementType' =&gt; 'Entry',
                'criteria' =&gt; [
                    'section' =&gt; 'jobs',
                    'author' =&gt; $author
                ],
...


as an example of one I thought should have worked but it just returns everything.
If you really want the entries for the currently logged in user, having a parameter for userId in your endpoint URL doesn't really make sense.

Not tested, but something like this should work:

'api/v1/user.json' =&gt; function () {

    $author = craft()-&gt;userSession-&gt;getUser();

    if (!$author) {
        HeaderHelper::setHeader(array('status' =&gt; 404));
        craft()-&gt;end();
    }

    return [
        'elementType' =&gt; ElementType::Entry,
        'criteria' =&gt; [
            'section' =&gt; 'jobs',
            'authorId' =&gt; $author-&gt;id,
        ],
    ];
}


Notice that the above example endpoint would be available at http://example.com/api/v1/user.json, where your example code would create an endpoint with a required userId parameter, i.e. http://example.com/api/v1/user/12345.json.

Also notice that the currently logged in user is pulled via the UserSessionService (craft()-&gt;userSession). 

Finally, note that you should use 'authorId' =&gt; $author-&gt;id in your criteria – not 'author' =&gt; $author.