Favicon

You are here: Home > API Reference > Android > Commands > Create AOS command

POST /organizations/:organizationId/mdm/aosp/enterprise/devices/:aosDeviceId/commands

Required Permission: mdm.aosp.command.create

Create a new command for an AOS device

POST
/v1/organizations/:organizationId/mdm/aosp/enterprise/devices/:aosDeviceId/commands
Copy to clipboard

Create AOS command

Required Permission: mdm.aosp.command.create

Create a new command for an AOS device

Request

Add parameter in header authorization
Example: Authorization: Bearer <token>
organizationId string
required
Match pattern: ^(([a-fA-F0-9]{24})|([a-zA-Z0-9\\-]{3,}))$
aosDeviceId string
required
Match pattern: ^[a-fA-F0-9]{24}$
Body Params application/json
command any required
Command type to enqueue for the target AOSP device.
duration number optional
Optional duration parameter used by commands that require a bounded validity window.
params object optional
Optional command-specific parameters sent to the device.
{
    "command": "REBOOT",
    "duration": 0,
    "params": {}
}

Responses

200 Response application/json
status boolean required
data object required
id string required
Identifier of the AOSP command record.
Match pattern: ^[a-fA-F0-9]{24}$
organization string required
Identifier of the organization that owns the command.
Match pattern: ^[a-fA-F0-9]{24}$
aosEnterprise string required
Identifier of the AOSP enterprise associated with the target device.
Match pattern: ^[a-fA-F0-9]{24}$
aosDevice string required
Identifier of the target AOSP device.
Match pattern: ^[a-fA-F0-9]{24}$
mdmUser string optional
Optional identifier of the MDM user associated with the target device.
Match pattern: ^[a-fA-F0-9]{24}$
command string required
Command type that the backend asked the device to execute.
REBOOT LOCK CLEAR_APP_DATA RESET_PASSWORD DISENROLL
params object optional
Optional command-specific payload sent with the command.
pushId string optional
Pushy push identifier accepted for the command dispatch, when available.
≤ 256 characters
status string required
Current backend status of the command lifecycle.
PENDING RECEIVED DONE ERROR EXPIRED CANCEL
results array [object] optional
Execution history recorded for the command.
at string required
data object optional
errorMessage string optional
errorType string optional
deliveryExpiresAt string optional
Timestamp when the command push should no longer be considered valid for delivery.
sentAt string optional
Timestamp when the backend accepted dispatch of the command push.
updatedAt string required
Timestamp when the command record was last updated.
createdAt string required
Timestamp when the command record was created.
{
    "status": true,
    "data": {
        "id": "string",
        "organization": "string",
        "aosEnterprise": "string",
        "aosDevice": "string",
        "mdmUser": "string",
        "command": "REBOOT",
        "params": {},
        "pushId": "string",
        "status": "PENDING",
        "results": [
            {
                "at": "string",
                "data": {},
                "errorMessage": "string",
                "errorType": "string"
            }
        ],
        "deliveryExpiresAt": "string",
        "sentAt": "string",
        "updatedAt": "string",
        "createdAt": "string"
    }
}
401 Response application/json
status boolean optional
false
error object optional
code number optional
4004
message string optional
Invalid Token
{
    "status": false,
    "error": {
        "code": 4002,
        "message": "No auth token"
    }
}
404 Response application/json
status boolean optional
false
error object optional
code number optional
3001
message string optional
Entity not found
{
    "status": false,
    "error": {
        "code": 3001,
        "message": "Entity not found"
    }
}