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

# updatedevice cargoAccess

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

Reference: https://developers.nukio.mx/nukio-api/device/updatedevice-cargo-access

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/device/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2:
    post:
      operationId: updatedevice-cargo-access
      summary: updatedevice cargoAccess
      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_updatedevice
                  cargoAccess_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                state:
                  $ref: >-
                    #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostRequestBodyContentApplicationJsonSchemaState
                deviceid:
                  type: string
              required:
                - state
                - deviceid
servers:
  - url: https://app.nukio.mx
components:
  schemas:
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostRequestBodyContentApplicationJsonSchemaStateCargoaccess:
      type: object
      properties:
        state:
          type: string
      required:
        - state
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostRequestBodyContentApplicationJsonSchemaStateCargoaccess
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostRequestBodyContentApplicationJsonSchemaState:
      type: object
      properties:
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostRequestBodyContentApplicationJsonSchemaStateCargoaccess
      required:
        - cargoaccess
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostRequestBodyContentApplicationJsonSchemaState
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaStateCargoaccess:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          type: string
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - pendingState
        - isNegativeTriggered
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaStateCargoaccess
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaStateEnginecutoff:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          type: string
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - pendingState
        - isNegativeTriggered
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaStateEnginecutoff
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaState:
      type: object
      properties:
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaStateCargoaccess
        enginecutoff:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaStateEnginecutoff
      required:
        - cargoaccess
        - enginecutoff
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaState
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsIgnition:
      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: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsIgnition
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsCargoaccess:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          type: string
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - pendingState
        - isNegativeTriggered
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsCargoaccess
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsEnginecutoff:
      type: object
      properties:
        state:
          type: string
        onText:
          type: string
        offText:
          type: string
        displayName:
          type: string
        pendingState:
          type: string
        isNegativeTriggered:
          type: boolean
      required:
        - state
        - onText
        - offText
        - displayName
        - pendingState
        - isNegativeTriggered
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsEnginecutoff
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensors:
      type: object
      properties:
        ignition:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsIgnition
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsCargoaccess
        enginecutoff:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensorsEnginecutoff
      required:
        - ignition
        - cargoaccess
        - enginecutoff
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensors
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesCargoaccessStates:
      type: object
      properties:
        '0':
          type: string
        '1':
          type: string
      required:
        - '0'
        - '1'
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesCargoaccessStates
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesCargoaccess:
      type: object
      properties:
        states:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesCargoaccessStates
        displayText:
          type: string
      required:
        - states
        - displayText
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesCargoaccess
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesEnginecutoffStates:
      type: object
      properties:
        '0':
          type: string
        '1':
          type: string
      required:
        - '0'
        - '1'
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesEnginecutoffStates
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesEnginecutoff:
      type: object
      properties:
        states:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesEnginecutoffStates
        displayText:
          type: string
      required:
        - states
        - displayText
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesEnginecutoff
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeatures:
      type: object
      properties:
        cargoaccess:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesCargoaccess
        enginecutoff:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeaturesEnginecutoff
      required:
        - cargoaccess
        - enginecutoff
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeatures
    ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaAuthorities:
      type: object
      properties: {}
      title: >-
        ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaAuthorities
    Device_updatedevice cargoAccess_Response_200:
      type: object
      properties:
        state:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaState
        pinTag:
          type: string
        sensors:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaSensors
        success:
          type: string
        deviceID:
          type: string
        features:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaFeatures
        pinColor:
          type: string
        deviceType:
          type: string
        fuelLevels:
          type: array
          items:
            type: string
        authorities:
          $ref: >-
            #/components/schemas/ApiV1DeviceUpdatedeviceAuthorizationPostApiV1DeviceUpdatedeviceAuthorization2PostResponsesContentApplicationJsonSchemaAuthorities
        status_code:
          type: string
        deviceDriver:
          type: string
        deviceUnique:
          type: string
        deviceCreatedOn:
          type: integer
        equipmentTypeId:
          type: string
        fuelLevelAverage:
          type: string
        deviceDescription:
          type: string
        deviceDisplayName:
          type: string
        deviceNotifyEmail:
          type: string
        equipmentTypeDesc:
          type: string
        hasPendingCommands:
          type: string
        deviceLastGeozoneID:
          type: string
        deviceLastHeartbeat:
          type: integer
        additionalPinDisplay:
          type: string
        deviceLastValidSpeed:
          type: integer
        deviceLastValidAddress:
          type: string
        deviceLastValidHeading:
          type: integer
        deviceLastValidLatitude:
          type: number
          format: double
        deviceLastValidLongitude:
          type: number
          format: double
        deviceLastValidTimestamp:
          type: integer
        hasUpdateDevicePrivileges:
          type: boolean
      required:
        - state
        - pinTag
        - sensors
        - success
        - deviceID
        - features
        - pinColor
        - deviceType
        - fuelLevels
        - authorities
        - status_code
        - deviceDriver
        - deviceUnique
        - deviceCreatedOn
        - equipmentTypeId
        - fuelLevelAverage
        - deviceDescription
        - deviceDisplayName
        - deviceNotifyEmail
        - equipmentTypeDesc
        - hasPendingCommands
        - deviceLastGeozoneID
        - deviceLastHeartbeat
        - additionalPinDisplay
        - deviceLastValidSpeed
        - deviceLastValidAddress
        - deviceLastValidHeading
        - deviceLastValidLatitude
        - deviceLastValidLongitude
        - deviceLastValidTimestamp
        - hasUpdateDevicePrivileges
      title: Device_updatedevice cargoAccess_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: authorization

```

## SDK Code Examples

```python Device_updatedevice cargoAccess_example
import requests

url = "https://app.nukio.mx/api/v1/device/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2"

payload = {
    "state": { "cargoaccess": { "state": "0" } },
    "deviceid": "deviceID"
}
headers = {
    "authorization": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Device_updatedevice cargoAccess_example
const url = 'https://app.nukio.mx/api/v1/device/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2';
const options = {
  method: 'POST',
  headers: {authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"state":{"cargoaccess":{"state":"0"}},"deviceid":"deviceID"}'
};

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

```go Device_updatedevice cargoAccess_example
package main

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

func main() {

	url := "https://app.nukio.mx/api/v1/device/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2"

	payload := strings.NewReader("{\n  \"state\": {\n    \"cargoaccess\": {\n      \"state\": \"0\"\n    }\n  },\n  \"deviceid\": \"deviceID\"\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_updatedevice cargoAccess_example
require 'uri'
require 'net/http'

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

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  \"state\": {\n    \"cargoaccess\": {\n      \"state\": \"0\"\n    }\n  },\n  \"deviceid\": \"deviceID\"\n}"

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

```java Device_updatedevice cargoAccess_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/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2")
  .header("authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"state\": {\n    \"cargoaccess\": {\n      \"state\": \"0\"\n    }\n  },\n  \"deviceid\": \"deviceID\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.nukio.mx/api/v1/device/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2', [
  'body' => '{
  "state": {
    "cargoaccess": {
      "state": "0"
    }
  },
  "deviceid": "deviceID"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authorization' => '<apiKey>',
  ],
]);

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

```csharp Device_updatedevice cargoAccess_example
using RestSharp;

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

```swift Device_updatedevice cargoAccess_example
import Foundation

let headers = [
  "authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "state": ["cargoaccess": ["state": "0"]],
  "deviceid": "deviceID"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.nukio.mx/api/v1/device/updatedevice/authorization#postApiV1DeviceUpdatedeviceAuthorization2")! 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()
```