# Data API The Tidepool API is an HTTP REST API used by Tidepool clients use to communicate with the Tidepool Platform. For more information, see the [Getting Started](../docs/quick-start.md) section. Version: 1.0 License: BSD-2-Clause ## Servers integration ``` https://external.integration.tidepool.org ``` production ``` https://api.tidepool.org ``` dev1 ``` https://dev1.dev.tidepool.org ``` qa1 ``` https://qa1.development.tidepool.org ``` qa2 ``` https://qa2.development.tidepool.org ``` ## Security ### sessionToken Tidepool Session Token Type: apiKey In: header Name: X-Tidepool-Session-Token ### serverToken Tidepool Server Token Type: apiKey In: header Name: X-Tidepool-Session-Token ## Download OpenAPI description [Data API](https://tidepool.redocly.app/_spec/reference/data.v1.yaml) ## Data Manages diabetes data in user's Tidepool account. ### Create New Data Source for User - [POST /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/internal/createdatasource.md): Creates a new data source for the user specified by the . Before creating a new data source, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete All Data Sources for User - [DELETE /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/internal/deletealldatasources.md): Deletes all data sources for the user specified by the . This does delete the corresponding data provider sessions. See the Authentication APIs for the details on how to delete data provider sessions. ### Update Data Source - [PUT /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/internal/updatedatasource.md): Updates the data source specified by the . If you want to change the data provider session, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete Data Source - [DELETE /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/internal/deletedatasource.md): Deletes data source specified by the . This does delete the corresponding data provider session. See the Authentication APIs for the details on how to delete data provider sessions. ### Upload Data (LEGACY) (deprecated) - [POST /data/{userId}](https://tidepool.redocly.app/reference/data.v1/internal/uploaddata.md): Upload data for the specified . The session token must be for , or identify a user who has the permission to the account specified by the . ### Delete All Data for User - [DELETE /v1/users/{userId}/data](https://tidepool.redocly.app/reference/data.v1/data/deletealluserdata.md): Delete all data for user specified by the . ### Get Data Sets for User - [GET /v1/users/{userId}/datasets](https://tidepool.redocly.app/reference/data.v1/data/getuserdatasets.md): Gets data sets for the user account specified by the . ### Create New Data Set for User - [POST /v1/users/{userId}/datasets](https://tidepool.redocly.app/reference/data.v1/data/createdataset.md): Creates a new data set of type and data set type for the user specified by the . ### List Data Sets for User - [GET /v1/users/{userId}/data_sets](https://tidepool.redocly.app/reference/data.v1/data/listdatasets.md): Returns a list of data sets for the user specified by the . ### Create New Data Set for User - [POST /v1/users/{userId}/data_sets](https://tidepool.redocly.app/reference/data.v1/data/createdataset2.md): Creates a new data set of type and data set type for the user specified by the . ### Update Data Set - [PUT /v1/datasets/{dataSetId}](https://tidepool.redocly.app/reference/data.v1/data/updatedataset.md): Updates the data set specified by the . ### Delete Data Set - [DELETE /v1/datasets/{dataSetId}](https://tidepool.redocly.app/reference/data.v1/data/deletedataset.md): Deletes the data set specified by the . ### Get Data Set - [GET /v1/data_sets/{dataSetId}](https://tidepool.redocly.app/reference/data.v1/data/getdataset.md): Returns the data set specified by the . ### Update Data Set - [PUT /v1/data_sets/{dataSetId}](https://tidepool.redocly.app/reference/data.v1/data/updatedataset2.md): Updates the data set specified by the . ### Delete Data Set - [DELETE /v1/data_sets/{dataSetId}](https://tidepool.redocly.app/reference/data.v1/data/deletedataset2.md): Deletes an entire dataset specified by the . ### Upload Data to Data Set - [POST /v1/datasets/{dataSetId}/data](https://tidepool.redocly.app/reference/data.v1/data/uploaddatatodataset.md): Uploads data to a user's data set identified by the . ### Upload Data to Data Set - [POST /v1/data_sets/{dataSetId}/data](https://tidepool.redocly.app/reference/data.v1/data/uploaddatatodataset2.md): Uploads data to a user's data set identified by the . ### Delete Data from Data Set - [DELETE /v1/data_sets/{dataSetId}/data](https://tidepool.redocly.app/reference/data.v1/data/deletedatasetdata.md): Deletes data from data set specified by the . ### Get Data for User - [GET /data/{userId}](https://tidepool.redocly.app/reference/data.v1/data/getdata.md): Get data for the specified . You can filter the data to pull with several query parameters. ### List Data Sources for User - [GET /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/data/listdatasources.md): Returns a list of data sources for the user specified by the . ### Create New Data Source for User - [POST /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/data/createdatasource.md): Creates a new data source for the user specified by the . Before creating a new data source, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete All Data Sources for User - [DELETE /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/data/deletealldatasources.md): Deletes all data sources for the user specified by the . This does delete the corresponding data provider sessions. See the Authentication APIs for the details on how to delete data provider sessions. ### Get Data Source - [GET /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/data/getdatasource.md): Returns the data source specified by the . ### Update Data Source - [PUT /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/data/updatedatasource.md): Updates the data source specified by the . If you want to change the data provider session, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete Data Source - [DELETE /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/data/deletedatasource.md): Deletes data source specified by the . This does delete the corresponding data provider session. See the Authentication APIs for the details on how to delete data provider sessions. ### Upload Data (LEGACY) (deprecated) - [POST /data/{userId}](https://tidepool.redocly.app/reference/data.v1/data/uploaddata.md): Upload data for the specified . The session token must be for , or identify a user who has the permission to the account specified by the . ## Internal APIs intended for internal use by Tidepool. ### Create New Data Source for User - [POST /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/internal/createdatasource.md): Creates a new data source for the user specified by the . Before creating a new data source, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete All Data Sources for User - [DELETE /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/internal/deletealldatasources.md): Deletes all data sources for the user specified by the . This does delete the corresponding data provider sessions. See the Authentication APIs for the details on how to delete data provider sessions. ### Update Data Source - [PUT /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/internal/updatedatasource.md): Updates the data source specified by the . If you want to change the data provider session, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete Data Source - [DELETE /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/internal/deletedatasource.md): Deletes data source specified by the . This does delete the corresponding data provider session. See the Authentication APIs for the details on how to delete data provider sessions. ### Upload Data (LEGACY) (deprecated) - [POST /data/{userId}](https://tidepool.redocly.app/reference/data.v1/internal/uploaddata.md): Upload data for the specified . The session token must be for , or identify a user who has the permission to the account specified by the . ### Create New Data Source for User - [POST /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/data/createdatasource.md): Creates a new data source for the user specified by the . Before creating a new data source, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete All Data Sources for User - [DELETE /v1/users/{userId}/data_sources](https://tidepool.redocly.app/reference/data.v1/data/deletealldatasources.md): Deletes all data sources for the user specified by the . This does delete the corresponding data provider sessions. See the Authentication APIs for the details on how to delete data provider sessions. ### Update Data Source - [PUT /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/data/updatedatasource.md): Updates the data source specified by the . If you want to change the data provider session, you must first create the data provider session. See the Authentication APIs for the details on how to create data provider sessions. ### Delete Data Source - [DELETE /v1/data_sources/{dataSourceId}](https://tidepool.redocly.app/reference/data.v1/data/deletedatasource.md): Deletes data source specified by the . This does delete the corresponding data provider session. See the Authentication APIs for the details on how to delete data provider sessions. ### Upload Data (LEGACY) (deprecated) - [POST /data/{userId}](https://tidepool.redocly.app/reference/data.v1/data/uploaddata.md): Upload data for the specified . The session token must be for , or identify a user who has the permission to the account specified by the .