# Audit Logs (Coinbax Core API)

> Source: https://developers.coinbax.com/reference/coinbax-core/audit-logs/
> Staging base URL: https://core-staging.coinbax.com/api/v1

Audit log access

## List workspace audit logs

`GET /workspaces/{id}/audit-logs`

- Auth: Bearer token
- Operation ID: `listWorkspaceAuditLogs`

Get audit logs for a workspace.

**Permissions:** ADMIN or SUPER_ADMIN only

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | Workspace ID |
| `page` | query | integer | no |  |
| `limit` | query | integer | no |  |

### Example request

```bash
curl https://core-staging.coinbax.com/api/v1/workspaces/<id>/audit-logs \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Responses

**200** Audit logs retrieved successfully

```json
{
  "success": true,
  "meta": {
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 150,
      "totalPages": 8
    }
  },
  "data": [
    {
      "id": "9f8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "userId": "9f8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "workspaceId": "9f8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "action": "user.login",
      "resourceType": "user",
      "resourceId": "9f8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "details": "string",
      "changes": {},
      "success": true,
      "errorMessage": "string",
      "ipAddress": "string",
      "userAgent": "string",
      "metadata": {},
      "createdAt": "2026-01-15T12:00:00.000Z"
    }
  ]
}
```

**401** Unauthorized - missing or invalid authentication

**403** Forbidden - insufficient permissions

**404** Resource not found

**500** Internal server error

---

## List all audit logs

`GET /audit-logs`

- Auth: Bearer token
- Operation ID: `listAllAuditLogs`

### Example request

```bash
curl https://core-staging.coinbax.com/api/v1/audit-logs \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Responses

**200** Audit logs retrieved

---

## Get audit log entry

`GET /audit-logs/{id}`

- Auth: Bearer token
- Operation ID: `getAuditLog`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes |  |

### Example request

```bash
curl https://core-staging.coinbax.com/api/v1/audit-logs/<id> \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Responses

**200** Log retrieved

---

## Export audit logs

`GET /audit-logs/export`

- Auth: Bearer token
- Operation ID: `exportAuditLogs`

### Example request

```bash
curl https://core-staging.coinbax.com/api/v1/audit-logs/export \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Responses

**200** Export file

---

## Get audit log statistics

`GET /audit-logs/stats`

- Auth: Bearer token
- Operation ID: `getAuditLogStats`

### Example request

```bash
curl https://core-staging.coinbax.com/api/v1/audit-logs/stats \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Responses

**200** Statistics retrieved
