Nested objects for geoJSON using Element API
I figured this out myself. I needed to use PHP array syntax.

In answer to my own question, the updated code for a nested object would be:

...

return [
    "type" =&gt; "Feature",
    "geometry" =&gt; array("type" =&gt; "Point", "coordinates" =&gt; [125.6, 10.1]),
    "properties" =&gt; array("name" =&gt; "Dinagat Islands")
];

...


Hope this helps someone else as it wasn't immediately apparent to me.