Totally possible. Just loop through the blocks and add whatever data you want from them to the response array:
'transformer' => function(EntryModel $entry) {
// Create an array of all the "Body" Matrix field's blocks
$bodyBlocks = [];
foreach ($entry->body as $block) {
switch ($block->type->handle) {
case 'text':
$bodyBlocks[] = [
'text' => $block->myRichTextField->getParsedContent(),
];
break;
case 'image':
$image = $block->myAssetsField->first();
$bodyBlocks[] = [
'image' => $image ? $image->getUrl(['width' => 500]),
'caption' => $block->myPlainTextField,
];
break;
}
}
return [
'title' => $entry->title,
'url' => $entry->url,
'description' => (string) $entry->description,
'body' => $bodyBlocks
];
},
Each of the elements in that sub-array will be MatrixBlockModel objects.