> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.nukio.mx/llms.txt.
> For full documentation content, see https://developers.nukio.mx/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.nukio.mx/_mcp/server.

# createdevice

POST https://app.nukio.mx/api/v1/device/createdevice/authorization
Content-Type: application/json

Reference: https://developers.nukio.mx/nukio-api/device/createdevice

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/device/createdevice/authorization:
    post:
      operationId: createdevice
      summary: createdevice
      tags:
        - subpackage_device
      parameters:
        - name: authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device_createdevice_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                deviceID:
                  type: string
                uniqueid:
                  type: string
              required:
                - deviceID
                - uniqueid
servers:
  - url: https://app.nukio.mx
components:
  schemas:
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaStateCargoaccess:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaStateCargoaccess
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaStateEnginecutoff:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaStateEnginecutoff
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaState:
      type: object
      properties:
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaStateCargoaccess
        enginecutoff:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaStateEnginecutoff
      required:
        - cargoaccess
        - enginecutoff
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaState
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsFuel:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsFuel
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsPanic:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsPanic
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsIgnition:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsIgnition
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsCargoaccess:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsCargoaccess
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsEnginecutoff:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          description: Any type
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - isNegativeTriggered
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsEnginecutoff
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensors:
      type: object
      properties:
        fuel:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsFuel
        panic:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsPanic
        ignition:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsIgnition
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsCargoaccess
        enginecutoff:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensorsEnginecutoff
      required:
        - fuel
        - panic
        - ignition
        - cargoaccess
        - enginecutoff
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensors
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesCargoaccessStates:
      type: object
      properties:
        '0':
          type: string
        '1':
          type: string
      required:
        - '0'
        - '1'
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesCargoaccessStates
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesCargoaccess:
      type: object
      properties:
        states:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesCargoaccessStates
        displayText:
          type: string
      required:
        - states
        - displayText
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesCargoaccess
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesEnginecutoffStates:
      type: object
      properties:
        '0':
          type: string
        '1':
          type: string
      required:
        - '0'
        - '1'
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesEnginecutoffStates
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesEnginecutoff:
      type: object
      properties:
        states:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesEnginecutoffStates
        displayText:
          type: string
      required:
        - states
        - displayText
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesEnginecutoff
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeatures:
      type: object
      properties:
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesCargoaccess
        enginecutoff:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeaturesEnginecutoff
      required:
        - cargoaccess
        - enginecutoff
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeatures
    ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaAuthorities:
      type: object
      properties: {}
      title: >-
        ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaAuthorities
    Device_createdevice_Response_200:
      type: object
      properties:
        state:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaState
        pinTag:
          type: string
        sensors:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaSensors
        success:
          type: string
        deviceID:
          type: string
        features:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaFeatures
        pinColor:
          type: string
        deviceType:
          type: string
        fuelLevels:
          type: array
          items:
            description: Any type
        authorities:
          $ref: >-
            #/components/schemas/ApiV1DeviceCreatedeviceAuthorizationPostResponsesContentApplicationJsonSchemaAuthorities
        status_code:
          type: string
        deviceDriver:
          type: string
        deviceUnique:
          type: string
        deviceCreatedOn:
          type: integer
        equipmentTypeId:
          type: string
        fuelLevelAverage:
          description: Any type
        deviceDescription:
          type: string
        deviceDisplayName:
          type: string
        deviceNotifyEmail:
          type: string
        equipmentTypeDesc:
          type: string
        hasPendingCommands:
          type: string
        deviceLastHeartbeat:
          type: integer
        additionalPinDisplay:
          type: string
        hasUpdateDevicePrivileges:
          type: boolean
      required:
        - state
        - pinTag
        - sensors
        - success
        - deviceID
        - features
        - pinColor
        - deviceType
        - fuelLevels
        - authorities
        - status_code
        - deviceDriver
        - deviceUnique
        - deviceCreatedOn
        - equipmentTypeId
        - deviceDescription
        - deviceDisplayName
        - deviceNotifyEmail
        - equipmentTypeDesc
        - hasPendingCommands
        - deviceLastHeartbeat
        - additionalPinDisplay
        - hasUpdateDevicePrivileges
      title: Device_createdevice_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: authorization

```

## SDK Code Examples

```python Device_createdevice_example
import requests

url = "https://app.nukio.mx/api/v1/device/createdevice/authorization"

payload = {
    "deviceID": "NewDeviceID",
    "uniqueid": "NewUniqueID"
}
headers = {
    "authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Device_createdevice_example
const url = 'https://app.nukio.mx/api/v1/device/createdevice/authorization';
const options = {
  method: 'POST',
  headers: {authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"deviceID":"NewDeviceID","uniqueid":"NewUniqueID"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Device_createdevice_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.nukio.mx/api/v1/device/createdevice/authorization"

	payload := strings.NewReader("{\n  \"deviceID\": \"NewDeviceID\",\n  \"uniqueid\": \"NewUniqueID\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Device_createdevice_example
require 'uri'
require 'net/http'

url = URI("https://app.nukio.mx/api/v1/device/createdevice/authorization")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"deviceID\": \"NewDeviceID\",\n  \"uniqueid\": \"NewUniqueID\"\n}"

response = http.request(request)
puts response.read_body
```

```java Device_createdevice_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.nukio.mx/api/v1/device/createdevice/authorization")
  .header("authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"deviceID\": \"NewDeviceID\",\n  \"uniqueid\": \"NewUniqueID\"\n}")
  .asString();
```

```php Device_createdevice_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.nukio.mx/api/v1/device/createdevice/authorization', [
  'body' => '{
  "deviceID": "NewDeviceID",
  "uniqueid": "NewUniqueID"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authorization' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Device_createdevice_example
using RestSharp;

var client = new RestClient("https://app.nukio.mx/api/v1/device/createdevice/authorization");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"deviceID\": \"NewDeviceID\",\n  \"uniqueid\": \"NewUniqueID\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Device_createdevice_example
import Foundation

let headers = [
  "authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "deviceID": "NewDeviceID",
  "uniqueid": "NewUniqueID"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.nukio.mx/api/v1/device/createdevice/authorization")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```