# Audit log of the key's organization (server API)

```http
GET /v1/audit_events
```

Source: https://docs.tryyoursize.com/api/reference/operations/listauditeventswithkey/

**Key scopes:** `audit:read`. A secret key (`sk_`) has every scope; a restricted key (`rk_`) needs the scopes listed.

The audit log of the secret key's organization, newest first. Same filters as the Studio listing (no CSV). Secret keys (sk_) and restricted keys (rk_) with the `audit:read` scope.

## Authentication

Secret key (`sk_…`) or restricted key (`rk_…`) from your server: `Authorization: Bearer sk_…`.

## Parameters

- `cursor` (query, `string`, optional)
- `action` (query, `string`, optional)
- `actor` (query, `string`, optional): actor_type:actor_id
- `store_id` (query, `string (uuid)`, optional): Only events of this store
- `target` (query, `string`, optional): target_type or target_type:target_id, e.g. api_key:<id>
- `from` (query, `string (date-time)`, optional): Events at or after this time
- `to` (query, `string (date-time)`, optional): Events before this time
- `limit` (query, `integer`, optional): Page size (default 50, at most 200; ignored by the CSV export)

## Responses

### 200

OK (`AuditEventPage`)

- `events` (`AuditEvent[]`, required)
  - `id` (`string (uuid)`, required)
  - `organization_id` (`string (uuid)`, optional)
  - `store_id` (`string (uuid)`, optional)
  - `actor_type` (`"user" | "api_key" | "partner_user" | "staff" | "system" | "shopify"`, required)
  - `actor_id` (`string`, required)
  - `actor_label` (`string`, optional)
  - `on_behalf_of` (`string (uuid)`, optional)
  - `action` (`string`, required)
  - `target_type` (`string`, optional)
  - `target_id` (`string`, optional)
  - `metadata` (`object`, optional)
  - `ip` (`string`, optional)
  - `user_agent` (`string`, optional)
  - `request_id` (`string`, optional)
  - `created_at` (`string (date-time)`, required)
- `next_cursor` (`string`, optional)

### 400

Invalid request (`Error`)

### 401

Missing or invalid credentials (`Error`)

## Example

```bash
curl -X GET https://api.tryyoursize.com/v1/audit_events \
  -H "Authorization: Bearer $TRYYOURSIZE_SECRET_KEY" \
  -H "TYS-Version: 2026-10-25"
```

## In the SDKs

- Node.js: [`tys.auditEvents.list()`](https://docs.tryyoursize.com/reference/node/audit-events-list.md)
- Python: [`tys.audit_events.list()`](https://docs.tryyoursize.com/reference/python/audit-events-list.md)
