---
title: "Create a new device"
method: POST
path: "/v1/projects/{projectId}/devices"
tags: ["Devices"]
---

# Create a new device

`POST /v1/projects/{projectId}/devices`

Create a new device with a unique name in an existing project. The tags, blueprint and cohort must already have been created.

If no hardware ID is specified, a new hardware ID is generated. The device will also be assigned a unique device ID that can be used to fetch it later.

## Path parameters

- `projectId` string, required

## Request body

- GoliothDevicesCreateBody
  - `blueprintId` string
  - `cohortId` string
  - `hardwareIds` string[]
  - `name` string
  - `tagIds` string[]

## Response `200`

A successful response.

- GoliothCreateDeviceResponse
  - `data` GoliothDevice
    - `blueprintId` string
    - `certificateId` string
    - `cohortId` string
    - `createdAt` string, date-time
    - `data` object
    - `enabled` boolean
    - `hardwareIds` string[]
    - `id` string
    - `lastReport` string, date-time
    - `metadata` GoliothDeviceMetadata
      - `lastReport` string, date-time
      - `lastSeenOffline` string, date-time
      - `lastSeenOnline` string, date-time
      - `lastSettingsStatus` GoliothSettingsStatus
        - `errors` GoliothSettingError[]
          - `code` integer
          - `codeDescription` string
          - `deviceDetails` string
          - `key` string
        - `reportedVersion` string
        - `status` string
        - `statusDetail` string
        - `syncTime` string, date-time
      - `status` string
      - `update` object — Latest Firmware Update information.
    - `name` string
    - `status` string
    - `tagIds` string[]
    - `updatedAt` string, date-time

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.dev/golioth/apis/golioth-api.md) · [All operations](https://skmtc.dev/golioth/apis/golioth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/golioth/golioth-api/revisions/47c98ae69a55/schema)
