# Where is macro configuration data stored?

**URL:** <https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017>\
**Category:** Confluence Cloud\
**Tags:** postgres, dynamic-content-macro, database, ac-express, macro, confluence-cloud\
**Created:** [June 10, 2022, 3:26pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017 "2022-06-10T15:26:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![daraleonard](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@daraleonard](https://community.developer.atlassian.com/u/daraleonard)\
**Post date:** [June 10, 2022, 3:26pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/1 "2022-06-10T15:26:03Z")

</div>

Hi,

I am currently developing a new Confluence application using ACE. The application has a Dynamic Content Macro with a couple of fields that a user can use to configure their application. Once finished inputting their details, the application is rendered on the page.

In my application I am using saveMacro() to save the macro configuration data, like so:

```auto
AP.confluence.saveMacro(formattedData, 'Macro body')
AP.confluence.closeMacroEditor()

```

My question is, where is the data actually stored? And is it secure? I can’t see anywhere that documents this, but I may have missed it

I have a database configured for my application, and the details in my config.json. like the following:

```auto
"production": {
    "port": "$PORT",
    "errorTemplate": true,
    "localBaseUrl": "$APPLICATION_URL",
    "store": {
        "type": "postgres",
        "url": "$DATABASE_URL"
    },

```

When I run queries against my database, all I can see is a “AddonSettings” table with no configuration data. A follow-up question would be, why do I need to setup my own database if the configuration data is not stored there.

---

<div class="post-metadata">

**Author:** ![remie](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/remie/32/34985_2.png) [@remie](https://community.developer.atlassian.com/u/remie)\
**Post date:** [June 10, 2022, 7:10pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/2 "2022-06-10T19:10:58Z")

</div>

Hi @daraleonard 👋

The confluence macro data is saved in the Confluence database and is made available to your app as [context variables in your descriptor](https://developer.atlassian.com/cloud/confluence/modules/macro-input-parameter/) or using the [`AP.confluence.getMacroData()` javascript method](https://developer.atlassian.com/cloud/confluence/jsapi/confluence/)

In terms of security, this is probably the most secure way to store user data, as it is directly stored in the Confluence database and both security, reliability and availability (incl. backup & restore) is therefor Atlassian responsibility within the [shared responsibility model](https://developer.atlassian.com/developer-guide/cloud-shared-responsibility-model/).

Now with regard to the need to have your own database: if you do not intend to store [installation lifecycle event](https://developer.atlassian.com/cloud/confluence/connect-app-descriptor/#lifecycle) payload data, there is no need to have a database.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![daraleonard](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@daraleonard](https://community.developer.atlassian.com/u/daraleonard)\
**Post date:** [June 13, 2022, 9:31am UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/3 "2022-06-13T09:31:42Z")

</div>

Thanks @remie , that helps a lot.

That’s not super clear from the documentation so thanks for the clarification.

---

<div class="post-metadata">

**Author:** ![daraleonard](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@daraleonard](https://community.developer.atlassian.com/u/daraleonard)\
**Post date:** [September 7, 2022, 2:52pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/4 "2022-09-07T14:52:15Z")

</div>

Hi @remie , is there a way I can get access to this macro config data in the express layer?  
Thanks,  
Dara

---

<div class="post-metadata">

**Author:** ![remie](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/remie/32/34985_2.png) [@remie](https://community.developer.atlassian.com/u/remie)\
**Post date:** [September 7, 2022, 3:30pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/5 "2022-09-07T15:30:43Z")

</div>

Euhm, yes, but it is tricky. You can do a [REST API request to get content](https://developer.atlassian.com/cloud/confluence/rest/api-group-content/#api-wiki-rest-api-content-get), and retrieve the content body in storage format. This is an XML representation of the page content, which also includes the macro. I think this also includes the macro parameters, but if not, you can retrieve them with yet [another REST API call](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---macro-body/#api-wiki-rest-api-content-id-history-version-macro-id-macroid-get)

What is your use case? Why do you need this information in the back-end?

---

<div class="post-metadata">

**Author:** ![daraleonard](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@daraleonard](https://community.developer.atlassian.com/u/daraleonard)\
**Post date:** [September 7, 2022, 3:55pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/6 "2022-09-07T15:55:32Z")

</div>

I have a dynamic content macro with an editor. Based on input in the editor, there is a request made with some potentially sensitive data which I want to hide from the browser.

I’m thinking of creating an endpoint in the express layer that would get the content form the macro and perform the request, thus hiding the request from the dev tools.

---

<div class="post-metadata">

**Author:** ![remie](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/remie/32/34985_2.png) [@remie](https://community.developer.atlassian.com/u/remie)\
**Post date:** [September 7, 2022, 4:24pm UTC](https://community.developer.atlassian.com/t/where-is-macro-configuration-data-stored/59017/7 "2022-09-07T16:24:26Z")

</div>

The thing is: you have access to the macro parameters in the editor and when rendering the macro. Which means you can retrieve the parameters on the frontend and pass them to your backend with a simple HTTP request.

Now if I understand correctly, you don’t want to do that because you don’t want to expose the parameters to the browser, is that correct?

If so, it might be good to know that these parameters are already exposed in the HTML as atlassian puts them in an attribute in the macro iframe. It is probably wise to not store sensitive information in the macro data.
