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

# List all groups

> Returns the VPP operators' groups that touch your fleet: groups holding at least one of your devices, or referenced by a VPP event that applies to them. Most recently created first.



## OpenAPI

````yaml energy-api/reference/flatpeak-api-spec-energy.json GET /groups
openapi: 3.0.3
info:
  description: >-
    The Flatpeak Energy API connects energy hardware (batteries, EV chargers,
    vehicles, heat pumps, water heaters, solar and generators) to electricity
    prices, grid fees, and VPP programs.


    ## Create bearer token

    Obtain a bearer token from `POST /auth/tokens` using your `account_id` and
    `secret_key` via basic auth, then send it as `Authorization: Bearer <token>`
    on every request.


    ## Base URL

    `https://energy-api.flatpeak.com`


    ## Pagination

    List endpoints return a `list` envelope with `data`, `next_cursor`, and
    `url`. Page forward by passing `next_cursor` as `cursor` on the next
    request, until it is `null`. Cursors are opaque and bound to the endpoint
    and query parameters that issued them.


    ## Errors

    Every non-2xx response uses a standard error envelope with `object`, `type`,
    `code`, and `message`. Codes are machine-readable and safe to branch on.


    ## Money

    Monetary values are decimal numbers and are always paired with a
    `currency_code` (ISO 4217). Energy is expressed in kilowatt hours (kWh).


    ## Live vs test

    `live_mode` marks live or test data.
  version: 2027-01-01.busbar
  title: Flatpeak Energy API
  termsOfService: https://flatpeak.com/legal
  contact:
    name: Technical Support
    email: support@flatpeak.com
    url: https://flatpeak.com/contact
  license:
    name: Apache 2.0
    url: https://flatpeak.com/legal
servers:
  - url: https://energy-api.flatpeak.com
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: >-
      Exchange your account credentials for a bearer token to authenticate API
      requests.
  - name: Connect
    description: >-
      Create and retrieve Connect sessions. Connect drives the user journeys for
      tariff connection, VPP enrollment, and [tariff error
      reporting](/energy-api/reference/connect/tariff/error-report). What
      happens in those journeys reaches your backend as [Connect
      webhooks](/energy-api/guides/platform/events).
    x-tariff-description: >-
      Create and retrieve Connect sessions. Connect drives the user journeys for
      tariff connection and [tariff error
      reporting](/energy-api/reference/connect/tariff/error-report). What
      happens in those journeys reaches your backend as [Connect
      webhooks](/energy-api/guides/platform/events).
  - name: Users
    description: Create, retrieve, update, delete, and list users.
  - name: Locations
    description: Create, retrieve, update, delete, and list locations.
  - name: Devices
    description: >-
      Create, retrieve, update, delete and list devices; submit and retrieve
      their state; read and write their shared settings.
  - name: Meters
    description: Submit meter records and check batch status.
  - name: Tariffs
    description: Create, retrieve, delete, and list tariffs.
  - name: Prices
    description: Retrieve and audit calculated energy prices.
  - name: Costs
    description: Calculate the monetary cost of imported or exported energy.
  - name: Optimizations
    description: >-
      Rank the connected tariff to find the best times to consume or export
      energy, as inputs to your own scheduling.
  - name: Dispatch
    description: >-
      Fetch the VPP operator's instructions for a device, and confirm what the
      device will deliver.
  - name: Events
    description: Retrieve and list account events.
  - name: VPP Enrollments
    description: Create, retrieve and list VPP enrollments, and unenroll a device.
  - name: VPP Programs
    description: List VPP programs available to devices.
  - name: VPP Events
    description: >-
      VPP events committed by VPP operators, with your fleet's share and its
      per-device allocation. You can take over the allocation while it is open.
  - name: Operator groups
    description: >-
      Read-only views of the device groups VPP operators define. You see the
      groups that touch your fleet, and only your own devices in them.
  - name: Zones
    description: >-
      Network areas VPP operators define that touch your fleet. Read-only. You
      see only your own devices in them.
externalDocs:
  description: Documentation
  url: https://docs.flatpeak.com
paths:
  /groups:
    parameters: []
    get:
      tags:
        - Operator groups
      summary: List all groups
      description: >-
        Returns the VPP operators' groups that touch your fleet: groups holding
        at least one of your devices, or referenced by a VPP event that applies
        to them. Most recently created first.
      operationId: list-all-groups
      parameters:
        - schema:
            type: string
          name: program_id
          in: query
          required: false
          description: Only groups scoped to this VPP program.
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/cursor'
      responses:
        '200':
          $ref: '#/components/responses/GroupList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
