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

# Retrieve audit logs chain

`GET /logs-chain`

## Request

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

Retrieves a chain of audit logs for a specific owner. If a cursor is not provided, the first page is returned.

Output is ordered chronologically, from newest to oldest.

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

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

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

## Query parameters

- `cursor` string
- `limit` integer

## Response `200`

Audit logs chain retrieved successfully

- object
  - `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
  - `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
  - `items` AuditLog[]: List of audit logs in the chain
    - `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)
