# Data

The following endpoints allow you to create and manage records in data stores.

## List data store records

> Retrieves a collection of all records from a data store with a given ID. Each returned record consists of the \`key\` (custom or automatically generated) and \`data\`.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores / Data","description":"The following endpoints allow you to create and manage records in 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/{dataStoreId}/data":{"get":{"tags":["Data stores / Data"],"summary":"List data store records","description":"Retrieves a collection of all records from a data store with a given ID. Each returned record consists of the `key` (custom or automatically generated) and `data`.","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":"pg[limit]","in":"query","schema":{"type":"integer"},"description":"The maximum number of entities you want to get in the response."},{"name":"pg[offset]","in":"query","schema":{"type":"integer"},"description":"The number of entities you want to skip before getting entities you want."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The unique key of the data store record. If no key is provided, it will be automatically generated."},"data":{"type":"object","description":"The data of the data store record. The structure strictly depends on the included data structure. If no data is provided, in response the values will be set to null."}}}},"spec":{"type":"array","items":{"type":"object"}},"strict":{"type":"boolean"},"count":{"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 record

> Creates a new record in a data store with a given ID and returns all record details.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores / Data","description":"The following endpoints allow you to create and manage records in 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}/data":{"post":{"tags":["Data stores / Data"],"summary":"Create data store record","description":"Creates a new record in a data store with a given ID and returns all record details.","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."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"The unique key of the data store record. If no key is provided, it will be automatically generated."},"data":{"type":"object","description":"The data of the data store record. The structure strictly depends on the included data structure. If no data is provided, in response the values will be set to null."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"The unique key of the data store record. If no key is provided, it will be automatically generated."},"data":{"type":"object","description":"The data of the data store record. The structure strictly depends on the included data structure. If no data is provided, in response the values will be set to null."}}}}}}}}}}}
```

## Delete data store records

> Deletes records from the specified data store.\
> \
> Specify the \`keys\` of the records you want to delete in the \`keys\` array in the request body.\
> \
> Use the \`all\` parameter in the request body to delete all records from the data store. You have to add the \`confirmed\` parameter in the API call query to confirm deleting the data, otherwise you get an error.\
> \
> When you are deleting all records, you can use the \`exceptKeys\` parameter to specify keys of the records which you want to keep.\
> \
> The response contains keys of the deleted records.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores / Data","description":"The following endpoints allow you to create and manage records in 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}/data":{"delete":{"tags":["Data stores / Data"],"summary":"Delete data store records","description":"Deletes records from the specified data store.\n\nSpecify the `keys` of the records you want to delete in the `keys` array in the request body.\n\nUse the `all` parameter in the request body to delete all records from the data store. You have to add the `confirmed` parameter in the API call query to confirm deleting the data, otherwise you get an error.\n\nWhen you are deleting all records, you can use the `exceptKeys` parameter to specify keys of the records which you want to keep.\n\nThe response contains keys of the deleted records.","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":"confirmed","in":"query","schema":{"type":"boolean"},"description":"Set to `true` to confirm deleting of the data store records. Otherwise, you get an error and Make won't delete the data store records."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","description":"The keys of data store records you want to delete. Use the `all` and `confirmed` parameters if you want to delete all records in the data store.","items":{"type":"string"}},"all":{"type":"boolean","description":"Set to `true` to delete all records in the data store. Use the `confirmed` parameter to confirm the deletion. You can also use the `exceptKeys` parameter to specify keys of the records that you want to keep in the data store."},"exceptKeys":{"type":"array","description":"Specify the keys of the data store records you want to keep when deleting all records from the data store.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}}}}}}}}}}}}
```

## Update entire data store record

> Updates a data store record with a given key by passing new data in the request body. It replaces the entire resource with the new values. In the response, this endpoint returns all details of the updated data.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores / Data","description":"The following endpoints allow you to create and manage records in 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}/data/{dataStoreKeyRecord}":{"put":{"tags":["Data stores / Data"],"summary":"Update entire data store record","description":"Updates a data store record with a given key by passing new data in the request body. It replaces the entire resource with the new values. In the response, this endpoint returns all details of the updated data.","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":"dataStoreKeyRecord","in":"path","schema":{"type":"string"},"required":true,"description":"The key of the data store record. It can be retrieved from the [List data store records](/api-reference/data-stores/data/get--data-stores--datastoreid--data.md) endpoint."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The data is different for each data store so there are no predefined body properties to use. Please see the request example for more details."}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"The unique key of the data store record. If no key is provided, it will be automatically generated."},"data":{"type":"object","description":"The data of the data store record. The structure strictly depends on the included data structure. If no data is provided, in response the values will be set to null."}}}}}}}}}}}
```

## Update data store record details

> Updates a data store record with a given key by passing new data in the request body. Any property that is not provided will be left unchanged. In the response, it returns all details of the updated data including properties that were not changed.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Data stores / Data","description":"The following endpoints allow you to create and manage records in 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}/data/{dataStoreKeyRecord}":{"patch":{"tags":["Data stores / Data"],"summary":"Update data store record details","description":"Updates a data store record with a given key by passing new data in the request body. Any property that is not provided will be left unchanged. In the response, it returns all details of the updated data including properties that were not changed.","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":"dataStoreKeyRecord","in":"path","schema":{"type":"string"},"required":true,"description":"The key of the data store record. It can be retrieved from the [List data store records](/api-reference/data-stores/data/get--data-stores--datastoreid--data.md) endpoint."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The data is different for each data store so there are no predefined body properties to use. Please see the request example for more details."}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"The unique key of the data store record. If no key is provided, it will be automatically generated."},"data":{"type":"object","description":"The data of the data store record. The structure strictly depends on the included data structure. If no data is provided, in response the values will be set to null."}}}}}}}}}}}
```
