complex API vs simple API endpoint : <p>I have a backend Rails application that is mainly API endpoints and a front-end application that is mainly being built in React.</p>

<p>Consider the following models:</p>

<ol>
<li><strong>Panel</strong>: is an container element inside a dashboard. It defines dimensions/positions inside the dashboard. It also defines its content using a content_type and a content_id (polymorphic associations).</li>
<li><strong>Chart / SingleValue / Section</strong>: these are all models that can be used as content for the panel. </li>
</ol>

<p>What I would like to do now is letting the user create a "chart panel" in one step.</p>

<p>I've been wondering for a while now if it is better to:</p>

<ol>
<li>Have all the basic CRUD API end-points and manage the panel+chart creation 100% on the front-end. This would mean more complexity on the front-end but fewer API end-points.</li>
<li>Have an extra API endpoint on the Rails side to create panel+chart/panel+single_value/panel+section (atomic operation). This would mean much less complexity on the front-end but more API end-points.</li>
</ol>

<p>What would be the ideal approach?</p>
