---
title: "Export activity logs"
method: POST
path: "/workspaces/{workspace_id}/activity_log/export"
tags: ["Activity Logs"]
---

# Export activity logs

`POST /workspaces/{workspace_id}/activity_log/export`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/activity_log/export`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Export activity logs

## Path parameters

- `workspace_id` integer, required: Workspace Id

## Request body

- ExportRequestData: Export request data
  - `export_type` 'csv' | 'xlsx' | 'internal_dataset': The type of export to perform.
  - `project_id` integer, nullable: The ID of the project to export data from.
  - `dataset_name` string, nullable: The name of the dataset to create if exporting as an internal dataset.
  - `filters` ExportFilterSchema
    - `search_text` string, nullable: Words to search for. Every word must match the object's name or the name of an object it is in (project, folder, dataset).
    - `object_type` 'dataset' | 'dataview' | 'automation' | 'dashboard' | 'project' | 'label' | 'file_object'
    - `object_id` integer, nullable: The ID of the primary object to filter activity logs by.
    - `include_children` boolean: With a dataset, project or label object filter, also return the events of the objects inside it, e.g. a dataset's views and their pipelines.
    - `start_time` string, date-time, nullable: The start time to filter activity logs by.
    - `end_time` string, date-time, nullable: The end time to filter activity logs by.
    - `categories` string[], nullable: List of categories to filter activity logs by.
    - `activities` string[], nullable: List of activities to filter activity logs by.
    - `user_ids` integer[], nullable: List of user IDs to filter activity logs by.
    - `project_id` integer, nullable: The ID of the project to export activity logs of.

## Response `201`

Export activity logs

- ObjectJobSchema
  - `status_code` integer, nullable
  - `job_id` integer, nullable: Created job id
  - `failure_reason` string, nullable: Failure reason if status is failure

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
