---
title: "Retrieve audit logs"
method: GET
path: "/logs"
tags: ["Audit Logs"]
---

# Retrieve audit logs

`GET /logs`

## Request

- Base URL: `https://audit-api-prod.datalab.mendix.com/v1`
- URL: `https://audit-api-prod.datalab.mendix.com/v1/logs`
- Auth: one of:
  - HTTP bearer
  - API key in header `Authorization`

Retrieves a list of audit logs filtered by Owner ID with pagination, sorting, and filtering support.

The Owner ID is derived from the token used in the request.

Logs cannot be retrieved for an Owner ID that is different to the one in the token.

Authorization
-------------

`Authorization: Bearer <sso_token>` or `Authorization: MxToken <token>`

Requires the **`mx:audit-logging:read`** scope.

## Query parameters

- `eventOutcome` string
- `resourceId` string
- `contextId` string
- `contextType` string
- `resourceType` string
- `q` string
- `from` string, date-time
- `to` string, date-time
- `page` integer
- `limit` integer
- `sortBy` 'timestamp' | 'logId'
- `sortOrder` 'asc' | 'desc'

## Response `200`

Audit logs retrieved successfully

- object
  - `pagination` Pagination
    - `self` string: URL of the current page
    - `page` integer: Current page number
    - `pageSize` integer: Number of items in the current page
    - `total` integer: Total number of items across all pages
  - `cursors` Cursors
    - `self` string: URL of the current page
    - `prev` string: URL of the previous page, if available
    - `next` string: URL of the next page, if available
    - `first` string: URL of the first page
    - `last` string: URL of the last page
  - `items` AuditLog[]: List of audit logs for the current page
    - `logId` string, required: Unique identifier of the audit log record
    - `timestamp` string, date-time, required: Date and time the event occurred, in ISO 8601 UTC format
    - `ownerId` string, required: The unique identifier of the owner
    - `ownerIdType` 'CompanyID' | 'PlatformAccountID', required: The type of ownerId. Only CompanyID and PlatformAccountID are supported.
    - `internalService` string, required: This field identifies the service that produced the audit log, and can be used to retrieve logs for the service.
    - `externalService` 'Mendix Portal' | 'Deployment' | 'Control Center' | 'Marketplace' | 'Compass' | 'Portfolio' | 'Catalog', required: The external system or service involved in the event
    - `client` Client, required
      - `userUuid` string: UserID of the logged-in user
      - `userAccountEmail` string, email, required: Email of the user who performed the action
      - `userName` string, required: Name of the logged-in user
      - `ipAddress` string, ipv4: IP address from where the request originated
      - `originType` 'User' | 'API' | 'SystemScheduledTask': Source of the request
    - `event` Event, required
      - `action` string, required: Action taken
      - `description` string, required: Description of the event, clarifying what happened
      - `outcome` 'SuccessAction' | 'Error' | 'Warning' | 'FailedAudit' | 'SuccessAudit', required: Result of the event
      - `errorMessage` string: Details about the outcome, especially in case of failure
      - `oldValue` string: Previous value before the change
      - `newValue` string: New value after the change
      - `resource` Resource
        - `resourceId` string: Unique identifier for the affected resource
        - `resourceType` 'Company' | 'Project' | 'Environment' | 'GenAIResource' | 'User' | 'ProjectRole' | 'Portfolio' | 'MarketplaceComponent' | 'Story' | 'Epic' | 'FeedbackItem' | 'Backup' | 'Page' | 'AppLog' | 'AccessLog' | 'AuditLog' | 'ApprovalRequest'
        - `name` string: Name of the resource
        - `description` string: Details of the resource
      - `context` Context
        - `contextId` string: Unique identifier for the affected resource context
        - `contextType` 'Company' | 'Project' | 'Environment' | 'GenAIResource' | 'User' | 'ProjectRole' | 'Portfolio' | 'MarketplaceComponent' | 'Story' | 'Epic' | 'FeedbackItem' | 'Backup' | 'Page' | 'AppLog' | 'AccessLog' | 'AuditLog' | 'ApprovalRequest'
        - `name` string: Name of the resource context
        - `description` string: Details

## Other responses

- `400`: Bad request, invalid input
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal server error, please try again later

---

[API](https://skmtc.dev/mendix/apis/audit-logging-api-v1.md) - [All operations](https://skmtc.dev/mendix/apis/audit-logging-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/mendix/apis/audit-logging-api-v1/revisions/c8f31328b50d?raw)
