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

# Activity Log

> Read the global subscription activity log or the per-subscription event timeline — with filtering, sorting, and full state-diff payloads.

The activity log endpoints give you a tamper-evident audit trail for all subscription lifecycle events. You can query the global log for DataTable views, fetch the full state-diff payload for a single event, or retrieve the ordered timeline scoped to one subscription. All routes are read-only, require an authenticated Medusa Admin user, and default to `created_at desc` ordering.

> [!NOTE]
>
> All routes require an authenticated Medusa Admin user. Unauthenticated requests return `401`.

## Actor type values

| Value | Meaning |
| - | - |
| `user` | Medusa Admin user |
| `customer` | Storefront customer who triggered the action |
| `system` | Internal system action |
| `scheduler` | Scheduled job |

## Event type groups

Events are namespaced by domain: `subscription.*`, `renewal.*`, `dunning.*`, `cancellation.*`.

The `subscription.*` group includes the initial `subscription.created` event written when a subscription is first created through storefront checkout.

***

## GET /admin/subscription-logs

Returns the paginated global activity log for Admin DataTable views.

### Query parameters

**limit** `number`

Number of results per page.

**offset** `number`

Zero-based result offset for pagination.

**q** `string`

Free-text search.

**order** `string`

Field to sort by. Database-backed: `created_at`, `event_type`, `actor_type`. In-memory: `subscription_reference`, `customer_name`, `reason`.

**direction** `string`

Sort direction. One of `asc` or `desc`. Defaults to `desc`.

**subscription\_id** `string`

Filter to events for a specific subscription.

**customer\_id** `string`

Filter to events for a specific customer.

**event\_type** `string | string[]`

Filter by event type. Accepts a single value or an array.

**actor\_type** `string | string[]`

Filter by actor type. Accepts a single value or an array.

**date\_from** `string`

ISO datetime lower bound for `created_at`.

**date\_to** `string`

ISO datetime upper bound for `created_at`.

### Response

**subscription\_logs** `object[]` *required*

Array of activity log list items.

**log item properties**

**id** `string`

Log record ID.

**subscription\_id** `string`

ID of the linked subscription.

**event\_type** `string`

Namespaced event type (e.g. `subscription.paused` or `subscription.created`).

**actor\_type** `string`

Type of actor that triggered the event.

**actor\_id** `string | null`

Raw actor ID, or `null` for system/scheduler actors.

**actor** `object`

Enriched actor summary with `type`, `id`, `email`, `name`, and `display`.

**subscription** `object`

Subscription summary with reference, customer name, product info, and variant title.

**reason** `string | null`

Reason recorded with the event, or `null`.

**change\_summary** `string`

Comma-separated list of changed field names.

**created\_at** `string`

Event timestamp.

**count** `number` *required*

Total matching records.

**limit** `number` *required*

Page size used.

**offset** `number` *required*

Result offset used.

```json Response example theme={null}
{
  "subscription_logs": [
    {
      "id": "slog_123",
      "subscription_id": "sub_123",
      "event_type": "subscription.created",
      "actor_type": "customer",
      "actor_id": "cus_123",
      "actor": {
        "type": "customer",
        "id": "cus_123",
        "email": null,
        "name": "Jane Doe",
        "display": "Jane Doe"
      },
      "subscription": {
        "subscription_id": "sub_123",
        "reference": "SUB-001",
        "customer_id": "cus_123",
        "customer_name": "Jane Doe",
        "product_title": "Coffee Subscription",
        "variant_title": "1 kg"
      },
      "reason": null,
      "change_summary": "subscription_created",
      "created_at": "2026-04-15T10:00:00.000Z"
    }
  ],
  "count": 1,
  "limit": 20,
  "offset": 0
}
```

### Errors

| Code | Error | Meaning |
| - | - | - |
| `400` | `invalid_data` | Invalid query parameter shape or unsupported sort field |

***

## GET /admin/subscription-logs/:id

Returns the full detail payload for a single activity log event, including the previous state, new state, and a field-level diff.

### Path parameters

**id** `string` *required*

Activity log record ID.

### Response

Returns a `subscription_log` object with all list fields plus:

**subscription\_log** `object` *required*

**additional detail fields**

**previous\_state** `object | null`

State snapshot before the event.

**new\_state** `object | null`

State snapshot after the event.

**changed\_fields** `object[]`

Field-level diff. Each entry has `field`, `before`, and `after`.

**metadata** `object | null`

Event-specific metadata (e.g. linked `renewal_cycle_id` or `order_id`).

```json Response example theme={null}
{
  "subscription_log": {
    "id": "slog_123",
    "subscription_id": "sub_123",
    "event_type": "renewal.succeeded",
    "actor_type": "scheduler",
    "actor_id": null,
    "actor": {
      "type": "scheduler",
      "id": null,
      "email": null,
      "name": null,
      "display": null
    },
    "subscription": {
      "subscription_id": "sub_123",
      "reference": "SUB-001",
      "customer_id": "cus_123",
      "customer_name": "Jane Doe",
      "product_title": "Coffee Subscription",
      "variant_title": "1 kg"
    },
    "reason": null,
    "change_summary": "status, processed_at",
    "created_at": "2026-04-15T10:03:00.000Z",
    "previous_state": {
      "status": "scheduled"
    },
    "new_state": {
      "status": "succeeded"
    },
    "changed_fields": [
      {
        "field": "status",
        "before": "scheduled",
        "after": "succeeded"
      }
    ],
    "metadata": {
      "renewal_cycle_id": "re_123",
      "order_id": "order_123"
    }
  }
}
```

### Errors

| Code | Error | Meaning |
| - | - | - |
| `404` | `not_found` | Activity log record does not exist |

***

## GET /admin/subscriptions/:id/logs

Returns the paginated activity log timeline scoped to a single subscription. Accepts the same query parameters as the global list and applies `subscription_id = :id` automatically.

### Path parameters

**id** `string` *required*

Subscription ID.

### Query parameters

Same as `GET /admin/subscription-logs`. Default sort is `created_at desc`.

### Response

Same shape as `GET /admin/subscription-logs`.

```json Response example theme={null}
{
  "subscription_logs": [
    {
      "id": "slog_123",
      "subscription_id": "sub_123",
      "event_type": "subscription.paused",
      "actor_type": "user",
      "actor_id": "user_123",
      "actor": {
        "type": "user",
        "id": "user_123",
        "email": "admin@example.com",
        "name": "Admin User",
        "display": "admin@example.com"
      },
      "subscription": {
        "subscription_id": "sub_123",
        "reference": "SUB-001",
        "customer_id": "cus_123",
        "customer_name": "Jane Doe",
        "product_title": "Coffee Subscription",
        "variant_title": "1 kg"
      },
      "reason": "customer requested pause",
      "change_summary": "status, paused_at",
      "created_at": "2026-04-15T10:00:00.000Z"
    }
  ],
  "count": 1,
  "limit": 20,
  "offset": 0
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.