# Use API to export and import to another Org

**URL:** <https://forum.builder.io/t/use-api-to-export-and-import-to-another-org/67>\
**Category:** Technical Questions\
**Tags:** api\
**Created:** [April 30, 2020, 5:43pm UTC](https://forum.builder.io/t/use-api-to-export-and-import-to-another-org/67 "2020-04-30T17:43:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saad](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Saad](https://forum.builder.io/u/Saad)\
**Post date:** [April 30, 2020, 5:43pm UTC](https://forum.builder.io/t/use-api-to-export-and-import-to-another-org/67/1 "2020-04-30T17:43:59Z")

</div>

Hi,

I used the [Content API](https://www.builder.io/c/docs/query-api) to retrieve a Page a built.  
I wanted to use the data retrieve to create the same page on another Organisation with the [Write API](https://www.builder.io/c/docs/write-api) but it didn’t worked :  
-First I stored the “data” content in an environment variable

```
CONTENT=$(curl -X GET "https://cdn.builder.io/api/v2/content/page?apiKey={myApiKey}&query.id={myPageID}&limit=1" -H "accept: */*" | jq '.results[].data')

```

-Then I wanted to use the result and create a page:

```
curl https://builder.io/api/v1/write/page -X POST -d '{ "name": "Test API", "data": '"$CONTENT"' }' -H 'Authorization: Bearer bpk-{privateKey}'

```

Output:

```
{"id":"06b0e76be84f4cd2a6b167b8ca6812d2","priority":-12,"name":"","published":"draft","createdDate":1588267616133,"modelId":"3edb0f89273849fdb07301511449334e","ownerId":"7f6932b3bcf34cc1aa9d69b9612f19db","data":{},"{ ***here was my json*** }" }

```

But in the interface it’s totally empty:

 ![Screenshot 2020-04-30 at 19.41.15](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/2f1ce65ea71ed7c85f13d91cc7d5de417500e7d7.png)  
 ![Screenshot 2020-04-30 at 19.41.31](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/a0b00070f189af365e9f8db793698454148b18d1.png)

Am I doing something wrong ?  
Is there a better way to export/import pages ?

Thanks!

---

<div class="post-metadata">

**Author:** ![aziz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/aziz/32/2551_2.png) [@aziz](https://forum.builder.io/u/aziz)\
**Post date:** [April 30, 2020, 8:20pm UTC](https://forum.builder.io/t/use-api-to-export-and-import-to-another-org/67/2 "2020-04-30T20:20:11Z")

</div>

In the code above `$CONTENT` is a string and need to be parsed to JSON before sending it to the write API, try removing the surrounding “”  
` -d '{ "name": "Test API", "data": $CONTENT }'`

If this is a one-off usage you can always just right click on any page and download builder.json then upload it on any other builder content pages.
