> ## Documentation Index
> Fetch the complete documentation index at: https://docs.junction.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Water

> [card] [View Full Response Schema »](https://api.tryvital.io/redoc#tag/timeseries/operation/get_water_grouped)
>
> The Response section on the page still needs work. Click here to check out the complete schema.

```bash cURL theme={null}
curl --request GET \
     --url {{BASE_URL}}/v2/timeseries/{user_id}/water/grouped?start_date={{START_DATE}}&end_date={{END_DATE}} \
     --header 'Accept: application/json' \
     --header 'x-vital-api-key: <API_KEY>'
```

```python Python theme={null}
from vital.client import Vital
from vital.environment import VitalEnvironment

client = Vital(
  api_key="YOUR_API_KEY",
  environment=VitalEnvironment.SANDBOX
)

data = client.vitals.water_grouped(
  user_id="<user_id>", 
  start_date="2021-10-01", 
  end_date="2021-10-02"
)
```

```javascript Node theme={null}
import { VitalClient, VitalEnvironment } from '@tryvital/vital-node';
import { VitalsWaterGroupedRequest } from '@tryvital/vital-node/api/resources/vitals';

const client = new VitalClient({
    apiKey: '<my_api_key>',
    environment: VitalEnvironment.Sandbox,
});

const request: VitalsWaterGroupedRequest = {
    startDate: "2022-05-01",
    endDate: "2022-06-01"
}

const data = await client.vitals.waterGrouped(
    '<my_user_id>',
    request
);
```

```java Java theme={null}
import com.vital.api.Vital;
import com.vital.api.core.Environment;
import com.vital.api.resources.vitals.requests.VitalsWaterGroupedRequest;

Vital vital = Vital.builder()
        .apiKey("YOUR_API_KEY")
        .environment(Environment.SANDBOX)
        .build();

VitalsWaterGroupedRequest request = VitalsWaterGroupedRequest.builder()
        .startDate("2022-05-01")
        .endDate("2022-06-01")
        .build();

var data = vital.vitals().waterGrouped("<user_id>", request);
```

```go Go theme={null}
import (
  "context"

  vital "github.com/tryVital/vital-go"
  vitalclient "github.com/tryVital/vital-go/client"
)

client := vitalclient.NewClient(
  vitalclient.WithApiKey("<YOUR_API_KEY>"),
  vitalclient.WithBaseURL(vital.Environments.Sandbox),
)

EndDate := "2022-06-01"
request := &vital.VitalsWaterGroupedRequest{
  StartDate: "2022-05-01",
  EndDate:   &EndDate,
}

response, err := client.Vitals.WaterGrouped(context.TODO(), "*", request)
if err != nil {
  return err
}
fmt.Printf("Received data %s\n", response)
```

```json Example theme={null}
{
  "groups": {
    "oura": [
      {
        "data": [
          {
            "end": "2023-02-13T14:57:24+00:00",
            "start": "2023-02-13T14:30:52+00:00",
            "unit": "ml",
            "value": 400
          }
        ],
        "source": {
          "provider": "oura",
          "type": "ring"
        }
      }
    ]
  }
}
```


## OpenAPI

````yaml GET /v2/timeseries/{user_id}/water/grouped
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.5.47
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v2/timeseries/{user_id}/water/grouped:
    get:
      tags:
        - timeseries
      summary: Water
      operationId: get_water_grouped
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: >-
              User id returned by vital create user id request. This id should
              be stored in your database against the user and used for all
              interactions with the vital api.
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The cursor for fetching the next page, or `null` to fetch the
              first page.
            deprecated: true
            title: Cursor
          description: >-
            The cursor for fetching the next page, or `null` to fetch the first
            page.
          deprecated: true
        - name: next_cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Next Cursor
            description: >-
              The cursor for fetching the next page, or `null` to fetch the
              first page.
          description: >-
            The cursor for fetching the next page, or `null` to fetch the first
            page.
        - name: provider
          in: query
          required: false
          schema:
            type: string
            description: Provider oura/strava etc
            default: ''
            title: Provider
          description: Provider oura/strava etc
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            description: >-
              Date from in YYYY-MM-DD or ISO formatted date time. If a date is
              provided without a time, the time will be set to 00:00:00
            title: Start Date
          description: >-
            Date from in YYYY-MM-DD or ISO formatted date time. If a date is
            provided without a time, the time will be set to 00:00:00
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Date to YYYY-MM-DD or ISO formatted date time. If a date is
              provided without a time, the time will be set to 23:59:59
            title: End Date
          description: >-
            Date to YYYY-MM-DD or ISO formatted date time. If a date is provided
            without a time, the time will be set to 23:59:59
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupedWaterResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GroupedWaterResponse:
      properties:
        groups:
          additionalProperties:
            items:
              $ref: '#/components/schemas/GroupedWater'
            type: array
          type: object
          title: Groups
          description: >-
            For each matching provider or lab, a list of grouped timeseries
            values.
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
          description: >-
            The cursor for fetching the next page, or `null` if there is no more
            data.
          deprecated: true
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            The cursor for fetching the next page, or `null` if there is no more
            data.
      type: object
      required:
        - groups
      title: GroupedWaterResponse
      example:
        groups:
          oura:
            - data:
                - end: '2023-02-13T14:57:24+00:00'
                  start: '2023-02-13T14:30:52+00:00'
                  unit: ml
                  value: 400
              source:
                provider: oura
                type: ring
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    GroupedWater:
      properties:
        source:
          $ref: '#/components/schemas/ClientFacingSource'
        data:
          items:
            $ref: '#/components/schemas/ClientFacingWaterTimeseries'
          type: array
      type: object
      required:
        - source
        - data
      title: GroupedWater
    ClientFacingSource:
      properties:
        provider:
          type: string
          title: Provider
          description: Provider slug. e.g., `oura`, `fitbit`, `garmin`.
        type:
          type: string
          title: Type
          description: >-
            The type of the data source (app or device) by which the summary or
            the timeseries data were recorded. This defaults to `unknown` when
            Vital cannot extract or infer that information
          default: unknown
        app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: App Id
          description: >-
            The identifier of the app which recorded this summary. This is only
            applicable to multi-source providers like Apple Health and Android
            Health Connect.
        device_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Device Id
          description: The identifier of the device which recorded this summary.
        sport:
          anyOf:
            - type: string
            - type: 'null'
          title: Sport
          description: >

            For workout stream timeseries, this is the standard sport slug of
            the workout with which the timeseries data are associated.


            For the `distance` timeseries, this is `wheelchair_pushing` if the
            user is a wheelchair user, or `null` otherwise.


            For all summary types and non-workout timeseries, this is always
            `null`.
        workout_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Workout Id
          description: >

            For workout stream timeseries, this is the workout ID with which the
            timeseries data are associated.


            For all other types, this is always `null`.
      type: object
      required:
        - provider
      title: Source
      description: |-
        Source summarizes where a sample or a summary is sourced from.
        At minimum, the source provider is always included.
      example:
        provider: oura
        type: ring
    ClientFacingWaterTimeseries:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: Deprecated
        timezone_offset:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timezone Offset
          description: >-
            Time zone UTC offset in seconds. Positive offset indicates east of
            UTC; negative offset indicates west of UTC; and null indicates the
            time zone information is unavailable at source.
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: Type is always null for this resource.
        unit:
          type: string
          title: Unit
          description: Measured in milliters.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the measurement.
        value:
          type: number
          title: Value
          description: Quantity of water drank during the time period.
      type: object
      required:
        - unit
        - timestamp
        - value
      title: ClientFacingWaterTimeseries
      example:
        end: '2023-02-13T14:57:24+00:00'
        start: '2023-02-13T14:30:52+00:00'
        unit: ml
        value: 400
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````

## Related topics

- [daily.data.water.created](https://docs.junction.com/event-catalog/daily.data.water.created.md)
- [daily.data.water.updated](https://docs.junction.com/event-catalog/daily.data.water.updated.md)
- [historical.data.water.created](https://docs.junction.com/event-catalog/historical.data.water.created.md)
- [Providers and Resources](https://docs.junction.com/changelog/wearables/providers.md)
- [Column expressions](https://docs.junction.com/sense/query-dsl/column-expressions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.