# Create storage

{% hint style="warning" %}
In dev contact please avoid to create multiple Storage with 10000 lines maximum
{% endhint %}

API Reference: <https://openapi.sirdata.io/customer/#tag/storage/paths/~1customer~1storage/post>

A Storage can be created using an multipart POST

```javascript
const form = new FormData();
form.append("name", "my first storage");
form.append("content_type", "text/csv");
// csv separator
form.append("csv_separator", ",");
// column name inside the file
form.append("csv_column_names", "[\"SHA256\",\"POSTAL_CODE\"]");
form.append("file", "/path/to/file");
// indicate if csv contains a header to remove
form.append("csv_has_header", "1");
// indicate column position containing the hash (position start at 1, index at 0)
form.append("csv_mapping_column_position", "1");

fetch("https://gateway.sirdata.io/api/v1/public/customer/storage?=", {
  "method": "POST",
  "headers": {
    "x-api-token": "XXXXX-XXXXX-XXXXX-XXXXX",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

Check the status code, if 200 then it's ok.\
Now you must iterate on Storage to obtains the loading status until you got OK or ERROR.

Get Storage data (and status) <https://openapi.sirdata.io/customer/#tag/storage/paths/~1customer~1storage~1{id}/get>\
If status is OK you will have some important information on your storage.\
For example in table\_intersect.segment.distinct\_mapping\_column\_values you can see the unique hash count Sirdata has data on.\
\
When this part is done you'll be able to create a Filter, allowing you to get statistics on selected segments for your Storage, keep Storage id.


---

# 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.sirdata.net/customer-api/create-storage.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.
