---
title: "Platform audit trail (Greentally staff only)"
method: GET
path: "/internal/platform-audit"
tags: ["PlatformOps"]
---

# Platform audit trail (Greentally staff only)

`GET /internal/platform-audit`

Staff changes to platform-owned data, newest recorded first (by insertion; a backdated row such as an expiry is listed when it was recorded and shows its own createdAt). Requires a Greentally platform capability; a customer organization role never grants one. Refused with 403 PLATFORM_CAPABILITY_REQUIRED.

## Query parameters

- `targetType` string
- `targetId` string
- `actor` string
- `capability` 'factor_library.write' | 'support.access'
- `organizationId` string
- `cursor` string
- `limit` integer

## Response `200`

Platform audit events, newest first

- PlatformAuditEventListResponse
  - `data` object, required
    - `items` PlatformAuditEvent[], required
      - `action` string, required
      - `actorEmail` string, nullable, required
      - `actorKind` 'staff' | 'org_admin' | 'system', required
      - `actorUserId` string, required — Clerk user id of the staff member
      - `after` unknown, required
      - `before` unknown, required
      - `capability` string, required
      - `createdAt` string, date-time, required
      - `id` string, required
      - `reason` string, required
      - `responseStatus` integer, nullable, required — A staff write's HTTP status; null for other rows or before the handler finished
      - `scopeAccountId` string, nullable, required — Null for a global change (platform-owned data every organization reads)
      - `scopeOrganizationId` string, nullable, required
      - `targetId` string, required
      - `targetType` string, required
    - `nextCursor` string, nullable, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

## Changes

- **2026-10-02** `766c2a40e369` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/greentally/apis/esgai-api/changes/internal/platform-audit/get.md)

---

[API](https://skmtc.dev/greentally/apis/esgai-api.md) · [All operations](https://skmtc.dev/greentally/apis/esgai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/greentally/apis/esgai-api/revisions/4189686230ca?raw)
