Set featured image using URL with wp rest api
When you create or update a post, you can pass a featured_media argument in the POST data containing the media file’s post ID. (It appears you need to have the media item’s post ID, not the URL, for this to work.)