Skip to content

Get action by ID

GET/actions/{id}

Mobile API · Actions

Get action by ID.

Required permissionmobile.action:read

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 samples

curl -X GET "https://api-<data-region>.central.sophos.com/mobile/v1/actions/<id>" -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/<id>",
    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/<id>" -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/<id>", 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/<id>", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Action.

Response fields

idstring (uuid)
The action ID.
tenantobject
Tenant this resource belongs to.
Show child attributesHide child attributes
idstring (uuid)required
namestring
deviceobject
A device reference.
Show child attributesHide child attributes
idstring (uuid)required
Unique ID of the device.
namestring
The device name.
typestring
The action type.
namestring
The action name.
statestring
The action status.
errorstring
The action's error description.
propertiesobject
The 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.
createdByobject
Principal reference.
Show child attributesHide child attributes
idstring (uuid)
Principal ID.
typestring (enum)required
Principal type.
Must be one of: user, service, system.
accountIdstring (uuid)
Account ID.
accountTypestring (enum)
Account type.
Must be one of: partner, tenant, organization.
namestring
Principal name or email.
updatedAtstring (date-time)
Time when the action was updated.
updatedByobject
Principal reference.
Show child attributesHide child attributes
idstring (uuid)
Principal ID.
typestring (enum)required
Principal type.
Must be one of: user, service, system.
accountIdstring (uuid)
Account ID.
accountTypestring (enum)
Account type.
Must be one of: partner, tenant, organization.
namestring
Principal name or email.

Errors

Status Meaning
400 Invalid request.
401 Unauthorized.
403 Forbidden.
404 Can't find the requested device action.
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": "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"
}

See the guide for a narrative walkthrough of this API.