Update mobile device¶
PUT/
Mobile API · Devices
Update a mobile device.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes | Unique object identifier. |
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
fields | query | array of string | No | The fields to return in a partial response. |
view | query | string | No | Type of view to be returned in response. Must be one of: basic, summary, full. |
Request body¶
Content type: application/json
Request body fields
namestringrequiredName of the mobile device.
Must be at most 255 characters long.
Must be at most 255 characters long.
descriptionstringDescription of the mobile device.
Must be at most 500 characters long.
Must be at most 500 characters long.
phoneNumberstringPhone number of the user assigned to the mobile device.
Must match the pattern
Must match the pattern
^(\+?\d+|.{0})$. Must be at most 50 characters long.emailstringThe email address assigned to the device if there's no user assigned.
Must be at most 255 characters long.
Must be at most 255 characters long.
assignedPersonIdstring (uuid)ID of the user assigned to the device.
ownershipTypestring (enum)requiredThe ownership type of the mobile device.
Must be one of:
Must be one of:
corporate, employee.logLevelstring (enum)The verbosity of the Sophos Mobile app logging.
Must be one of:
Must be one of:
error, warn, info, debug, trace.groupIdstring (uuid)requiredID of a device group.
Request samples¶
curl -X PUT "https://api-<data-region>.central.sophos.com/mobile/v1/devices/<id>" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
\"name\": \"My device\",
\"ownershipType\": \"corporate\",
\"groupId\": \"1c9146a4-43f9-43c7-ae39-8f7708dfa65f\"
}"
import requests
response = requests.put(
"https://api-<data-region>.central.sophos.com/mobile/v1/devices/<id>",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
json={ 'name': 'My device',
'ownershipType': 'corporate',
'groupId': '1c9146a4-43f9-43c7-ae39-8f7708dfa65f'},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
"Content-Type" = "application/json"
}
$body = '{
"name": "My device",
"ownershipType": "corporate",
"groupId": "1c9146a4-43f9-43c7-ae39-8f7708dfa65f"
}'
Invoke-RestMethod -Method PUT -Uri "https://api-<data-region>.central.sophos.com/mobile/v1/devices/<id>" -Headers $headers -Body $body -ContentType "application/json"
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, err := http.NewRequest("PUT", "https://api-<data-region>.central.sophos.com/mobile/v1/devices/<id>", strings.NewReader(`{
"name": "My device",
"ownershipType": "corporate",
"groupId": "1c9146a4-43f9-43c7-ae39-8f7708dfa65f"
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/mobile/v1/devices/<id>", {
method: "PUT",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "My device",
"ownershipType": "corporate",
"groupId": "1c9146a4-43f9-43c7-ae39-8f7708dfa65f"
}),
});
const data = await response.json();
console.log(data);
Responses¶
200 — The updated mobile device.¶
Response fields
idstring (uuid)requiredID of the mobile device.
tenantobjectrequiredTenant this resource belongs to.
Show child attributesHide child attributes
idstring (uuid)requirednamestringavailableActionsarray of stringList of actions that can be performed for the mobile device.
namestringName of the mobile device.
Must be at most 255 characters long.
Must be at most 255 characters long.
descriptionstringDescription of the mobile device.
Must be at most 500 characters long.
Must be at most 500 characters long.
phoneNumberstringPhone number of the user assigned to the mobile device.
Must match the pattern
Must match the pattern
^(\+?\d+|.{0})$. Must be at most 50 characters long.emailstringThe email address assigned to the device if there's no user assigned.
Must be at most 255 characters long.
Must be at most 255 characters long.
assignedPersonobjectAssigned user to a mobile device.
Show child attributesHide child attributes
idstring (uuid)requiredThe user's ID in Sophos Central.
namestringThe user's name.
Must be at most 255 characters long.
Must be at most 255 characters long.
emailstringThe user's email address.
Must be at most 255 characters long.
Must be at most 255 characters long.
healthStateobjectHealth status of a mobile device.
Show child attributesHide child attributes
statestring (enum)The health status of a mobile device.
Must be one of:
Must be one of:
green, amber, red.modestring (enum)The health status mode.
Must be one of:
Must be one of:
automatic, manual.ownershipTypestring (enum)The ownership type of the mobile device.
Must be one of:
Must be one of:
corporate, employee.createdByobjectPrincipal reference.
Show child attributesHide child attributes
idstring (uuid)Principal ID.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service, system.accountIdstring (uuid)Account ID.
accountTypestring (enum)Account type.
Must be one of:
Must be one of:
partner, tenant, organization.namestringPrincipal name or email.
updatedByobjectPrincipal reference.
Show child attributesHide child attributes
idstring (uuid)Principal ID.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service, system.accountIdstring (uuid)Account ID.
accountTypestring (enum)Account type.
Must be one of:
Must be one of:
partner, tenant, organization.namestringPrincipal name or email.
createdAtstring (date-time)The time when the device was created.
updatedAtstring (date-time)The time when the device was last updated.
lastSeenAtstring (date-time)The last time the device contacted Sophos Mobile.
smcAppLastSeenAtstring (date-time)The last sync time of the Sophos Mobile Control app.
ixmAppLastSeenAtstring (date-time)The last sync time of the Intercept X for Mobile app.
complianceobjectMobile device compliance status.
Show child attributesHide child attributes
compliantbooleanrequiredWhether the device is compliant.
severitystring (enum)The highest severity of a compliance violation.
Must be one of:
Must be one of:
low, medium, high.modelNamestringModel name of the mobile device.
Must be at most 255 characters long.
Must be at most 255 characters long.
externalIdstringExternal ID of the mobile device.
Must be at most 255 characters long.
Must be at most 255 characters long.
managementTypestringThe management type of the mobile device.
Must be at most 255 characters long.
Must be at most 255 characters long.
supervisedbooleanWhether the device is supervised.
managedStatestring (enum)The management status of a mobile device.
Must be one of:
Must be one of:
notManaged, managed, decommissioned, checkedOut, wiped, enrolling.logLevelstring (enum)The verbosity of the Sophos Mobile app logging.
Must be one of:
Must be one of:
error, warn, info, debug, trace.osobjectMobile operating system object.
Show child attributesHide child attributes
idstring (uuid)requiredID of the operating system.
versionstringrequiredThe operating system version.
namestringrequiredThe name of the operating system.
platformstring (enum)requiredThe device platform, i.e. the operating system.
Must be one of:
Must be one of:
iOS, macOS, android, chrome, windows.majorVersionstringOS major version.
minorVersionstringOS minor version.
patchVersionstringOS patch version.
deviceGroupobjectA device group reference.
Show child attributesHide child attributes
idstring (uuid)requiredUnique ID of the device group.
namestringThe device group name.
scanResultSummaryobjectOverview of IXM scan results.
Show child attributesHide child attributes
lastScannedAtstring (date-time)The time of the scan.
suspiciousCountintegerThe number of suspicious elements.
maliciousCountintegerThe number of malicious elements.
puaCountintegerThe number of potentially unwanted elements.
lowReputationCountintegerThe number of low reputation elements.
Errors¶
| Status | Meaning |
|---|---|
400 | Invalid request. |
401 | Unauthorized. |
403 | Forbidden. |
404 | Request contains no object. |
409 | Conflicting modification. |
429 | Too many requests. See Retry-After header. |
500 | Internal server error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"id": "c9c9b03c-5cf7-4fe1-93bb-246afc9044d2",
"tenant": {
"id": "b8a75c7d-7492-4009-9f95-8c815551dc55",
"name": "The name of the tenant"
},
"availableActions": [
"unenroll",
"sync",
"get-logs",
"send-message"
],
"assignedPerson": {
"id": "9f059011-84c7-4849-ae2e-d0563743e485",
"internalId": "670e793648a7e63f0443ba93",
"name": "Peter Smith",
"email": "peter.smith@example.org"
},
"name": "My device",
"compliance": {
"compliant": false,
"severity": "high"
},
"managedState": "managed",
"ownershipType": "corporate",
"healthState": {
"state": "amber",
"mode": "automatic"
},
"managementType": "ixm",
"os": {
"id": "c9c9b03c-5cf7-4fe1-93bb-246afc9044d2",
"version": "12.0.1",
"name": "iOS 12.0.1",
"platform": "ios",
"majorVersion": 12,
"minorVersion": 0,
"patchVersion": 1
}
}
See the guide for a narrative walkthrough of this API.