POST
https://api.applivery.io/v1/organizations/{organizationId}/mdm/android/enterprise/devices/{emmDeviceId}/commands
curl -X POST "https://api.applivery.io/v1/organizations/{organizationId}/mdm/android/enterprise/devices/{emmDeviceId}/commands" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"type": "LOCK",
"duration": "3600s",
"newPassword": "NewSecureP@ss123",
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"LOCK_NOW"
],
"startLostModeParams": {
"lostMessage": {
"defaultMessage": "This device is lost. Please contact owner."
},
"lostPhoneNumber": {
"defaultMessage": "+1-555-0123"
}
},
"clearAppsDataParams": {
"packageNames": [
"com.example.app"
]
},
"stopLostModeParams": {},
"addEsimParams": {
"carrierName": "Acme Mobile",
"activationCode": "LPA:1$carrier.com$activation-code"
},
"removeEsimParams": {
"iccid": "89012345678901234567"
}
}'const response = await fetch("https://api.applivery.io/v1/organizations/{organizationId}/mdm/android/enterprise/devices/{emmDeviceId}/commands", {
method: "POST",
headers: {
Authorization: "Bearer <YOUR_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "LOCK",
"duration": "3600s",
"newPassword": "NewSecureP@ss123",
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"LOCK_NOW"
],
"startLostModeParams": {
"lostMessage": {
"defaultMessage": "This device is lost. Please contact owner."
},
"lostPhoneNumber": {
"defaultMessage": "+1-555-0123"
}
},
"clearAppsDataParams": {
"packageNames": [
"com.example.app"
]
},
"stopLostModeParams": {},
"addEsimParams": {
"carrierName": "Acme Mobile",
"activationCode": "LPA:1$carrier.com$activation-code"
},
"removeEsimParams": {
"iccid": "89012345678901234567"
}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.applivery.io/v1/organizations/{organizationId}/mdm/android/enterprise/devices/{emmDeviceId}/commands",
headers={"Authorization": "Bearer <YOUR_API_KEY>"},
json={
"type": "LOCK",
"duration": "3600s",
"newPassword": "NewSecureP@ss123",
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"LOCK_NOW"
],
"startLostModeParams": {
"lostMessage": {
"defaultMessage": "This device is lost. Please contact owner."
},
"lostPhoneNumber": {
"defaultMessage": "+1-555-0123"
}
},
"clearAppsDataParams": {
"packageNames": [
"com.example.app"
]
},
"stopLostModeParams": {},
"addEsimParams": {
"carrierName": "Acme Mobile",
"activationCode": "LPA:1$carrier.com$activation-code"
},
"removeEsimParams": {
"iccid": "89012345678901234567"
}
},
)
data = response.json()Request
Send your API key in the request header
authorization
Example:
Authorization: Bearer <token>
organizationId
string
required
emmDeviceId
string
required
Body Params
application/json
type
string
required
duration
string
optional
newPassword
string
optional
resetPasswordFlags
array [string]
optional
startLostModeParams
object
optional
clearAppsDataParams
object
optional
stopLostModeParams
object
optional
addEsimParams
object
optional
removeEsimParams
object
optional
{
"type": "LOCK",
"duration": "3600s",
"newPassword": "NewSecureP@ss123",
"resetPasswordFlags": [
"REQUIRE_ENTRY",
"LOCK_NOW"
],
"startLostModeParams": {
"lostMessage": {
"defaultMessage": "This device is lost. Please contact owner."
},
"lostPhoneNumber": {
"defaultMessage": "+1-555-0123"
}
},
"clearAppsDataParams": {
"packageNames": [
"com.example.app"
]
},
"stopLostModeParams": {},
"addEsimParams": {
"carrierName": "Acme Mobile",
"activationCode": "LPA: 1$carrier.com$activation-code"
},
"removeEsimParams": {
"iccid": "89012345678901234567"
}
}
Responses
200 Response
application/json
status
boolean
optional
data
object
optional
id
string
optional
organization
string
optional
emmEnterprise
string
optional
mdmUser
string
optional
status
string
optional
config
object
optional
metadata
object
optional
done
boolean
optional
_config
object
optional
updatedAt
string
optional
createdAt
string
optional
{
"status": true,
"data": {
"id": "507f1f77bcf86cd799439011",
"organization": "507f1f77bcf86cd799439012",
"emmEnterprise": "507f1f77bcf86cd799439013",
"mdmUser": "507f1f77bcf86cd799439014",
"status": "PENDING",
"config": {
"metadata": {
"@type": "type.googleapis.com/google.apps.gmm.v1.Command",
"type": "LOCK",
"createTime": "2026-02-10T12: 00:00Z",
"duration": "3600s",
"userName": "[email protected]"
},
"done": true
},
"_config": {
"name": "enterprises/LC04z6vydu/devices/123456789/operations/abc123",
"metadata": {
"type": "LOCK"
}
},
"updatedAt": "2026-02-10T14: 30:00Z",
"createdAt": "2026-02-10T12: 00:00Z"
}
}
400 Response
application/json
status
boolean
optional
error
object
optional
code
number
optional
message
string
optional
{
"status": false,
"error": {
"code": 5050,
"message": "Feature not allowed for you billing plan"
}
}
401 Response
application/json
status
boolean
optional
error
object
optional
code
number
optional
message
string
optional
{
"status": false,
"error": {
"code": 4002,
"message": "No auth token"
}
}
404 Response
application/json
status
boolean
optional
error
object
optional
code
number
optional
message
string
optional
{
"status": false,
"error": {
"code": 3001,
"message": "Entity not found"
}
}