> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit Logs API

### Overview

<Info>
  **Prerequisites:**

  * This feature is available with the [**Paradime Security pack**](https://www.paradime.io/security).
  * Your API keys ***must*** have the Audit Logs viewer capability.
</Info>

<Info>
  The examples below authenticate with an **account API key** — pass `Authorization: Bearer <token>` and `X-Paradime-Workspace: <workspace_uid>` (the account key starts with `prdm_cmp_`). Legacy **workspace API keys** are still supported: send `X-API-KEY` and `X-API-SECRET` headers instead. See API Keys.
</Info>

The Audit Log API enables you to access and retrieve audit logs associated with your Paradime account.

### Fetch Audit Logs

This endpoint enables fetching Audit logs metadata for all event types and workspaces in your account.

**Example Request**

<Tabs>
  <Tab title="GraphQL">
    ```python theme={"system"}
    import requests
    import os

    # API credentials
    api_endpoint = "<YOUR_API_ENDPOINT>"
    api_token = "<YOUR_API_TOKEN>"          # account API key (starts with prdm_cmp_)
    workspace_uid = "<YOUR_WORKSPACE_UID>"

    graphql_query = """
    query GetAuditLogs {
        getAuditLogs {
            auditLogs {
                id
                createdDttm
                updatedDttm
                workspaceId
                workspaceName
                actorType
                actorUserId
                actorEmail
                eventSourceId
                eventSource
                eventId
                eventType
                metadataJson
            }
        }
    }
      """
      
    response = requests.post(api_endpoint, json={"query": graphql_query}, headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_token}",
          "X-Paradime-Workspace": workspace_uid,
      })

    print(response.json())
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"system"}
    curl --location --request POST '<YOUR_API_ENDPOINT>' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <YOUR_API_TOKEN>' \
    --header 'X-Paradime-Workspace: <YOUR_WORKSPACE_UID>' \
    --data-raw '{
      "query": "query GetAuditLogs { getAuditLogs { auditLogs { id createdDttm updatedDttm workspaceId workspaceName actorType actorUserId actorEmail eventSourceId eventSource eventId eventType metadataJson } } }"
    }'
    ```
  </Tab>
</Tabs>

<Accordion title="Example Response">
  ```json theme={"system"}
  {
    "auditLogs": [
      {
        "id": 1,
        "createdDttm": "2024-02-13 16:09:29.718805",
        "updatedDttm": "2024-02-13 16:09:29.718809",
        "workspaceId": 2,
        "workspaceName": "data_platform",
        "actorType": "user",
        "actorUserId": 4,
        "actorEmail": "john@acme.io",
        "eventSourceId": 0,
        "eventSource": "bolt",
        "eventId": 12,
        "eventType": "schedule_manual_run",
        "metadataJson": {
          "schedule_name_uuid": "e3a1e416-f778-3fa5-aac9-10288466cfb5",
          "schedule": {
            "name": "daily run"
          }
        }
      },
      ...
      }
    ]
  }
  ```
</Accordion>


## Related topics

- [Audit Log](/developers/python-sdk/modules/audit-log.md)
- [Audit Logs](/products/settings/audit-logs.md)
- [GraphQL API](/developers/graphql-api/index.md)
- [API Reference](/developers/graphql-api/api-reference/index.md)
- [API Keys](/developers/api-keys.md)
