Get list of actions¶
GET/
Mobile API · Actions
Get list of actions.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
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. |
sort | query | array of string | No | Defines how to sort the data. Each item must match the pattern (^[^:]+$)|(^[^:]+:(asc|desc)$). |
page | query | integer | No | The page number to fetch, starting with 1. |
pageSize | query | integer | No | The size of the page requested. |
pageTotal | query | boolean | No | Whether the number of pages should be calculated and returned in the response. |
ids | query | array of string (uuid) | No | List of IDs. |
endpointIds | query | array of string (uuid) | No | List of endpoint IDs. Must contain at most 100 items. |
actionType | query | array of string | No | Filter actions by action type. Each item must be at most 100 characters long. |
actionState | query | array of string | No | Filter actions by status. Each item must be at most 100 characters long. |
actionError | query | array of string | No | Filter actions by error. Each item must be at most 100 characters long. |
scheduledBefore | query | string | No | Find actions scheduled before the given date and time (UTC) or within a time interval relative to the current date and time (exclusive). |
scheduledAfter | query | string | No | Find actions scheduled after the given date and time (UTC) or within a time interval relative to the current date and time (inclusive). |
executedBefore | query | string | No | Find actions executed before the given date and time (UTC) or within a time interval relative to the current date and time (exclusive). |
executedAfter | query | string | No | Find actions executed after the given date and time (UTC) or within a time interval relative to the current date and time (inclusive). |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/mobile/v1/actions" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"
import requests
response = requests.get(
"https://api-<data-region>.central.sophos.com/mobile/v1/actions",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api-<data-region>.central.sophos.com/mobile/v1/actions" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/mobile/v1/actions", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
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/actions", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — List of actions.¶
Response fields
itemsarray of objectrequiredAction object.
Show child attributesHide child attributes
idstring (uuid)The action ID.
tenantobjectTenant this resource belongs to.
Show child attributesHide child attributes
idstring (uuid)requirednamestringdeviceobjectA device reference.
Show child attributesHide child attributes
idstring (uuid)requiredUnique ID of the device.
namestringThe device name.
typestringThe action type.
namestringThe action name.
statestringThe action status.
errorstringThe action's error description.
propertiesobjectThe action properties.
scheduledAtstring (date-time)Time when the action must be executed.
executedAtstring (date-time)Time when the action was executed.
createdAtstring (date-time)Time when the action was created.
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.
updatedAtstring (date-time)Time when the action was updated.
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.
pagesobjectrequiredShow child attributesHide child attributes
currentintegerrequiredThe 1-based page number being returned.
sizeintegerrequiredThe size of the page being returned.
totalinteger(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger(Optional) The total number of items across all pages.
maxSizeintegerrequiredThe maximum page size that can be requested.
Errors¶
| Status | Meaning |
|---|---|
400 | Invalid request. |
401 | Unauthorized. |
403 | Forbidden. |
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¶
{
"items": [
{
"id": "ec09add5-a752-4b6e-b1b6-b89000252edb",
"tenant": {
"id": "b8a75c7d-7492-4009-9f95-8c815551dc55",
"name": "The name of the tenant"
},
"device": {
"id": "52e793b5-6985-4c35-aa95-4f7752638592",
"name": "My iPhone"
},
"type": "sendMessage",
"state": "successful"
},
{
"id": "ec09add5-a752-4b6e-b1b6-b89000252edb",
"tenant": {
"id": "b8a75c7d-7492-4009-9f95-8c815551dc55",
"name": "The name of the tenant"
},
"device": {
"id": "52e793b5-6985-4c35-aa95-4f7752638592",
"name": "My iPhone"
},
"type": "sendMessage",
"state": "skipped"
},
{
"id": "ec09add5-a752-4b6e-b1b6-b89000252edb",
"tenant": {
"id": "b8a75c7d-7492-4009-9f95-8c815551dc55",
"name": "The name of the tenant"
},
"device": {
"id": "52e793b5-6985-4c35-aa95-4f7752638592",
"name": "My iPhone"
},
"type": "sendMessage",
"state": "notified"
},
{
"id": "85d66987-5c73-4b95-87f6-b0be28c47cbd",
"tenant": {
"id": "b8a75c7d-7492-4009-9f95-8c815551dc55",
"name": "The name of the tenant"
},
"device": {
"id": "52e793b5-6985-4c35-aa95-4f7752631337",
"name": "My Android"
},
"type": "scan",
"state": "failed",
"error": "system.processing-failed"
}
],
"pages": {
"current": 1,
"size": 50,
"maxSize": 500
}
}
See the guide for a narrative walkthrough of this API.