> ## 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.

# Create a device

> Creates a device identifier.

Device identifiers represent a physical or virtual device in your systems. For cross-reference, we recommend that you populate the `reference_id` field with the unique ID of that device as used in your systems.



## OpenAPI

````yaml api-reference/anode/flatpeak-api-spec-anode.json POST /devices
openapi: 3.0.3
info:
  description: Flatpeak API
  version: 2025-09-14.anode
  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: []
    post:
      tags:
        - Devices
      summary: Create a device
      description: >-
        Creates a device identifier.


        Device identifiers represent a physical or virtual device in your
        systems. For cross-reference, we recommend that you populate the
        `reference_id` field with the unique ID of that device as used in your
        systems.
      operationId: create-device
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/DeviceCreate'
      responses:
        '201':
          $ref: '#/components/responses/Device'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
      security:
        - bearerAuth: []
components:
  requestBodies:
    DeviceCreate:
      content:
        application/json:
          schema:
            type: object
            properties:
              reference_id:
                type: string
                description: >-
                  A reference that is meaningful to you, for example, an ID from
                  your system.
                example: DEV1234567890
      description: Creates a device
  responses:
    '403':
      description: 403 forbidden
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Bad credentials
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: gria4ysjd9zhk
                default: error
              type:
                type: string
                x-stoplight:
                  id: 7mhtfljidnqcu
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: sy7ljpdy5wdes
                example: access_denied
                default: access_denied
              time_created:
                type: string
                x-stoplight:
                  id: 84d5biv9dfbc9
                format: date-time
                example: '2025-01-01T00:00:00Z'
            required:
              - object
              - type
              - code
          examples: {}
    '409':
      description: 409 conflict
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Conflict
            properties:
              object:
                type: string
                x-stoplight:
                  id: fk1kol4j7b61e
                default: error
                example: error
              type:
                type: string
                x-stoplight:
                  id: oyyg98j0zeytg
                default: conflict
                example: conflict
              code:
                type: string
                x-stoplight:
                  id: 9c88baxga1b2j
                default: duplicate_reference
                example: duplicate_reference
              message:
                type: string
                example: Reference ID already exists
                default: Reference ID already exists
          examples: {}
    Device:
      description: ''
      content:
        application/json:
          schema:
            $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` you obtained from
        [authentication](/api-reference/anode/authentication) endpoint.

````