# API Response formatting: nested vs keyed

**URL:** <https://forum.mautic.org/t/api-response-formatting-nested-vs-keyed/13831>\
**Category:** Development\
**Tags:** discussion\
**Created:** [April 9, 2020, 7:46am UTC](https://forum.mautic.org/t/api-response-formatting-nested-vs-keyed/13831 "2020-04-09T07:46:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![majesteitbart](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/majesteitbart/32/1617_2.png) [@majesteitbart](https://forum.mautic.org/u/majesteitbart)\
**Post date:** [April 9, 2020, 7:46am UTC](https://forum.mautic.org/t/api-response-formatting-nested-vs-keyed/13831/1 "2020-04-09T07:46:42Z")

</div>

Hi everyone,

I understand that a lot of Mautics API responses are formatted in an associative array format. Contacts, companies, etc. They are formatted like this:  
` "contacts":{"1":{...}, "2":{...}}`  
Instead of:  
` "contacts":[{"id": "1", ...},{"id": "1", ...}]`

However, I’m working with MS Power Automate for a lot of integrations, and it doesn’t really like this kind of format. The responses need to be converted to XML and then I can use XPath to get the info I need.

Why are responses formatted in this way? And why are all responses in a different format? Contact Activities for example, are formatted in a normal nested array:  
{ “events”: [  
{ “event”: “lead.source.created”, “eventId”: “lead.source.created19348”},  
{ “event”: “lead.source.created”, “eventId”: “lead.source.created19349”}  
]}

IF I would want to make changes to the way these array are formatted, in what part of the repo should I look? I’ve been looking into the API controllers and Serialization, but can’t seem to find where the decision is made per entity.
