Programmatically create new entry with saveElement
In Craft's v3 API documentation they give an example:

https://docs.craftcms.com/api/v3/craft-services-elements.html#method-saveelement

$entry = new Entry();
$entry-&gt;sectionId = 10;
$entry-&gt;typeId = 1;
$entry-&gt;authorId = 5;
$entry-&gt;enabled = true;
$entry-&gt;title = "Hello World!";
$entry-&gt;setFieldValues([
    'body' =&gt; "&lt;p&gt;I can’t believe I literally just called this “Hello World!”.&lt;/p&gt;",
]);
$success = Craft::$app-&gt;elements-&gt;saveElement($entry);
if (!$success) {
    Craft::error('Couldn’t save the entry "'.$entry-&gt;title.'"', __METHOD__);
}