# Audit logs

Source: https://projectfeed.app/docs/api/audit-logs

Export workspace audit logs for compliance monitoring and SIEM tools, count events, and check the log chain.

-   [Plan Enterprise](https://projectfeed.app/docs/billing)
-   Who Owners and admins
-   [Scopes audit-logs:read](https://projectfeed.app/docs/api/scopes)

The key needs the `audit-logs:read` scope, and its owner must currently be a workspace owner or admin. Keys owned by members and viewers get 403.

## Endpoints

### GET /api/v1/audit-logs

Scope

audit-logs:read

Rate limit

100/min per API key

Query parameters

-   `since` number required
    
    Start of the range, inclusive. Unix timestamp in milliseconds.
    
-   `until` number
    
    End of the range, inclusive. Unix timestamp in milliseconds. Defaults to now and cannot be earlier than since.
    
-   `limit` number
    
    Records to return, from 1 to 1000. Defaults to 100.
    
-   `categories` string
    
    Comma-separated list: authentication, authorization, data_access, data_modification, configuration, security, system
    
-   `eventType` string
    
    Comma-separated event types, such as api_key.created, at most 20
    
-   `actorId` string
    
    Only events by this user ID
    
-   `resourceType` string
    
    Only events on this kind of resource, such as api_key
    
-   `resourceId` string
    
    Only events on this resource
    
-   `status` string
    
    success or failure. Other values return 400.
    
-   `cursor` string
    
    The nextCursor, or X-Next-Cursor header, from the previous page. An invalid cursor returns 400.
    
-   `format` string
    
    Response format: json (default), csv, or cef
    

Request

curl

```
curl --request GET \
  --url 'https://projectfeed.app/api/v1/audit-logs?since=1779600000000' \
  --header 'Authorization: Bearer pf_YOUR_API_KEY'
```

Response

JSON

```
{
  "logs": [
    {
      "id": "log_abc123",
      "organizationId": "ws_abc123",
      "timestamp": "2026-08-01T10:30:00.000Z",
      "timestampUnix": 1785580200000,
      "actorId": "usr_abc123",
      "actorEmail": "jane@example.com",
      "eventType": "api_key.created",
      "eventCategory": "security",
      "resourceType": "api_key",
      "resourceId": "key_abc123",
      "resourceName": "CI deploy bot",
      "action": "create",
      "status": "success",
      "metadata": {
        "keyPrefix": "pf_live_ab",
        "permissions": ["tasks:write"],
        "expiresInDays": 90
      },
      "sequenceNumber": 1042,
      "logHash": "sha256:..."
    }
  ],
  "meta": {
    "count": 1,
    "since": 1785580200000,
    "until": 1785583800000,
    "hasMore": false,
    "nextCursor": null
  }
}
```

### GET /api/v1/audit-logs/stats

Scope

audit-logs:read

Query parameters

-   `since` number|string
    
    Start of the range, as Unix milliseconds or an ISO 8601 time with a timezone. Defaults to 30 days before until.
    
-   `until` number|string
    
    End of the range, in the same formats. Defaults to now. A since after until is refused with 400.
    

Request

curl

```
curl --request GET \
  --url 'https://projectfeed.app/api/v1/audit-logs/stats' \
  --header 'Authorization: Bearer pf_YOUR_API_KEY'
```

Response

JSON

```
{
  "totalLogs": 120,
  "truncated": false,
  "maxRowsScanned": 10000,
  "source": "counters",
  "byCategory": { "security": 80, "data_modification": 40 },
  "byStatus": { "success": 110, "failure": 10 },
  "byRetention": { "hot": 100, "warm": 20, "cold": 0 },
  "recentActivity": [{ "date": "2026-10-14", "count": 5 }]
}
```

### GET /api/v1/audit-logs/verify

Scope

audit-logs:read

Query parameters

-   `startSequence` number
    
    First sequence number to check, 1 or more
    
-   `endSequence` number
    
    Last sequence number to check, 1 or more
    
-   `maxLogs` number
    
    Most records to check, 1 to 10,000 (default 1,000)
    

Request

curl

```
curl --request GET \
  --url 'https://projectfeed.app/api/v1/audit-logs/verify' \
  --header 'Authorization: Bearer pf_YOUR_API_KEY'
```

Response

JSON

```
{
  "valid": false,
  "totalLogs": 1000,
  "verifiedLogs": 1000,
  "errors": [],
  "truncated": true,
  "hasMore": true,
  "nextSequence": 1001
}
```

## Event categories

Pass one or more categories, separated by commas, to `categories`. An unknown category returns 400. The event names below are examples. The list grows as the product records more events.

`authorization` Membership and access policy changes, such as member.invited, member.removed, member.role_changed, and personal_tool.policy_changed.

`configuration` Settings and integration changes, such as admin_controls.updated, security_settings.updated, integration.connected, webhook.created, and webhook.disabled.

`data_access` Exports and sensitive reads, such as data.exported and legal_hold.exported.

`data_modification` Content and account changes, such as post.created, task.status_changed, project.deleted, media.deleted, and account.deleted.

`security` Credential and protection events, such as api_key.created, api_key.rotated, api_key.revoked, ip_allowlist.ip_blocked, and legal_hold.created.

`authentication` A valid filter value for sign-in related events.

`system` A valid filter value for system-level events.

## Exported fields

Every JSON record can carry these fields. A field with no value is left out.

`id` The record ID. Use it to remove duplicates.

`organizationId` The workspace ID.

`timestamp, timestampUnix` When the event happened, as an ISO 8601 string and as milliseconds.

`actorId, actorEmail, actorIp, actorUserAgent` Who did it and from where.

`actorSessionId, actorAuthMethod, actorMfaUsed` The session, how the actor signed in, and whether MFA was used.

`eventType, eventCategory` The event name and its category.

`resourceType, resourceId, resourceName` The thing the event affected.

`previousValue, newValue` Before and after values for a change.

`action, status` What was done, and success or failure.

`metadata, errorMessage` Event details, and the error for a failure.

`requestId` The ID of the API request, when there was one.

`sequenceNumber, logHash` The record's position in the workspace's log and its hash, for integrity checks.

## Export formats

`json` The default. Returns logs and a meta object with count, since, until, hasMore, and nextCursor.

`csv` A header row and one row per record, with the same fields in snake_case such as event_type and timestamp_unix. Metadata is a JSON string. The response is an attachment named audit-logs.csv.

`cef` One Common Event Format line per record, as plain text, for SIEM tools.

Every format sets `X-Total-Count` to the number of records returned and `X-Has-More` to the same value as `hasMore`. When more records remain, every format also sets `X-Next-Cursor`.

## Page through a time range

Records come back oldest first, and `since` and `until` both include their boundary. When more records remain, the JSON `meta.nextCursor` and the `X-Next-Cursor` header hold the cursor for the next page. The cursor is the last sequence number. It is null in the JSON when no records remain.

Shell

```
curl "https://projectfeed.app/api/v1/audit-logs?since=1785580200000&until=1785583800000&categories=authentication,security&limit=1000"   -H "Authorization: Bearer pf_YOUR_API_KEY"
```

1.  Request the range with `limit=1000`.
2.  If a cursor came back, request again with it as `cursor` and the same filters, range, and format.
3.  Stop when no cursor comes back. You have the whole range.
4.  Store the range and filters with the records you export, and drop duplicates by `id` if you ever restart a range.

## Statistics and chain check

`GET /audit-logs/stats` counts events in a range, which defaults to the last 30 days. `byCategory`, `byStatus`, and `byRetention` are counts, and `recentActivity` is one count per day. `source` is `counters` when daily totals answered the request, or `scan` when the API counted records directly. A scan reads at most 10,000 records, and `truncated` is true when it stopped there.

`GET /audit-logs/verify` walks the hash chain and reports whether any record was edited or removed. It checks up to `maxLogs` records, from 1 to 10,000, and starts at `startSequence` when you send one. When `valid` is false, `firstInvalidSequence` is the first bad record and `errors` lists each failure with its sequence number. A value out of range, or a `startSequence` after `endSequence`, returns 400.

`valid` is true only when every record in the range was checked. When more records remain, `truncated` and `hasMore` are true, `valid` is false even if `errors` is empty, and `nextSequence` is the `startSequence` for the next call, and is null when nothing remains. Repeat until `hasMore` is false.

Shell

```
curl "https://projectfeed.app/api/v1/audit-logs/verify?maxLogs=5000"   -H "Authorization: Bearer pf_YOUR_API_KEY"
```

## Fix an audit export

### 400 Bad Request

since is missing or not a number, until is earlier than since, limit is outside 1 to 1000, format, status, or a category is not one of the listed values, more than 20 event types were sent, or the cursor is not valid.

### 403 Forbidden

Check the audit-logs:read scope, that the key owner is currently an owner or admin, and that the workspace is on Enterprise.

### 429 Too Many Requests

Wait for Retry-After and poll less often. One request can return up to 1,000 records.

### The receiver reports a gap

Compare the stored range boundaries, request the missing range again, and drop duplicates by id before you import.

See [API errors](https://projectfeed.app/docs/api/errors) and [rate limits](https://projectfeed.app/docs/api/rate-limits).
