---
title: Audit API
path: reference/api/audit
status: published
---

# Audit API

Reference for the `Audit` endpoint group — 5 endpoints.

Generated from the live OpenAPI spec. Re-run `_generate_api_reference.py` after backend changes.

## Authentication

All endpoints require a Bearer JWT in the `Authorization` header unless noted otherwise. See [Concepts → Tokens and scopes](/docs/scaikey/concepts/tokens-and-scopes) and [Reference → OAuth endpoints](/docs/scaikey/reference/oauth-endpoints) for how to obtain one.

## Endpoints

### **GET** `/api/v1/admin/audit/`

_List Audit Logs_

List audit logs with filtering.

**Parameters:**

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `page` | query | no | `integer` |  |
| `per_page` | query | no | `integer` |  |
| `tenant_id` | query | no | `string` \| `null` |  |
| `partner_id` | query | no | `string` \| `null` | Filter by partner (all tenants in partner) |
| `actor_id` | query | no | `string` \| `null` |  |
| `actor_email` | query | no | `string` \| `null` |  |
| `action` | query | no | `string` \| `null` |  |
| `resource_type` | query | no | `string` \| `null` |  |
| `resource_id` | query | no | `string` \| `null` |  |
| `result` | query | no | `string` \| `null` |  |
| `start_time` | query | no | `string` (`date-time`) \| `null` |  |
| `end_time` | query | no | `string` (`date-time`) \| `null` |  |
| `ip_address` | query | no | `string` \| `null` |  |
| `authorization` | header | no | `string` \| `null` |  |

**Responses:**

| Status | Body |
|---|---|
| `200` | `application/json` → object |
| `422` | `application/json` → [`HTTPValidationError`](#schema-httpvalidationerror) |

---

### **GET** `/api/v1/admin/audit/actions`

_List Audit Actions_

Get list of all audit action types.

**Parameters:**

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `authorization` | header | no | `string` \| `null` |  |

**Responses:**

| Status | Body |
|---|---|
| `200` | `application/json` → object |
| `422` | `application/json` → [`HTTPValidationError`](#schema-httpvalidationerror) |

---

### **GET** `/api/v1/admin/audit/resource-types`

_List Resource Types_

Get list of all resource types in audit logs.

**Parameters:**

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `authorization` | header | no | `string` \| `null` |  |

**Responses:**

| Status | Body |
|---|---|
| `200` | `application/json` → object |
| `422` | `application/json` → [`HTTPValidationError`](#schema-httpvalidationerror) |

---

### **GET** `/api/v1/admin/audit/stats`

_Get Audit Stats_

Get audit log statistics.

**Parameters:**

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `tenant_id` | query | no | `string` \| `null` |  |
| `start_time` | query | no | `string` (`date-time`) \| `null` |  |
| `end_time` | query | no | `string` (`date-time`) \| `null` |  |
| `authorization` | header | no | `string` \| `null` |  |

**Responses:**

| Status | Body |
|---|---|
| `200` | `application/json` → object |
| `422` | `application/json` → [`HTTPValidationError`](#schema-httpvalidationerror) |

---

### **GET** `/api/v1/admin/audit/{log_id}`

_Get Audit Log_

Get a single audit log entry with full details.

**Parameters:**

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `log_id` | path | yes | `string` |  |
| `authorization` | header | no | `string` \| `null` |  |

**Responses:**

| Status | Body |
|---|---|
| `200` | `application/json` → object |
| `422` | `application/json` → [`HTTPValidationError`](#schema-httpvalidationerror) |

---

## Schemas

Definitions for every type referenced by the endpoints above. Schema-to-schema references on this page link within the page; cross-page references would require visiting the linked page.

### `HTTPValidationError`

| Field | Type | Required | Description |
|---|---|---|---|
| `detail` | array of [`ValidationError`](#schema-validationerror) | no |  |

### `ValidationError`

| Field | Type | Required | Description |
|---|---|---|---|
| `loc` | array of `string` \| `integer` | yes |  |
| `msg` | `string` | yes |  |
| `type` | `string` | yes |  |
