# Using Databases

Under the [Developers](https://dashboard.messagebird.com/en/developers/settings) section of your [Dashboard](https://dashboard.messagebird.com/en/user/index), you have the option to create server-less databases and store data from your Flows. This allows using, sharing, and retrieving data from one invocation of your Flow to another, based on a shared key.

### **In this article** <a href="#id-01fy9340mjps3rxjzwzk4f0er4" id="id-01fy9340mjps3rxjzwzk4f0er4"></a>

* [Creating a Database](#01FY934RPG2A1QBN6R1XFYAM22)
* [Adding, Importing, and Exporting datasets](#01FY934XS0Y8X50TQQP3ZTSW81)
* [Deleting Databases and Database data](#01FY93FXYTDYWZYJXHRQY9KKGD)
* [Data Retention Settings](#01FY9351ZWZEAP43HMPDM7ZPVX)
* [Public API](#01FY95M5MXQ5D0T6RZ06GFSQZG)

### **Creating a Database** <a href="#id-01fy934rpg2a1qbn6r1xfyam22" id="id-01fy934rpg2a1qbn6r1xfyam22"></a>

A database can be created by clicking on the *Create Database* in the top right corner of your interface:

<figure><img src="/files/T0oqnVvWixEGQv3f8nXE" alt=""><figcaption></figcaption></figure>

You will be asked to name your database and choose the [data retention period](#01FY9351ZWZEAP43HMPDM7ZPVX) - for how long you would like for the data in the database to be stored.

#### Database ID <a href="#id-01g15sdqxmh893rr2crcrem2xc" id="id-01g15sdqxmh893rr2crcrem2xc"></a>

Database ID is a value you might need when using the [Public API](#01FY95M5MXQ5D0T6RZ06GFSQZG) capabilities. It can be found in the URL of a Database:

* click on *Edit* the Database whose ID you need
* copy the ID from the URL. Example:

<figure><img src="/files/KoyeJKBpx1AQ8x690Tsd" alt=""><figcaption></figcaption></figure>

### **Adding, Importing, and Exporting datasets** <a href="#id-01fy934xs0y8x50tqqp3ztsw81" id="id-01fy934xs0y8x50tqqp3ztsw81"></a>

Once you have created your database, you can add a single record or import several records, at once. All the records you have added can also be exported.

#### &#x20; <a href="#id-01fy94z4z5sz4yymt0d6f478ne" id="id-01fy94z4z5sz4yymt0d6f478ne"></a>

#### Adding a single record <a href="#id-01fy945nr34grb5jdny1b8xmyz" id="id-01fy945nr34grb5jdny1b8xmyz"></a>

To add data to your database:

1\. click on the *Add data* in the top right corner:<br>

<figure><img src="/files/KSP1ll7fIPpPUthUsKwE" alt=""><figcaption></figcaption></figure>

2\. Input the desired key and value:

<figure><img src="/files/KoyeJKBpx1AQ8x690Tsd" alt=""><figcaption></figcaption></figure>

#### &#x20; <a href="#id-01fy94z4z5w3786xa5sp2b286f" id="id-01fy94z4z5w3786xa5sp2b286f"></a>

#### Importing datasets <a href="#id-01fy945swbx36yhmhx9pryjmfq" id="id-01fy945swbx36yhmhx9pryjmfq"></a>

To save time, upload a CSV file with your data:\ <br>

<figure><img src="/files/UoBbJvZrqesQcaiO5E1Y" alt=""><figcaption></figcaption></figure>

\
\
Use one *Key* and one *Value* per row of your CSV file. Value can be either a string or a JSON formatted object.

Your dataset is **searchable** by the *Key* by using the search bar under the database name:

<figure><img src="/files/2dIy24ksLHxp9vAM1vqs" alt=""><figcaption></figcaption></figure>

&#x20;

#### Exporting datasets <a href="#id-01fy945y5xzwtp21dcp1vtyq1j" id="id-01fy945y5xzwtp21dcp1vtyq1j"></a>

If needed, you are able to export your whole Database dataset into a CSV file by clicking on the *Export dataset* feature:

<figure><img src="/files/SJp8lVVGVIedAGoLhVpK" alt=""><figcaption></figcaption></figure>

### &#x20; <a href="#id-01fy95en8twt2vm02r1rvaypft" id="id-01fy95en8twt2vm02r1rvaypft"></a>

### **Deleting Databases and Database data** <a href="#id-01fy93fxytdywzyjxhrqy9kkgd" id="id-01fy93fxytdywzyjxhrqy9kkgd"></a>

At any point, you can choose to delete certain records in your database or the whole database.

#### &#x20; <a href="#id-01fy94za8fqyb9ybkhdxyvpda4" id="id-01fy94za8fqyb9ybkhdxyvpda4"></a>

#### Deleting records <a href="#id-01fy94z4z5nrtyt691n6ezp3sp" id="id-01fy94z4z5nrtyt691n6ezp3sp"></a>

To delete single data records:

1\. click on the *Edit* database option:

<figure><img src="/files/RuawAW3gbF0Ho3DVtS87" alt=""><figcaption></figcaption></figure>

2\. click on the options menu to the far right:

<figure><img src="/files/xcOkzqEjTynIrIeJL6b6" alt=""><figcaption></figcaption></figure>

3\. Edit or delete the desired row.

&#x20;

If you'd like to delete several records at once:

1\. select the records you wish to delete and click on *Delete Selected Rows*:<br>

<figure><img src="/files/gTn3dy2NjuhA27UlYdbw" alt=""><figcaption></figcaption></figure>

#### &#x20; <a href="#id-01fy954p0crgrb6jc7fx1sfhk1" id="id-01fy954p0crgrb6jc7fx1sfhk1"></a>

#### Deleting a database <a href="#id-01fy94za8ffthp0qz5ccsan34q" id="id-01fy94za8ffthp0qz5ccsan34q"></a>

To delete the entire database at once, click on the *Trash* icon to the far right:

<figure><img src="/files/Ti0Hjr4KfeZo1z9imECG" alt=""><figcaption></figcaption></figure>

### &#x20; <a href="#id-01fy95en8twe9z95zzb4q2fjqa" id="id-01fy95en8twe9z95zzb4q2fjqa"></a>

### **Data Retention Settings** <a href="#id-01fy9351zwzeap43hmpdm7zpvx" id="id-01fy9351zwzeap43hmpdm7zpvx"></a>

When creating your database, you can choose for how long the data in it will be stored. The available options are:

* 1 day
* 3 days
* 7 days
* 30 days
* 90 days
* 180 days
* and data *Never expires*

The data retention period you set at the beginning **can be modified** at a later point in time by:\
\
1\. clicking on the edit button on the far right of the database:

<figure><img src="/files/RuawAW3gbF0Ho3DVtS87" alt=""><figcaption></figcaption></figure>

2\. once you are in the edit database window, click on the edit button next to the name of the database:

<figure><img src="/files/W3vrg4iZUB5TmrccFF3S" alt=""><figcaption></figcaption></figure>

3\. and set the new desired data retention length.

&#x20;

### **Public API** <a href="#id-01fy95m5mxq5d0t6rz06gfsqzg" id="id-01fy95m5mxq5d0t6rz06gfsqzg"></a>

Aside from the steps in FlowBuilder, there are public API methods to interact with the databases. The methods can be used to set/retrieve values from external systems as well as to list all key/value pairs and can be found at the following [link](https://support.messagebird.com/hc/en-us/articles/4407200777105-Using-database-steps-in-Flow-Builder#h_01FFM4PXJGSS1FV6CV4D7X6KE5).

&#x20;

📤 Feel free to [contact our Support](https://support.messagebird.com/hc/en-us/requests/new) in case you might need some help!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/connectivity-platform/advanced-functionalities/using-databases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
