# Data stores

Data stores are used to store data from scenarios or for transferring data in between individual scenarios or scenario runs. The following endpoints allow you to create and manage data stores.

## List data stores

> Retrieves a collection of all data stores for a team with a given ID. Returned data stores are sorted by name in ascending order.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores","description":"Data stores are used to store data from scenarios or for transferring data in between individual scenarios or scenario runs. The following endpoints allow you to create and manage data stores."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["datastores:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/data-stores":{"get":{"tags":["Data stores"],"summary":"List data stores","description":"Retrieves a collection of all data stores for a team with a given ID. Returned data stores are sorted by name in ascending order.","parameters":[{"required":true,"description":"The unique ID of the team whose data stores will be retrieved.","name":"teamId","in":"query","schema":{"type":"integer"}},{"name":"cols[]","in":"query","schema":{"type":"array","items":{"type":"string","enum":["id","name","teamId","records","size","maxSize","datastructureId"]}},"description":"Specifies the group of values to return. For example, you can retrieve only names and IDs of data stores for a team with a given ID."},{"name":"pg[sortBy]","in":"query","schema":{"type":"string","enum":["name"]},"description":"The value that will be used to sort returned entities by."},{"name":"pg[offset]","in":"query","schema":{"type":"integer"},"description":"The number of entities you want to skip before getting entities you want."},{"name":"pg[sortDir]","in":"query","schema":{"type":"string","enum":["asc","desc"]},"description":"The sorting order. It accepts the ascending and descending direction specifiers."},{"name":"pg[limit]","in":"query","schema":{"type":"integer"},"description":"The maximum number of entities you want to get in the response."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dataStores":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"records":{"type":"integer"},"size":{"type":"string"},"maxSize":{"type":"string"},"teamId":{"type":"integer"},"datastructureId":{"type":"integer"}}}},"pg":{"type":"object","properties":{"last":{"type":"string","description":"Shown only when using the `last` based pagination."},"showLast":{"type":"boolean","description":"Shown only when using the `last` based pagination."},"sortBy":{"type":"string"},"sortDir":{"type":"string"},"limit":{"type":"integer"},"offset":{"type":"integer","description":"Shown only when using the `offset` based pagination."}}}}}}}}}}}}}
```

## Create data store

> Creates a new data store with data passed in the request body. In the response, it returns all details of the created data store.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores","description":"Data stores are used to store data from scenarios or for transferring data in between individual scenarios or scenario runs. The following endpoints allow you to create and manage data stores."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["datastores:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/data-stores":{"post":{"tags":["Data stores"],"summary":"Create data store","description":"Creates a new data store with data passed in the request body. In the response, it returns all details of the created data store.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The data store name. The name must be at most 128 characters long and does not need to be unique."},"teamId":{"type":"integer","description":"The unique ID of the team in which the data store will be created."},"datastructureId":{"type":"integer","description":"The unique ID of the data structure that will be included in the data store. All data structures IDs for a given team can be retrieved from the [List data structures](/api-reference/data-structures/get--data-structures.md) endpoint."},"maxSizeMB":{"type":"integer","description":"The maximum size of the data store (defined in MB)."}},"required":["name","teamId","datastructureId","maxSizeMB"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dataStore":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"records":{"type":"integer"},"size":{"type":"string"},"maxSize":{"type":"string"},"teamId":{"type":"integer"},"datastructureId":{"type":"integer"}}}}}}}}}}}}}
```

## Delete data stores

