Regarding Mautic api create campaign

Your software
My Mautic version is: 4.4.9
My PHP version is: 8.0.29
My Database type and version is: 5.7.23- |Doctrine driver|pdo_mysql|

Your problem
My problem is: I am sending my request through rest api with an array as following(according to Mautic doc):

Code:
$array = [ ‘name’ => testcampaign->name, ‘description’ => “testcampaign”->description, ‘isPublished’ => 0 ];
But I get an error 400 bad request: At least one event is required. Use the Launch Campaign Builder.
I am using Mautic rest api create a campaign end point to create the complete workflow as shown in attached screenshot below. Is there a restful way to create a Campaign for Mautic along with array of data using Rest api?

Hi there!

I checked the new WIP docs and it refers you to the unit tests to find examples of creating a campaign with the UI if you need to add events (which is what the error refers to - you can’t generally create a campaign without any associated events).

Here is a unit test that might be helpful as a starting point?

It would be great to actually document some examples of creating a campaign with events, so if you would like to help with that you can make a PR using the ‘edit on Github’ button top right!