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

# List all devices

> Lists all device identifiers.

The objects are returned sorted by creation date, with the most recent appearing first. If no parameters are specified in the request, all objects in pages of 30 are returned. 



## OpenAPI

````yaml api-reference/zero/flatpeak-api-spec-zero.json GET /devices
openapi: 3.0.3
info:
  description: Flatpeak API
  version: 2024-08-24.zero
  title: Flatpeak 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://api.flatpeak.com
    description: Location
security: []
tags:
  - name: Consumption
    description: Consumption operations
  - name: Customers
    description: Customer operations
  - name: Devices
    description: Device operations
  - name: Meters
    description: Meter readings operations
  - name: Events
    description: Events operations
  - name: Login
    description: Bearer auth token operations
  - name: Connect
    description: Connect operations
  - name: Locations
    description: Location operations
  - name: Rates
    description: Rates operations
  - name: Costs
    description: Consumption cost calculations
  - name: Schedules
    description: Consumption schedules
  - name: Tariffs
    description: Tariff operations
  - name: Slots
    description: Slots operations
externalDocs:
  description: Location documentation
  url: https://docs.flatpeak.com
paths:
  /devices:
    parameters: []
    get:
      tags:
        - Devices
      summary: List all devices
      description: >-
        Lists all device identifiers.


        The objects are returned sorted by creation date, with the most recent
        appearing first. If no parameters are specified in the request, all
        objects in pages of 30 are returned. 
      operationId: list-devices
      parameters:
        - $ref: '#/components/parameters/reference_id'
        - $ref: '#/components/parameters/ending_before'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/starting_after'
      responses:
        '200':
          $ref: '#/components/responses/DeviceList'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      security:
        - bearerAuth: []
components:
  parameters:
    reference_id:
      name: reference_id
      in: query
      required: false
      schema:
        type: string
      description: >-
        A reference that is meaningful to you, for example, an ID from your
        system.
    ending_before:
      schema:
        type: string
      in: query
      name: ending_before
      description: >-
        Specifies a cursor for pagination use; provider_id defines the place in
        the list. To retrieve the previous page in the list, include
        ending_before, which is the first ID in the currently retrieved list.
    limit:
      schema:
        type: integer
      in: query
      name: limit
      description: >-
        A limit on the number of objects to be returned. Can range between 1 and
        100, and the default is 30.
    starting_after:
      schema:
        type: string
      in: query
      name: starting_after
      description: >-
        Specifies a cursor for pagination use; provider_id defines the place in
        the list. To retrieve the next page in the list include starting_after
        where ID is the last ID in the currently retrieved list.
  responses:
    '403':
      description: 403 bad credentials
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Bad credentials
            properties:
              message:
                type: string
                example: Bad credentials
          examples: {}
    '404':
      description: 404 response
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Not Found
            properties:
              message:
                type: string
                example: Not Found
          examples: {}
    '500':
      description: 500 error
      content:
        application/json:
          schema:
            type: object
            x-examples:
              '':
                message: Internal Server Error
            properties:
              message:
                type: string
                example: Internal Server Error
          examples: {}
    DeviceList:
      description: ''
      content:
        application/json:
          schema:
            type: object
            x-examples:
              '':
                object: list
                url: /devices
                has_more: false
                data: []
            properties:
              object:
                type: string
                description: Represents the object’s type. i.e. `list`.
                example: list
              url:
                type: string
                description: Represents the URL slug for the object.
                example: /devices
              has_more:
                type: boolean
                description: Is set to `true` if more objects are available.
              data:
                type: array
                items:
                  $ref: '#/components/schemas/Device'
  schemas:
    Device:
      type: object
      x-examples: {}
      description: This object represents a device or another asset of a compatible type.
      title: Device
      x-tags:
        - Devices
      properties:
        id:
          type: string
          description: Flatpeak unique object `id`.
          example: dev_63a6087272941ef077a8fd3e
          readOnly: true
        object:
          type: string
          description: Represents the object’s type.
          example: device
          readOnly: true
        live_mode:
          type: boolean
          x-stoplight:
            id: 49pa8oln5zly4
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        reference_id:
          type: string
          description: >-
            A reference that is meaningful to you, for example, an ID from your
            system.
          example: DEV1234567890
          x-stoplight:
            id: gcnayduh1z16f
          readOnly: true
        last_seen:
          type: string
          description: Timestamp of when the device has last queried the service.
          example: '2022-03-22T11:12:21Z'
          format: date-time
        time_created:
          type: string
          description: Time when the object was created, in UTC.
          example: '2022-01-24T14:15:22Z'
        account_id:
          type: string
          description: Flatpeak account ID.
          example: acc_661677911f2197045e6cf1b1
          x-stoplight:
            id: gcnayduh1z16f
          readOnly: true
      required:
        - id
        - object
        - live_mode
        - reference_id
        - time_created
        - account_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with `bearer_token` you obtained from
        [/login](/api-reference/zero/login/create-a-bearer-token) endpoint.

````