---
title: Audit
description: 'Audit endpoints: 3 operations.'
canonical: 'https://lightning.ai/docs/platform/cluster/api-reference/audit'
---
# Audit {#audit}

## List recent audit logs for your organization {#list-recent-audit-logs-for-your-organization}

`GET /v1/audit-logs`

Returns the most recent audit events for the authenticated caller's organization — who did what, when, and from where. Scoped automatically to your organization (derived from your token); you cannot query another organization's activity.

**When to use:**
- Let an organization owner review what users in their org have been doing
- Investigate recent access or changes across your fleets

**Scope & limits:**
- Returns up to the 2000 most recent events, newest first.
- Covers roughly the last 36 hours of activity. Older activity is available through the 90-day archive export.
- No filtering or pagination yet.

**Note:** Actions taken by Lightning AI support staff are attributed to their own organization and are not included here.

**Responses**

| Status | Description | Body |
|--------|-------------|------|
| `200` | The most recent audit events for your organization (up to 2000, newest first). Returns an empty list when there is no recent activity. | [AuditLogListResponse](/docs/platform/cluster/api-reference/schemas.md#auditloglistresponse) |
| `401` | Unauthenticated - missing or invalid token | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `500` | Internal server error before the audit query could run | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `502` | The upstream audit log store failed or timed out | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |

**Example request**

```bash
curl "$API_URL/v1/audit-logs" \
  -H "Authorization: Bearer $TOKEN"
```

## Check the 90-day audit log export and get its download URL {#check-the-90-day-audit-log-export-and-get-its-download-url}

`GET /v1/audit-logs/export`

Reports the state of your organization's 90-day audit export and, once it is `ready`, returns a short-lived presigned download URL. Start an export with `POST /v1/audit-logs/export` first; this endpoint only reports and never starts one, so it is safe to poll.

**Statuses:**
- `notStarted` — no archive exists for today's window and no build is running. Call `POST` to start one.
- `running` — a build is in progress. Poll again in a few seconds.
- `ready` — the archive is complete; `url` and `expiresAt` are present.
- `failed` — the build did not finish; `error` carries a short reason. Call `POST` to try again.

**Format:** gzip-compressed NDJSON (`.ndjson.gz`) — one audit event per line, oldest first.

**Note:** the returned `url` expires within minutes — download promptly, and call this endpoint again for a fresh URL if it lapses. The archive itself persists for the rest of the UTC day. Actions taken by Lightning AI support staff are attributed to their own organization and are not included here.

**Responses**

| Status | Description | Body |
|--------|-------------|------|
| `200` | The current state of your organization's 90-day export, including a presigned download URL when it is ready. | [AuditLogExportStatusResponse](/docs/platform/cluster/api-reference/schemas.md#auditlogexportstatusresponse) |
| `401` | Unauthenticated - missing or invalid token | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `403` | Authenticated but not permitted to export audit logs | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `500` | Internal server error before the status could be read (for example, audit export is not configured for this deployment) | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `502` | An upstream dependency failed while reading the export status or minting the download URL (object storage was unreachable) | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |

**Example request**

```bash
curl "$API_URL/v1/audit-logs/export" \
  -H "Authorization: Bearer $TOKEN"
```

## Start building the 90-day audit log export for your organization {#start-building-the-90-day-audit-log-export-for-your-organization}

`POST /v1/audit-logs/export`

Starts preparing a downloadable archive of your organization's audit events for the trailing 90 days, and returns immediately — building it takes longer than a request can wait. Poll `GET /v1/audit-logs/export` until `status` is `ready`, then download the `url` it returns. Scoped automatically to your organization (derived from your token); you cannot export another organization's activity.

**When to use:**
- Produce 90 days of audit evidence for a SOC 2 or customer security review
- Retain or analyze activity beyond the recent-events endpoint's bounded preview

**Window:** whole days only. The archive covers the 90 days ending at the most recent UTC midnight, so the current partial day is excluded and every caller on the same UTC day gets the identical archive. There are no parameters — the window is fixed, which is what makes the archive reusable.

**Idempotent:** safe to call repeatedly. If today's archive is already built this returns `ready` without doing any work; if a build is already running it returns `running` rather than starting a second one. At most one archive is built per organization per UTC day.

**Expect a wait** on the first call of a UTC day — typically under a minute, and longer for organizations with high activity. Subsequent calls the same day are immediate.

**Responses**

| Status | Description | Body |
|--------|-------------|------|
| `202` | Accepted. The response carries the current status: `running` when this call started the build (or found one already in progress), or `ready` when today's archive already existed and no work was needed. | [AuditLogExportStatusResponse](/docs/platform/cluster/api-reference/schemas.md#auditlogexportstatusresponse) |
| `401` | Unauthenticated - missing or invalid token | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `403` | Authenticated but not permitted to export audit logs | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `500` | Internal server error before the export could be started (for example, audit export is not configured for this deployment) | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |
| `502` | An upstream dependency failed while starting the export (object storage was unreachable) | [ErrorResponse](/docs/platform/cluster/api-reference/schemas.md#errorresponse) |

**Example request**

```bash
curl -X POST "$API_URL/v1/audit-logs/export" \
  -H "Authorization: Bearer $TOKEN"
```

---

**Navigation**

- Parent: [API reference](/docs/platform/cluster/api-reference.md)
