# Retrieve device messages

> **Required Permission:** `mdm.global.deviceMessage.list` Returns a paginated list of device messages

Source: https://docs.applivery.com/en/api/uem/device-message/get-organizations-organizationid-mdm-device-messages/

---

# Retrieve device messages

**Required Permission:** `mdm.global.deviceMessage.list`

Returns a paginated list of device messages

No request body.

**Request:** `GET https://api.applivery.io/v1/organizations/:organizationId/mdm/device-messages`

## OpenAPI specification

Machine-readable endpoint definition (dereferenced OpenAPI operation).

```json
{
  "method": "GET",
  "path": "/organizations/:organizationId/mdm/device-messages",
  "baseUrl": "https://api.applivery.io/v1",
  "servers": [
    {
      "url": "https://api.applivery.io/v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "auth": {
    "type": "http",
    "scheme": "bearer",
    "header": "Authorization",
    "format": "Bearer <token>"
  },
  "permission": "mdm.global.deviceMessage.list",
  "parameters": [
    {
      "name": "organizationId",
      "description": "",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "pattern": "^[a-fA-F0-9]{24}$"
      }
    },
    {
      "name": "page",
      "description": "Sequential page index for navigating large datasets, enabling systematic access to specific record subsets within the total collection.",
      "in": "query",
      "required": false,
      "schema": {
        "description": "Sequential page index for navigating large datasets, enabling systematic access to specific record subsets within the total collection.",
        "example": 1,
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
      }
    },
    {
      "name": "limit",
      "description": "Maximum number of records returned per request to control data density, optimize interface performance, and manage payload size.",
      "in": "query",
      "required": false,
      "schema": {
        "description": "Maximum number of records returned per request to control data density, optimize interface performance, and manage payload size.",
        "example": 100,
        "type": "integer",
        "minimum": 1,
        "maximum": 10000
      }
    },
    {
      "name": "sort",
      "description": "Ordering criteria using a field-to-direction mapping to organize results based on specific attributes like creation date, name, or status.",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "pattern": "^[\\w.]*((:asc)|(:desc))?$",
        "description": "Ordering criteria using a field-to-direction mapping to organize results based on specific attributes like creation date, name, or status.",
        "example": "createdAt:asc"
      }
    },
    {
      "name": "deviceId",
      "description": "",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "pattern": "^[a-fA-F0-9]{24}$"
      }
    },
    {
      "name": "deviceType",
      "description": "",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "emmDevice",
          "admDevice",
          "winDevice",
          "aosDevice"
        ]
      }
    },
    {
      "name": "origin",
      "description": "",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "agent",
          "mdm",
          "automation",
          "dashboard"
        ]
      }
    },
    {
      "name": "code",
      "description": "",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "ENROLLMENT_SUCCESS",
          "ENROLLMENT_FAILED",
          "ENROLLMENT_UNENROLLED",
          "CERTIFICATE_INSTALLED",
          "CERTIFICATE_INSTALL_FAILED",
          "CERTIFICATE_EXPIRED",
          "CERTIFICATE_EXPIRING_SOON",
          "CERTIFICATE_REVOKED",
          "POLICY_APPLIED",
          "POLICY_APPLY_FAILED",
          "POLICY_VIOLATION",
          "POLICY_REMOVED",
          "COMPLIANCE_CHECK_PASSED",
          "COMPLIANCE_CHECK_FAILED",
          "COMPLIANCE_CHECK_ERROR",
          "SECURITY_JAILBREAK_DETECTED",
          "SECURITY_ENCRYPTION_DISABLED",
          "SECURITY_PASSCODE_MISSING",
          "APP_INSTALLED",
          "APP_INSTALL_FAILED",
          "APP_UNINSTALLED",
          "APP_UPDATE_REQUIRED",
          "PROFILE_INSTALLED",
          "PROFILE_INSTALL_FAILED",
          "PROFILE_REMOVED",
          "DEVICE_RESTARTED",
          "DEVICE_WIPED",
          "DEVICE_LOCKED",
          "DEVICE_STORAGE_LOW",
          "OS_UPDATE_REQUIRED",
          "OS_UPDATE_AVAILABLE",
          "OS_UNSUPPORTED",
          "OS_VERSION_BELOW_MINIMUM",
          "UNKNOWN"
        ]
      }
    },
    {
      "name": "severity",
      "description": "",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "info",
          "warning",
          "error",
          "critical"
        ]
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "boolean"
              },
              "data": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-fA-F0-9]{24}$"
                        },
                        "organizationId": {
                          "type": "string",
                          "pattern": "^[a-fA-F0-9]{24}$"
                        },
                        "deviceInfo": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[a-fA-F0-9]{24}$"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "emmDevice",
                                "admDevice",
                                "winDevice",
                                "aosDevice"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        "fingerprint": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "origin": {
                          "type": "string",
                          "enum": [
                            "agent",
                            "mdm",
                            "automation",
                            "dashboard"
                          ]
                        },
                        "event": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "ENROLLMENT_SUCCESS",
                                "ENROLLMENT_FAILED",
                                "ENROLLMENT_UNENROLLED",
                                "CERTIFICATE_INSTALLED",
                                "CERTIFICATE_INSTALL_FAILED",
                                "CERTIFICATE_EXPIRED",
                                "CERTIFICATE_EXPIRING_SOON",
                                "CERTIFICATE_REVOKED",
                                "POLICY_APPLIED",
                                "POLICY_APPLY_FAILED",
                                "POLICY_VIOLATION",
                                "POLICY_REMOVED",
                                "COMPLIANCE_CHECK_PASSED",
                                "COMPLIANCE_CHECK_FAILED",
                                "COMPLIANCE_CHECK_ERROR",
                                "SECURITY_JAILBREAK_DETECTED",
                                "SECURITY_ENCRYPTION_DISABLED",
                                "SECURITY_PASSCODE_MISSING",
                                "APP_INSTALLED",
                                "APP_INSTALL_FAILED",
                                "APP_UNINSTALLED",
                                "APP_UPDATE_REQUIRED",
                                "PROFILE_INSTALLED",
                                "PROFILE_INSTALL_FAILED",
                                "PROFILE_REMOVED",
                                "DEVICE_RESTARTED",
                                "DEVICE_WIPED",
                                "DEVICE_LOCKED",
                                "DEVICE_STORAGE_LOW",
                                "OS_UPDATE_REQUIRED",
                                "OS_UPDATE_AVAILABLE",
                                "OS_UNSUPPORTED",
                                "OS_VERSION_BELOW_MINIMUM",
                                "UNKNOWN"
                              ]
                            },
                            "severity": {
                              "type": "string",
                              "enum": [
                                "info",
                                "warning",
                                "error",
                                "critical"
                              ]
                            },
                            "content": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "severity",
                            "content"
                          ],
                          "additionalProperties": false
                        },
                        "occurrence": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "number"
                            },
                            "firstOccurredAt": {
                              "type": "string"
                            },
                            "lastOccurredAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "count",
                            "firstOccurredAt",
                            "lastOccurredAt"
                          ],
                          "additionalProperties": false
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "version": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "id",
                        "organizationId",
                        "deviceInfo",
                        "fingerprint",
                        "origin",
                        "event",
                        "occurrence",
                        "expiresAt",
                        "createdAt",
                        "updatedAt",
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "totalDocs": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "hasPrevPage": {
                    "type": "boolean"
                  },
                  "hasNextPage": {
                    "type": "boolean"
                  },
                  "page": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "totalPages": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "prevPage": {
                    "nullable": true,
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "nextPage": {
                    "nullable": true,
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "items",
                  "totalDocs",
                  "limit",
                  "hasPrevPage",
                  "hasNextPage",
                  "page",
                  "totalPages",
                  "prevPage",
                  "nextPage"
                ]
              }
            },
            "required": [
              "status",
              "data"
            ]
          }
        }
      }
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "boolean",
                    "enum": [
                      false
                    ]
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "error": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "number",
                            "enum": [
                              6002
                            ]
                          },
                          "message": {
                            "type": "string",
                            "enum": [
                              "Body Validation Error"
                            ]
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      }
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "boolean",
                    "enum": [
                      false
                    ]
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "error": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "number",
                            "enum": [
                              4002
                            ]
                          },
                          "message": {
                            "type": "string",
                            "enum": [
                              "No auth token"
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "number",
                            "enum": [
                              4004
                            ]
                          },
                          "message": {
                            "type": "string",
                            "enum": [
                              "Invalid Token"
                            ]
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      }
    }
  }
}
```
