# Create New Data Set for User Creates a new data set of type and data set type for the user specified by the . Endpoint: POST /v1/users/{userId}/data_sets Version: 1.0 Security: sessionToken ## Path parameters: - `userId` (string, required) Tidepool User ID ## Request fields (application/json): - `client` (object) The client software that provided diabetes data. - `client.name` (string, required) Name in the [reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation). Example: "org.tidepool.uploader" - `client.version` (string, required) [Semantic Version Number 2.0.0](http://semver.org/). Regex from their [site](https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string). Example: "2.36.1" - `client.platform` (string) The software platform on which the client software was run. Example: "macOS 10.15.4" - `client.private` (object) - `dataSetType` (string, required) Enum: "continuous", "normal" - `deviceId` (string, required) Globally unique to device and repeatable with each upload, e.g. device make and model with serial number Example: "MMT-1711:12345678" - `deviceManufacturers` (array, required) An array of string tags indicating the manufacturer(s) of the device. In order to avoid confusion resulting from referring to a single manufacturer with more than one name—for example, using both 'Minimed' and 'Medtronic' interchangeably—we restrict the set of strings used to refer to manufacturers to the set listed above and enforce string matches (including casing). is an array of one or more string "tags" because there are devices resulting from a collaboration between more than one manufacturer, such as the Tandem G4 insulin pump with CGM integration (a collaboration between and ). Example: ["DeviceCo"] - `deviceModel` (string, required) A string identifying the model of the device. The is a non-empty string that encodes the model of device. We endeavor to match each manufacturer's standard for how they represent model name in terms of casing, whether parts of the name are represented as one word or two, etc. Example: "Devicey McDeviceface" - `deviceSerialNumber` (string, required) A string encoding the device's serial number. The is a string that encodes the serial number of the device. Note that even if a manufacturer only uses digits in its serial numbers, the SN should be stored as a string regardless. Uniquely of string fields in the Tidepool device data models, be an empty string. This is essentially a compromise: having the device serial number is extremely important (especially for e.g., clinical studies) but in 2016 we came across our first case where we recover the serial number of the device that generated the data: Dexcom G5 data uploaded to Tidepool through Apple iOS's HealthKit integration. Example: "B97B6D59" - `deviceTags` (array) An array of string tags indicating the function(s) of the device. The array should be fairly self-explanatory as an array of tags indicating the function(s) of a particular device. For example, the Insulet OmniPod insulin delivery system has the tags and since the PDM is both an insulin pump controller and includes a built-in blood glucose monitor. Enum: "bgm", "cgm", "insulin-pump", "fgm", "pen", "manual" - `deduplicator` (object) - `deduplicator.hash` (string) - `time` (string, required) [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information Example: "2017-02-06T02:37:46Z" - `timeProcessing` (string, required) A string indicating what variety of processing was used to create the and related fields such as on data in this upload. For data auditing purposes, we store a string encoding the type of algorithm used to generate the , , and other related fields from the local . At present, there are only three options for this value: - for data sources that already include a UTC-anchored value. At present, the data source for which this is true is Dexcom G5 or Dexcom G6 data coming through Apple's iOS HealthKit integration. - for devices (all BGMs, for example) that cannot have their values ["bootstrapped" to a UTC value](http://developer.tidepool.io/uploader/docs/BootstrappingToUTC.html); in such cases, we apply a single user-selected timezone to every "across the board" to generate the value. - for devices (most insulin pumps and CGMs) where we use a combination of the user-selected timezone at time of upload, the most recent timestamp on device, and the history of display time changes on the device to infer the correct value for each record. Enum: "none", "across-the-board-timezone", "utc-bootstrapping" - `timezone` (string, required) A string timezone name from the [IANA timezone database](https://www.iana.org/time-zones) Example: "Europe/London" - `timezoneOffset` (integer, required) Time zone offset, expressed as positive or negative number of minutes from UTC. Example: -420 ## Response 200 fields (application/json): - `annotations` (array) An array of annotations. - `byUser` (string) String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) - `client` (object) The client software that provided diabetes data. - `client.name` (string, required) Name in the [reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation). Example: "org.tidepool.uploader" - `client.version` (string, required) [Semantic Version Number 2.0.0](http://semver.org/). Regex from their [site](https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string). Example: "2.36.1" - `client.platform` (string) The software platform on which the client software was run. Example: "macOS 10.15.4" - `client.private` (object) - `clockDriftOffset` (integer) Clock drift offset, expressed as milliseconds. - `computerTime` (string) An ISO 8601 formatted timestamp without any timezone offset information. The field encodes the time at upload with no timezone offset information since we are storing separately. We store this field in order to be able to audit and/or detect the correspondence between the user's browser time and the timezone they selected at the time of upload. If the user selected the timezone that was actually in effect for their browser at the time of upload, then applying the stored to the UTC Zulu field will match . If, on the other hand, the user selected a timezone from that effective in their browser at the time of upload, applying the to will match . There are some use cases when it is perfectly justified to select a timezone that does reflect the browser's current timezone. For example, some insulin pump users do not change the time on their devices when traveling for short periods of time across many timezones, but when uploading a device a user should always choose the timezone that aligns with the most recent data on the device and thus that will match the local browser timezone. - `conversionOffset` (integer) Conversion offset, expressed as milliseconds. - `createdTime` (string) [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information Example: "2017-02-06T02:37:46Z" - `createdUserId` (string) String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) - `dataSetType` (string) Enum: "continuous", "normal" - `deduplicator` (object) - `deduplicator.hash` (string) - `deletedTime` (string) [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information Example: "2017-02-06T02:37:46Z" - `deletedUserId` (string) String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) - `deviceId` (string) Globally unique to device and repeatable with each upload, e.g. device make and model with serial number Example: "MMT-1711:12345678" - `deviceManufacturers` (array) An array of string tags indicating the manufacturer(s) of the device. In order to avoid confusion resulting from referring to a single manufacturer with more than one name—for example, using both 'Minimed' and 'Medtronic' interchangeably—we restrict the set of strings used to refer to manufacturers to the set listed above and enforce string matches (including casing). is an array of one or more string "tags" because there are devices resulting from a collaboration between more than one manufacturer, such as the Tandem G4 insulin pump with CGM integration (a collaboration between and ). Example: ["DeviceCo"] - `deviceModel` (string) A string identifying the model of the device. The is a non-empty string that encodes the model of device. We endeavor to match each manufacturer's standard for how they represent model name in terms of casing, whether parts of the name are represented as one word or two, etc. Example: "Devicey McDeviceface" - `deviceSerialNumber` (string) A string encoding the device's serial number. The is a string that encodes the serial number of the device. Note that even if a manufacturer only uses digits in its serial numbers, the SN should be stored as a string regardless. Uniquely of string fields in the Tidepool device data models, be an empty string. This is essentially a compromise: having the device serial number is extremely important (especially for e.g., clinical studies) but in 2016 we came across our first case where we recover the serial number of the device that generated the data: Dexcom G5 data uploaded to Tidepool through Apple iOS's HealthKit integration. Example: "B97B6D59" - `deviceTags` (array) An array of string tags indicating the function(s) of the device. The array should be fairly self-explanatory as an array of tags indicating the function(s) of a particular device. For example, the Insulet OmniPod insulin delivery system has the tags and since the PDM is both an insulin pump controller and includes a built-in blood glucose monitor. Enum: "bgm", "cgm", "insulin-pump", "fgm", "pen", "manual" - `deviceTime` (string) [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _without_ timezone information Example: "2017-02-06T02:37:46" - `id` (string) Example: "ce8cc5f7595575945f91fc6710db6fef" - `modifiedTime` (string) [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information Example: "2017-02-06T02:37:46Z" - `modifiedUserId` (string) String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) - `payload` (object) Grab bag field for data that isn't yet part of the data model. The maximum size is 4K bytes. - `source` (string) - `time` (string) [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information Example: "2017-02-06T02:37:46Z" - `timeProcessing` (string) A string indicating what variety of processing was used to create the and related fields such as on data in this upload. For data auditing purposes, we store a string encoding the type of algorithm used to generate the , , and other related fields from the local . At present, there are only three options for this value: - for data sources that already include a UTC-anchored value. At present, the data source for which this is true is Dexcom G5 or Dexcom G6 data coming through Apple's iOS HealthKit integration. - for devices (all BGMs, for example) that cannot have their values ["bootstrapped" to a UTC value](http://developer.tidepool.io/uploader/docs/BootstrappingToUTC.html); in such cases, we apply a single user-selected timezone to every "across the board" to generate the value. - for devices (most insulin pumps and CGMs) where we use a combination of the user-selected timezone at time of upload, the most recent timestamp on device, and the history of display time changes on the device to infer the correct value for each record. Enum: "none", "across-the-board-timezone", "utc-bootstrapping" - `timezone` (string) A string timezone name from the [IANA timezone database](https://www.iana.org/time-zones) Example: "Europe/London" - `timezoneOffset` (integer) Time zone offset, expressed as positive or negative number of minutes from UTC. Example: -420 - `type` (string) Enum: "upload" - `uploadId` (string) An upload identifier; this field should be the uploadId of the corresponding upload record Example: "0d92d5c1c22117a18f3620b9e24d3c06" - `guid` (string) A string ID. Added to each event during data processing in the Tidepool Uploader or upon ingestion by the platform data ingestion service. ## Response 400 fields (application/json): - `code` (integer, required) Example: 404 - `message` (string, required) Example: "Requested resources was not found" ## Response 401 fields (application/json): - `code` (integer, required) Example: 404 - `message` (string, required) Example: "Requested resources was not found" ## Response 403 fields (application/json): - `code` (integer, required) Example: 404 - `message` (string, required) Example: "Requested resources was not found" ## Response 404 fields (application/json): - `code` (integer, required) Example: 404 - `message` (string, required) Example: "Requested resources was not found"