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

# Activity Data

`POST /api/mdm/activity_data`

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

**Purpose**:  
The `activity_data` function serves as an API endpoint that fetches 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/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

**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.

**Response Example**:
```json
{
    "recordsTotal": 1,
    "columns": [
        {"data": "batchid", "title": "ID", "target": 0},
        {"data": "file_upload_on", "title": "Date", "target": 1},
        {"data": "table_name", "title": "Table", "target": 2},
        {"data": "file_name", "title": "File Name", "target": 3},
        {"data": "created_user", "title": "User", "target": 4},
        {"data": "message", "title": "Message", "target": 5},
        {"data": "Url", "title": "View Error Details", "target": 6}
    ],
    "data": [
        {
            "batchid": "<batchid>",
            "file_upload_on": "<file_upload_on>",
            "table_name": "<table_name>",
            "file_name": "<file_name>",
            "created_user": "<created_user>",
            "message": "<message>",
            "Url": "<Url>"
        }
    ]
}

## 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)
