---
title: "Activity Data"
method: POST
path: "/api/new_mdm/activity_data"
tags: ["MDM NEW"]
---

# Activity Data

`POST /api/new_mdm/activity_data`

**Function**: `activity_data`
**Type**: API Endpoint (POST)

**Purpose**:
Retrieves a paginated list of activity data for a specific user. The function retrieves data related to activities, triggers, or history records based on specified filters. It allows filtering by user, customer, application, and fetch type (status categories such as Success, Failure, In Progress, etc.).

**URL**:
`POST /api/new_mdm/activity_data`

**Request Headers**:
- `User-Code` (Header, required): A base64-encoded string representing the user code.
- `Customer-Key` (Header, required): A base64-encoded string containing `lscode` and `firmcode`, separated by a pipe (`|`), which helps identify the customer's firm and database code.
- `App-Code` (Header, required): A base64-encoded string representing the application code.
- **Fetch-Type** (Header, required): A string indicating the type of data to fetch:

- **Upload**
    - `0`: Pending
    - `1`: Processed
    - `2`: Not-Processed
    - `3`: In-progress
  
- **Download**    
    - `4`: In-progress
    - `6`: Processed
    - `7`: Not Processed
  
- **type** (Header, required): A string indicating the type of data to retrieve:
    - `0`: Activity
    - `1`: Trigger
    - `2`: History

**Request Parameters**:
- `page` (int, optional): The page number for pagination (default is 1).
- `limit` (int, optional): The number of rows to fetch per page (default is 25).
- `search` (str, optional): Global search term that will be applied across BatchId, Table_Name, File_Name, Created_User, and Message fields.

**Response Model**:
Returns a JSON object containing:
- `recordsTotal`: Total number of records retrieved.
- `columns`: List of dictionaries defining column metadata for the output.
- `data`: List of dictionaries with activity data.

## Query parameters

- `page` integer
- `limit` integer
- `search` string, nullable

## Headers

- `User-Code` string, required
- `Customer-Key` string, required
- `App-Code` string, required
- `Fetch-Type` string, required
- `type` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) · [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/leapsurgebi/leapsurgeapi/revisions/5a6b1464bfeb/schema)
