Fitbit · Capability

Fitbit Sleep API — Sleep

Fitbit Sleep API. Read and log sleep records and read sleep stage breakdowns for the authorized user.

Fitbit Sleep API — Sleep is a Naftiko capability published by Fitbit, one of 8 capabilities the APIs.io network indexes for this provider. It bundles 2 operations.

The capability includes 2 read-only operations. Lead operation: Fetch sleep records and stage breakdown for a given date. Can be deployed as a REST endpoint, MCP tool, or Agent Skill via Naftiko.

Tagged areas include Fitbit, Sleep, and Wearable.

Run with Naftiko FitbitSleepWearable

MCP Tools

fitbit-get-sleep-by-date

Fetch sleep records and stage breakdown for a given date.

read-only idempotent
fitbit-list-sleep-logs

List sleep log entries with pagination.

read-only idempotent

Capability Spec

sleep-sleep.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Fitbit Sleep API — Sleep
  description: Fitbit Sleep API. Read and log sleep records and read sleep stage breakdowns for the authorized user.
  tags:
  - Fitbit
  - Sleep
  - Wearable
  created: '2026-05-25'
  modified: '2026-05-25'
binds:
- namespace: env
  keys:
    FITBIT_ACCESS_TOKEN: FITBIT_ACCESS_TOKEN
capability:
  consumes:
  - type: http
    namespace: sleep-sleep
    baseUri: https://api.fitbit.com
    description: Fitbit Sleep API.
    resources:
    - name: sleep-by-date
      path: /1.2/user/-/sleep/date/{date}.json
      operations:
      - name: getSleepByDate
        method: GET
        description: Get sleep log for a date with stage breakdowns.
        outputRawFormat: json
        inputParameters:
        - name: date
          in: path
          type: string
          required: true
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: sleep-log-list
      path: /1.2/user/-/sleep/list.json
      operations:
      - name: getSleepLogList
        method: GET
        description: Paginated sleep log list.
        outputRawFormat: json
        inputParameters:
        - name: beforeDate
          in: query
          type: string
        - name: afterDate
          in: query
          type: string
        - name: sort
          in: query
          type: string
        - name: limit
          in: query
          type: integer
        - name: offset
          in: query
          type: integer
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: bearer
      value: '{{env.FITBIT_ACCESS_TOKEN}}'
      placement: header
  exposes:
  - type: mcp
    namespace: sleep-mcp
    port: 9090
    transport: http
    description: MCP adapter for Fitbit Sleep API.
    tools:
    - name: fitbit-get-sleep-by-date
      description: Fetch sleep records and stage breakdown for a given date.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sleep-sleep.getSleepByDate
      with:
        date: tools.date
      outputParameters:
      - type: object
        mapping: $.
    - name: fitbit-list-sleep-logs
      description: List sleep log entries with pagination.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sleep-sleep.getSleepLogList
      with:
        beforeDate: tools.beforeDate
        afterDate: tools.afterDate
        sort: tools.sort
        limit: tools.limit
        offset: tools.offset
      outputParameters:
      - type: object
        mapping: $.