How to export identities array and user_metadata object

I’m following these docs: to try and export my users. Everything is working.
I know we can use identities[0].connection to get a specified element, but currently, I want to export all the elements in the identities array and user_metadata object but I cannot find any docs about it.

Then endpoint I used: /api/v2/jobs/users-exports
And the payload:

    "connection_id": "con_01111111111111",
    "format": "csv",
    "limit": 10,
    "fields": [
            "name": "created_at"
            "name": "email"
            "name": "identities"
            "name": "user_metadata"

But the results are empty, even though we have identities and user_metadata data exist.
Could anyone help me?

Hi @hapham

Can you give more info? I’m confused. You say both “Everything is working” and “the results are empty”.

The full query you are running and the results (truncated and obfuscated as needed) would be helpful.

Both the identities array and the user_metadata should be in the output.


Hi @john.gateley
I meant the result of identities and user_metadata fields are empty, the other fields are OK.
The result I got:


At a guess, I’d try JSON format instead of CSV. Since the identities and user_metadata fields are not simple objects, the CSV format may not know how to export them.



Oh, yes! It should be JSON! Silly me!
Thank you very much!

1 Like

No worries! We’re here for you!

it is JSON.Thanks you

1 Like

Teamwork makes the dreamwork!