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

# Get logs for a habit

> Retrieve a paginated list of log entries for a specific habit, optionally filtered by an inclusive date range. Logs are ordered from newest to oldest.



## OpenAPI

````yaml https://static.habitify.me/habitify_apidocsv2_261026.json get /habits/{habitId}/logs
openapi: 3.1.1
info:
  title: Habitify API v2
  description: >
    Welcome to our REST API. Use it to programmatically access your habit
    tracking data, build integrations, and automate workflows.


    ## Authentication

    All endpoints require authentication using an API key passed in the
    `X-API-Key` header.


    To generate your API key, open our app and go to **Settings > API**. Only
    one API key can be active at a time — generating a new key automatically
    revokes the previous one.


    > **Note:** API access requires a paid subscription and is not available on
    the free plan.


    ### Example Request

    ```

    curl -X GET https://api.habitify.me/v2/habits \
      -H "X-API-Key: YOUR_API_KEY"
    ```


    ## Rate Limiting

    We enforce a rate limit of **500 requests per minute** per account. If you
    exceed this limit, we will respond with a `429 Too Many Requests` status
    code. Wait for the rate limit window to reset before making additional
    requests.


    ## Versioning

    This is version 2 of our API. All endpoints are prefixed with `/v2`.
  version: 2.0.0
  contact:
    name: Habitify API Support
    url: https://habitify.me
  license:
    name: Proprietary
    url: https://habitify.me/terms
servers:
  - url: https://api.habitify.me/v2
    description: Production server
security:
  - ApiKeyTokenAuth: []
  - AccessTokenAuth: []
  - IdTokenAuth: []
tags:
  - name: Habits
    description: Manage your habits — create, update, archive, and delete them
    x-scalar-order:
      - habitify-api-v2/tag/habits/GET/habits
      - habitify-api-v2/tag/habits/POST/habits
      - habitify-api-v2/tag/habits/GET/habits/journal
      - habitify-api-v2/tag/habits/GET/habits/{habitId}
      - habitify-api-v2/tag/habits/PUT/habits/{habitId}
      - habitify-api-v2/tag/habits/DELETE/habits/{habitId}
      - habitify-api-v2/tag/habits/POST/habits/{habitId}/archive
      - habitify-api-v2/tag/habits/GET/habits/{habitId}/statistics
  - name: Habit Logs
    description: >-
      Track your progress by logging completions, failures, skips, and measured
      values
    x-scalar-order:
      - habitify-api-v2/tag/habit-logs/GET/habits/{habitId}/logs
      - habitify-api-v2/tag/habit-logs/POST/habits/{habitId}/logs
      - habitify-api-v2/tag/habit-logs/DELETE/habits/{habitId}/logs/{logId}
      - habitify-api-v2/tag/habit-logs/POST/habits/{habitId}/logs/complete
      - habitify-api-v2/tag/habit-logs/POST/habits/{habitId}/logs/failed
      - habitify-api-v2/tag/habit-logs/POST/habits/{habitId}/logs/skipped
      - habitify-api-v2/tag/habit-logs/POST/habits/{habitId}/logs/undo
  - name: Habit Notes
    description: Attach notes with text, mood levels, and photos to your habits
    x-scalar-order:
      - habitify-api-v2/tag/habit-notes/GET/habits/{habitId}/notes
      - habitify-api-v2/tag/habit-notes/POST/habits/{habitId}/notes
      - habitify-api-v2/tag/habit-notes/PUT/habits/{habitId}/notes/{noteId}
      - habitify-api-v2/tag/habit-notes/DELETE/habits/{habitId}/notes/{noteId}
  - name: Areas
    description: Organize your habits into areas for grouping and categorization
    x-scalar-order:
      - habitify-api-v2/tag/areas/GET/areas
      - habitify-api-v2/tag/areas/POST/areas
      - habitify-api-v2/tag/areas/GET/areas/{areaId}
      - habitify-api-v2/tag/areas/PUT/areas/{areaId}
      - habitify-api-v2/tag/areas/DELETE/areas/{areaId}
paths:
  /habits/{habitId}/logs:
    get:
      tags:
        - Habit Logs
      summary: Get logs for a habit
      description: >-
        Retrieve a paginated list of log entries for a specific habit,
        optionally filtered by an inclusive date range. Logs are ordered from
        newest to oldest.
      parameters:
        - name: habitId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the habit
        - name: startDate
          in: query
          required: false
          schema:
            type: string
            format: date
          description: Inclusive start date for the log range (YYYY-MM-DD format)
        - name: endDate
          in: query
          required: false
          schema:
            type: string
            format: date
          description: Inclusive end date for the log range (YYYY-MM-DD format)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
          description: Maximum number of logs to return per page
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of logs to skip for pagination
      responses:
        '200':
          description: >-
            A paginated list of logs for the habit, ordered from newest to
            oldest
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - pagination
                properties:
                  data:
                    type: array
                    items:
                      description: >-
                        Represents a single log entry for a habit, recording the
                        value tracked on a specific date.
                      type: object
                      required:
                        - id
                        - type
                        - date
                        - unitSymbol
                        - value
                      properties:
                        id:
                          type: string
                          description: Unique identifier of the log entry
                        type:
                          description: >
                            Indicates how the log entry was created. - `manual`:
                            You manually recorded the value. - `auto`: The value
                            was automatically recorded via an integrated
                            service.
                          type: string
                          enum:
                            - manual
                            - auto
                        date:
                          type: string
                          format: date
                          description: Date of the log entry (YYYY-MM-DD format)
                        unitSymbol:
                          description: Unit of measurement for the logged value
                          type: string
                          enum:
                            - m
                            - kM
                            - ft
                            - yd
                            - mi
                            - floor
                            - L
                            - mL
                            - fl oz
                            - cup
                            - sec
                            - min
                            - hr
                            - ms
                            - kg
                            - g
                            - mg
                            - oz
                            - lb
                            - mcg
                            - J
                            - kJ
                            - kCal
                            - cal
                            - rep
                            - step
                        value:
                          type: number
                          description: The recorded value for this log entry
                        localLastModifiedDate:
                          type: integer
                          description: >-
                            Timestamp of the last local modification (Unix epoch
                            in milliseconds)
                  pagination:
                    type: object
                    required:
                      - total
                      - limit
                      - offset
                    properties:
                      total:
                        type: integer
                        description: Total number of logs matching the filters
                      limit:
                        type: integer
                      offset:
                        type: integer
        '400':
          description: Bad request - invalid date range
        '401':
          description: Unauthorized - missing or invalid authentication
        '404':
          description: Habit not found
        '422':
          description: Validation error - query parameters failed validation
components:
  securitySchemes:
    ApiKeyTokenAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key generated from our app (Settings > API). Only one key can be
        active at a time.
    AccessTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token acquired from OAuth2
    IdTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: ID token from Firebase Auth

````

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