> Deletes data stores with given IDs and returns their IDs in the response. This endpoint allows deleting one or more data stores at once.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores","description":"Data stores are used to store data from scenarios or for transferring data in between individual scenarios or scenario runs. The following endpoints allow you to create and manage data stores."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["datastores:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/data-stores":{"delete":{"tags":["Data stores"],"summary":"Delete data stores","description":"Deletes data stores with given IDs and returns their IDs in the response. This endpoint allows deleting one or more data stores at once.","parameters":[{"description":"Confirms the deletion if a data store is included in at least one scenario. Confirmation is required because the scenario will stop working without the data store. If the parameter is missing or it is set to `false` an error code is returned and the resource is not deleted.","name":"confirmed","in":"query","schema":{"type":"boolean"}},{"description":"The unique ID of the team from which the data store will be deleted.","name":"teamId","in":"query","schema":{"type":"integer"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"ids":{"type":"array","description":"The IDs of data stores to delete. You can either use only this parameter alone or use the `all` parameter, or the `all` parameter together with the `exceptIds` parameter.","items":{"type":"integer"}}},"required":["ids"]},{"type":"object","properties":{"exceptIds":{"type":"array","description":"The IDs of data stores to be excluded from deleting. It can be only used together with the `all` parameter set to `true`.","items":{"type":"integer"}},"all":{"type":"boolean","description":"If set to `true`, all data stores will be deleted. It can be used alone or together with the `exceptIds` parameter."}},"required":["all"]}]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dataStores":{"type":"array","items":{"type":"integer"}}}}}}}}}}}}
```

## Get data store details

> Retrieves details of a data store with a given ID.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores","description":"Data stores are used to store data from scenarios or for transferring data in between individual scenarios or scenario runs. The following endpoints allow you to create and manage data stores."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["organization:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/data-stores/{dataStoreId}":{"get":{"tags":["Data stores"],"summary":"Get data store details","description":"Retrieves details of a data store with a given ID.","parameters":[{"name":"dataStoreId","in":"path","schema":{"type":"integer"},"required":true,"description":"The ID of the data store. Get the `dataStoreId` from the [List data stores](/api-reference/data-stores/get--data-stores.md) endpoint."},{"name":"cols[]","in":"query","schema":{"type":"array","items":{"type":"string","enum":["id","name","teamId","records","size","maxSize","datastructureId"]}},"description":"Specifies the group of values to return. For example, you can retrieve only names and IDs of data stores for a team with a given ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dataStore":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"records":{"type":"integer"},"size":{"type":"string"},"maxSize":{"type":"string"},"teamId":{"type":"integer"},"datastructureId":{"type":"integer"}}}}}}}}}}}}}
```

## Update data store

> Updates properties of a data store with a given ID in a team with a given ID by passing new values in the request body. In the response, it returns all details of the updated data store including properties that were not changed. Any property that is not provided will be left unchanged. This endpoint cannot be used to update data included in the data store - for this use the \[endpoints for managing data stores data]\(./data/get--data-stores--datastoreid--data.md).

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores","description":"Data stores are used to store data from scenarios or for transferring data in between individual scenarios or scenario runs. The following endpoints allow you to create and manage data stores."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["datastores:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/data-stores/{dataStoreId}":{"patch":{"tags":["Data stores"],"summary":"Update data store","description":"Updates properties of a data store with a given ID in a team with a given ID by passing new values in the request body. In the response, it returns all details of the updated data store including properties that were not changed. Any property that is not provided will be left unchanged. This endpoint cannot be used to update data included in the data store - for this use the [endpoints for managing data stores data](./data/get--data-stores--datastoreid--data.md).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The data store name. The name must be at most 128 characters long and does not need to be unique."},"datastructureId":{"type":"integer","description":"The unique ID of the data structure included in the data store. All data structures IDs for a given team can be retrieved from the [List data structures](/api-reference/data-structures/get--data-structures.md) endpoint."},"maxSizeMB":{"type":"integer","description":"The maximum size of the data store (defined in MB)."}}}}}},"parameters":[{"name":"dataStoreId","in":"path","schema":{"type":"integer"},"required":true,"description":"The ID of the data store. Get the `dataStoreId` from the [List data stores](/api-reference/data-stores/get--data-stores.md) endpoint."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dataStore":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"records":{"type":"integer"},"size":{"type":"string"},"maxSize":{"type":"string"},"teamId":{"type":"integer"},"datastructureId":{"type":"integer"}}}}}}}}}}}}}
```