components:
  parameters:
    limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 30
      description: Maximum number of objects to return per page, default 30. Maximum 100.
    cursor:
      name: cursor
      in: query
      required: false
      schema:
        type: string
      description: >-
        Pagination cursor. Pass `next_cursor` from the previous response
        unchanged; omit for the first page. A cursor used with different
        parameters returns `400 cursor_invalid`.
  responses:
    '401':
      description: '401 Unauthorized: authentication credentials are missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '403':
      description: '403 Forbidden: you do not have permission to access this resource.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: '404 Not Found: the requested resource does not exist.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: '429 Too Many Requests: the rate limit has been exceeded.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: >-
        500 Internal Server Error: an unexpected error occurred. Safe to retry
        with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '503':
      description: >-
        503 Service Unavailable: the service is temporarily down for
        maintenance. Retry after the indicated delay.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    GroupList:
      description: Group list response.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ListResponse'
              - type: object
                properties:
                  data:
                    type: array
                    description: The page of results.
                    items:
                      $ref: '#/components/schemas/Group'
          example:
            object: list
            url: /groups
            next_cursor: null
            data:
              - id: grp_2f6a9c1d8e3b5a7c4d0e9f1a
                object: group
                live_mode: true
                name: Fast responders
                operator_id: opr_6a3548352c0d07e89d47b7f1
                filter:
                  device_types:
                    - BATTERY_STORAGE
                  program_id: vpr_6a1f8e375db9de605baadd46
                  zone_id: zon_9b3c5d7e1f2a4b6c8d0e2f4a
                  min_response_seconds: null
                  max_response_seconds: 600
                device_count: 42
                time_created: '2026-08-12T09:30:00Z'
              - id: grp_7d1e3f5a9c2b4d6e8f0a1b3c
                object: group
                live_mode: true
                name: Pilot homes
                operator_id: opr_6a3548352c0d07e89d47b7f1
                filter: null
                device_count: 2
                time_created: '2026-07-02T14:05:00Z'
  schemas:
    ListResponse:
      type: object
      description: Standard envelope for paginated list endpoints.
      required:
        - object
        - url
        - next_cursor
        - data
      properties:
        object:
          type: string
          enum:
            - list
          default: list
          description: Object type.
        url:
          type: string
          description: URL for this list.
          example: /users
        next_cursor:
          type: string
          nullable: true
          description: >-
            Opaque cursor for the next page. Pass it as `cursor` on the next
            request. `null` on the last page. Do not stop on a short or empty
            `data` array.
          example: djF8ZXZ0fGE5ZjN8NjYxNjc3ODdjMTY1MmIzZmJlYmE1ZjAx
        data:
          type: array
          items: {}
          description: The page of results.
    Group:
      title: Group
      type: object
      description: >-
        A collection of devices a VPP operator defines to scope dispatch.
        Read-only: you see the groups that touch your fleet, and only your own
        devices in them.
      properties:
        id:
          type: string
          description: Flatpeak Group ID.
          example: grp_2f6a9c1d8e3b5a7c4d0e9f1a
        object:
          type: string
          example: group
          description: Object type, `group`.
          enum:
            - group
        live_mode:
          type: boolean
          description: '`true` for objects created in live mode.'
          example: true
        name:
          type: string
          example: Fast responders
          description: Group name, as set by the VPP operator.
        operator_id:
          type: string
          description: Flatpeak ID of the VPP operator that defined the group.
          example: opr_6a3548352c0d07e89d47b7f1
        filter:
          type: object
          nullable: true
          description: >-
            The VPP operator's membership rule, where the group is dynamic.
            `null` for a group made from an explicit device list. Membership
            re-evaluates continuously as your devices enroll, move or change
            type.
          properties:
            device_types:
              type: array
              items:
                type: string
                enum:
                  - BATTERY_STORAGE
                  - ELECTRIC_VEHICLE
                  - EV_CHARGER
                  - PV_SYSTEM
                  - OTHER
              description: Device types the group includes.
              example:
                - BATTERY_STORAGE
            program_id:
              type: string
              nullable: true
              description: >-
                Devices enrolled in this [VPP
                program](/energy-api/reference/vpp-programs/retrieve).
              example: vpr_6a1f8e375db9de605baadd46
            zone_id:
              type: string
              nullable: true
              description: >-
                Devices resolved into this [network
                zone](/energy-api/reference/zones/retrieve).
              example: zon_9b3c5d7e1f2a4b6c8d0e2f4a
            min_response_seconds:
              type: number
              nullable: true
              description: >-
                Only devices whose median dispatch response time is at or above
                this value, in seconds.
              example: null
            max_response_seconds:
              type: number
              nullable: true
              description: >-
                Only devices whose median dispatch response time is at or below
                this value, in seconds. Devices with no measured response time
                are excluded when either bound is set.
              example: 600
        device_count:
          type: integer
          readOnly: true
          description: >-
            Your devices in the group. Counts cover your account only, never
            other fleets.
          example: 42
        time_created:
          type: string
          format: date-time
          description: Time when the object was created, in UTC.
          example: '2026-08-12T09:30:00Z'
      required:
        - id
        - object
        - live_mode
        - name
        - operator_id
        - device_count
        - time_created
      x-examples:
        Filter group:
          id: grp_2f6a9c1d8e3b5a7c4d0e9f1a
          object: group
          live_mode: true
          name: Fast responders
          operator_id: opr_6a3548352c0d07e89d47b7f1
          filter:
            device_types:
              - BATTERY_STORAGE
            program_id: vpr_6a1f8e375db9de605baadd46
            zone_id: zon_9b3c5d7e1f2a4b6c8d0e2f4a
            min_response_seconds: null
            max_response_seconds: 600
          device_count: 42
          time_created: '2026-08-12T09:30:00Z'
    Error:
      type: object
      description: Standard error envelope returned by every non-2xx response.
      required:
        - object
        - type
        - code
        - message
      properties:
        object:
          type: string
          enum:
            - error
          default: error
          description: Object type.
        type:
          type: string
          description: High-level error category.
          example: invalid_request
        code:
          type: string
          description: Machine-readable error code, safe to branch on.
          example: not_found
        message:
          type: string
          description: Human-readable description of the error.
          example: The requested resource could not be found.
        context:
          type: string
          description: Optional originating context, for example `api.price_get`.
          example: api.price_get
        live_mode:
          type: boolean
          description: Whether the error occurred against live or test data.
        time_created:
          type: string
          format: date-time
          description: Time the error was generated (RFC 3339).
          example: '2026-01-01T00:00:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token obtained from POST /auth/tokens.

````

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