> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getprimo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List past activities for a device

> Return the paginated list of past MDM activities for a device. The `details` field is a polymorphic passthrough whose shape varies by activity type.

<span className="badge-read">Key: Read</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json get /devices/{deviceId}/activities
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /devices/{deviceId}/activities:
    get:
      tags:
        - Devices
      summary: List past activities for a device
      description: >-
        Return the paginated list of past MDM activities for a device. The
        `details` field is a polymorphic passthrough whose shape varies by
        activity type.
      operationId: getDeviceActivities
      parameters:
        - name: deviceId
          required: true
          in: path
          schema:
            type: string
        - name: orderDirection
          required: false
          in: query
          description: Order direction
          schema:
            enum:
              - asc
              - desc
            type: string
        - name: orderKey
          required: false
          in: query
          description: Field to order results by
          schema:
            enum:
              - id
              - created_at
              - activity_type
            type: string
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            type: number
        - name: perPage
          required: false
          in: query
          description: Number of items per page (max 100)
          schema:
            type: number
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDeviceActivities_Output'
components:
  schemas:
    GetDeviceActivities_Output:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
              uuid:
                anyOf:
                  - type: string
                  - type: 'null'
              activityType:
                type: string
              actorFullName:
                anyOf:
                  - type: string
                  - type: 'null'
              actorId:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
              actorGravatar:
                anyOf:
                  - type: string
                  - type: 'null'
              actorEmail:
                anyOf:
                  - type: string
                  - type: 'null'
              createdAt:
                type: string
              fleetInitiated:
                anyOf:
                  - type: boolean
                  - type: 'null'
              details:
                anyOf:
                  - type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  - type: 'null'
            required:
              - id
              - uuid
              - activityType
              - createdAt
              - fleetInitiated
              - details
            additionalProperties: false
        pagination:
          type: object
          properties:
            page:
              type: integer
              minimum: 1
              maximum: 9007199254740991
            perPage:
              type: integer
              minimum: 1
              maximum: 100
            hasNextPage:
              type: boolean
            hasPreviousPage:
              type: boolean
            totalElements:
              anyOf:
                - type: integer
                  minimum: 0
                  maximum: 9007199254740991
                - type: 'null'
          required:
            - page
            - perPage
            - hasNextPage
            - hasPreviousPage
            - totalElements
          additionalProperties: false
      required:
        - data
        - pagination
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````