Qubitro Documentation
SupportLog inSign Up
  • Documentation
  • Guides
  • Developers
  • Changelog
  • Qubitro REST API
  • API Reference
    • Projects
      • Create Project
      • Retrieve Projects
      • Retrieve Project by ID
      • Delete Project
      • Invite Collaborator
    • Devices
      • Create Device
      • Retrieve Devices
      • Get Device by ID
      • Delete Device
    • Storage
      • Retrieve Device Data
      • Purge Device Data
      • Retrieve Device Data Keys
      • Retrieve Device Data From Storage View
    • Aggregated View
      • Retrieve Aggregated Views
      • Retrieve Aggregated View Data
      • Retrieve Aggregated View Data Keys
      • Purge Aggregated View Data
    • Dashboards
      • Retrieve Dashboards
      • Invite Collaborator
    • Organization
      • Invite Member
      • Retrieve Groups
Powered by GitBook
On this page
Export as PDF
  1. API Reference
  2. Devices

Create Device

Allows to create a new device.

PreviousDevicesNextRetrieve Devices

Last updated 2 months ago

Create Device

post
Authorizations
Path parameters
PROJECT_IDstringRequired
Body
objectOptionalExample: { "name":"string", "description":"string", "source":"string", //only "http" or "mqtt" "tags":["string"], // not required empty array is welcome "brand":"string", //not required will be "Custom" if omitted "model":"string", //not required will be "Custom" if omitted "metadata": { "key":"value" } // custom object for any key value pair storage }
Responses
201
Created
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
post
POST /v2/projects/{PROJECT_ID}/devices HTTP/1.1
Host: api.qubitro.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 415

"{\n  \"name\":\"string\",\n  \"description\":\"string\",\n  \"source\":\"string\", //only \"http\" or \"mqtt\"\n  \"tags\":[\"string\"], // not required empty array is welcome\n  \"brand\":\"string\", //not required will be \"Custom\" if omitted\n  \"model\":\"string\", //not required will be \"Custom\" if omitted\n  \"metadata\": {\n    \"key\":\"value\"\n  } // custom object for any key value pair storage\n}"
{
  "success": true,
  "action": "create device",
  "status": 201,
  "message": "Device created successfully.",
  "data": {
    "id": "string",
    "name": "string",
    "description": "string",
    "brand": "string",
    "model": "string",
    "avatar": "https://static.qubitro.com/portal/device/avatar/default.png",
    "last_seen": "0001-01-01T00:00:00Z",
    "tags": [
      "string"
    ],
    "device_credentials": {
      "device_id": "string",
      "device_token": "string"
    },
    "metadata": {
      "key": "value"
    }
  }
}