How do I programmatically add assets to an assets fieldtype on a Matrix
This is totally untested but something like this could work (or at least give you some hints)

edit: since I was bored I tested the code.. it works

public function actionImport(){
    $jsonData = // getYouJsonDatasomehow here
    foreach($jsonData as $json){
        $entry = craft()-&gt;elements-&gt;getElementById($json['id']);
        /** @var \Craft\MatrixBlockModel[] $matrix */
        $matrix = $entry-&gt;Content-&gt;find();
        /** @var \Craft\MatrixBlockModel $block */
        foreach ($matrix as $block){
            // I pretend there is already the required block for the entry otherwise you have to create it

            if($block-&gt;getType()-&gt;handle === 'allImages'){
                // long version...
                $attributes = $block-&gt;getContent()-&gt;getAttributes();
                $attributes['images'] = $json['imageIds'];
                // some other changes if you want... title or whatever
                $block-&gt;getContent()-&gt;setAttributes($attributes);

                // short version would be
                $block-&gt;getContent()-&gt;setAttribute('images', $json['imageIds']);
                craft()-&gt;matrix-&gt;saveBlock($block);
            }
        }

    }
}


Since you did not say if the blocks/entries already exist or if the images even exist or if they have to be imported as well I decided to pretend everything is ready to use and your json images contain just an array of ids. If your images contains only local paths you would have to import them first with something like

$arrImages = [];
foreach($json['images'] as $image){
    $path = $image['path'];
    $name = $image['name'];

    $response = craft()-&gt;assets-&gt;insertFileByLocalPath(
        $yourFilePath,
        $nameOfImage,
        $folderId,
        AssetConflictResolution::Replace
    );

    if($newFildeId = $response-&gt;getResponseData()['fileId']){
        $arrImages[] = $newFildeId;
    }
}


$block-&gt;getContent()-&gt;setAttribute('images', $arrImages);