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

# Audit Logs Event Catalog | Magnific API

> Reference of the Magnific audit-log events: what each event type means, the fields it carries, and how to join generations, credit charges, refunds, files and downloads.

> [card] What each event means
>
> The event types returned by [`GET /v1/analytics/audit-logs/events`](https://docs.magnific.com/api-reference/audit-logs/events) and by the [CSV export](https://docs.magnific.com/api-reference/audit-logs/overview.md#export-your-history-as-csv), with the fields each one carries and how to join them.

Every audit event has the same envelope and an event-specific payload in `action.data`. This page documents the envelope, the five event types you need to account for usage, and how to combine them into one row per generation.

## Event envelope

```json theme={null}
{
  "event_id": "7c2f4b1e-5a90-4d3c-8e6f-1b2a3c4d5e6f",
  "date": "2026-11-19T11:38:11.275Z",
  "action": {
    "event_type": "creation.executed",
    "verb": "updated",
    "status": "success",
    "resource_id": "Xk3mPq9LwZ",
    "request_id": "ak-5f1d0c2a9b7e4d63",
    "correlation_id": null,
    "old_state": { "status": "processing" },
    "new_state": { "status": "completed" },
    "duration_ms": 3900,
    "data": {
      "credits": 180,
      "transaction_ids": ["4e8d1a7c-2b5f-4c63-9a10-6d7e8f9a0b1c"]
    },
    "context": { "tool": "text-to-image", "provider": null, "transport": null },
    "project_name": null,
    "folder_name": null
  },
  "member": {
    "type": "user",
    "user_id": 10499812,
    "email": "designer@company.com",
    "auth": { "type": "session", "api_key_id": null, "api_key_name": null }
  },
  "category": "creation",
  "source": {
    "project": "pikaso",
    "platform": "web",
    "referer": null,
    "ip": "203.0.113.24",
    "user_agent": "Mozilla/5.0"
  }
}
```

| Field | Description |
| - | - |
| `event_id` | Unique identifier of the event. Use it to deduplicate (see [Delivery](#delivery-and-deduplication)) |
| `date` | When it occurred (UTC, ISO-8601 with milliseconds) |
| `action.event_type` | The event type, one of the [types listed below](#all-event-types) |
| `action.verb` | What was done: `created`, `updated`, `deleted`, `consumed`, `refunded`, `downloaded`, `login`... |
| `action.status` | `success` or `failure` |
| `action.resource_id` | The resource the action happened to. Its meaning depends on the event type |
| `action.request_id`, `action.correlation_id` | Identifiers of the request that produced the event |
| `action.old_state`, `action.new_state` | State before and after, on the events that change one. `null` otherwise |
| `action.duration_ms` | How long the action took, when it is measured. `null` otherwise |
| `action.data` | Event-specific payload. A key with no value is left out, not sent as `null` |
| `action.context` | `tool`, `provider` and `transport` of the action. An event without context sends an empty array (`[]`) instead of an object |
| `action.project_name`, `action.folder_name` | Names of the project and folder the event refers to, resolved for you |
| `member` | The actor: `type`, `user_id`, `email`, and `auth` |
| `member.auth` | How the actor was authenticated: `type` is `session` or `api_key`; with an API key, `api_key_id` and `api_key_name` identify it |
| `category` | The resource category the event belongs to |
| `source` | Where it originated: `project` (the service that recorded it), `platform` (`web`, `api`, `mcp`, `agent`, `app_desktop`...), `referer`, `ip`, `user_agent` |

> [!NOTE]
>
> The CSV export carries the same events with one column per field (`action_verb`, `action_data`, `member_auth`...). `action_data`, `action_old_state` and `action_new_state` are JSON objects in their cell. See [the file](https://docs.magnific.com/api-reference/audit-logs/overview.md#the-file).

## Usage events

### `creation.executed`

One event per **status change** of a generation: an image, a video, an audio clip, an upscale, or any other creation. A generation therefore produces several events. Group them by `action.resource_id`.

| Field | Description |
| - | - |
| `action.resource_id` | Identifier of the generation. The same in every event of that generation |
| `action.verb` | `created` on the first event, `updated` on the following ones, `deleted` when the creation is deleted |
| `action.status` | `failure` when the new status is `failed`, `success` otherwise |
| `action.old_state.status`, `action.new_state.status` | Status before and after: `queued`, `processing`, `completed`, `failed`. `old_state` is `null` on the first event and `new_state` is `null` on a deletion |
| `action.duration_ms` | Generation time, on the event that completes it |
| `action.context.tool` | The tool that ran: `text-to-image`, `video-generator`, `voiceover-generator`... |
| `member` | Who requested the generation |

`action.data`:

| Key | Description |
| - | - |
| `credits` | Credits the generation cost. Sent on every event of a generation made in the app, and set to `0` when it fails and the charge is refunded |
| `credits_consumed` | Credits the generation cost, on generations requested through the REST API (`/v1/ai/*`). Sent only on the event that ends the generation, so that adding it up never counts a generation twice |
| `transaction_ids` | Identifiers of the charge. They join the generation to its [`account.credits.consumed`](#account-credits-consumed) events. Missing when nothing was charged |
| `api_key_id` | The API key used, when the generation was requested with one |
| `project_reference` | The project the generation belongs to |
| `reference` | Identifier of the generation, same value as `action.resource_id` in most events |
| `board_uuid`, `workflow_run_id` | The Space and the workflow run that started the generation |
| `deletion_type` | How it was deleted, on `deleted` events (`trash`) |

> [!WARNING]
>
> Compare statuses case-insensitively. Generations made in the app send them in lower case (`completed`); generations requested through the REST API send `CREATED`, `IN_PROGRESS`, `COMPLETED` and `FAILED`.

A generation made in the app, from start to end:

```json theme={null}
[
  { "date": "2026-11-19T11:38:02.410Z", "verb": "created", "old_state": null, "new_state": { "status": "queued" }, "data": { "credits": 180, "transaction_ids": ["4e8d1a7c-2b5f-4c63-9a10-6d7e8f9a0b1c"] } },
  { "date": "2026-11-19T11:38:07.375Z", "verb": "updated", "old_state": { "status": "queued" }, "new_state": { "status": "processing" }, "data": { "credits": 180, "transaction_ids": ["4e8d1a7c-2b5f-4c63-9a10-6d7e8f9a0b1c"] } },
  { "date": "2026-11-19T11:38:11.275Z", "verb": "updated", "old_state": { "status": "processing" }, "new_state": { "status": "completed" }, "data": { "credits": 180, "transaction_ids": ["4e8d1a7c-2b5f-4c63-9a10-6d7e8f9a0b1c"] } }
]
```

Only the fields that change are shown; each element is a full event.

### `account.credits.consumed`

One event per **movement of credits**: a charge (`verb: consumed`) or the refund of a charge (`verb: refunded`). It covers every charge on the team's credits, including the ones that are not a generation.

| Field | Description |
| - | - |
| `action.verb` | `consumed` for a charge, `refunded` for a refund |
| `action.resource_id` | The wallet that was charged or refunded |
| `action.new_state` | Balance left after the movement: `credits` and `credits_addons` |
| `member` | Who was charged, and whether with a session or an API key |

`action.data` on a charge:

| Key | Description |
| - | - |
| `credits_consumed` | Credits charged |
| `quantity` | How many units were billed |
| `quantity_unit` | What one unit counts: `image`, `second`, `megapixel_unit`, `layer`, `character_block_10`, `request`, `provider_cost_unit` or `credit`. Missing when the charge declares no unit |
| `tool` | The billed operation, for example `pikaso-image-ai_image_generator-seedream_5_5_2k` |
| `transaction_ids` | Identifiers of the charge |
| `api_key_id` | The API key charged, when there is one |
| `project_reference` | The project whose budget paid, when a project budget was used |

`action.data` on a refund:

| Key | Description |
| - | - |
| `credits_refunded` | Credits given back |
| `rolled_back_transaction_id` | The charge this refund undoes: one of the `transaction_ids` of that charge |
| `tool` | The billed operation that was refunded |
| `transaction_ids` | Identifiers of the refunded charge |

```json theme={null}
{
  "event_type": "account.credits.consumed",
  "verb": "refunded",
  "status": "success",
  "data": {
    "credits_refunded": 70,
    "rolled_back_transaction_id": "b1f0c3d2-7e64-4a85-9c21-0f3e5d7a9b2c",
    "tool": "pikaso-image-ai_image_generator-seedream_5_5_2k",
    "transaction_ids": ["b1f0c3d2-7e64-4a85-9c21-0f3e5d7a9b2c"]
  },
  "new_state": { "credits": 248319, "credits_addons": 0 }
}
```

> [!NOTE]
>
> A generation requested through the REST API reports its charge on `creation.executed` (`credits_consumed`) and has no `consumed` event of its own, so the same charge is never listed twice. Its refund, if any, still arrives as an `account.credits.consumed` event with `verb: refunded`.

### `project.file.changed`

A file of a project was created or changed. When a generation finishes, the file it produced is saved to a project and this event says where.

| Field | Description |
| - | - |
| `action.resource_id` | Reference of the file |
| `action.verb` | `created` when the file is added, `updated` when it changes |
| `action.project_name`, `action.folder_name` | Names of the project and the folder |

`action.data`:

| Key | Description |
| - | - |
| `creation_sqid` | Identifier of the generation that produced the file: the `action.resource_id` of its `creation.executed` events |
| `creation_id` | Numeric identifier of the same generation |
| `file_type` | `image`, `video` or `audio` |
| `origin` | The tool the file came from: `text-to-image`, `video-generator`, `expand`... |
| `name` | Name of the file |
| `project_reference`, `folder_reference` | The project and the folder that hold the file |
| `changed_fields` | Which fields changed, on `updated` events (for example `name`) |
| `destination_project_reference`, `destination_folder_reference` | Where the file was moved to, on a move |
| `source_file_reference` | The file a copy was made from, on a copy |
| `trigger` | `retention` when the trash retention purged the file, instead of its owner |

### `creation.downloaded`

A member downloaded a creation, or copied it.

| Field | Description |
| - | - |
| `action.resource_id` | Identifier of the generation: the `action.resource_id` of its `creation.executed` events |
| `action.verb` | `downloaded` |
| `member` | Who downloaded it |

`action.data`:

| Key | Description |
| - | - |
| `action` | `download` or `copy` |
| `extension` | Format of the downloaded file: `png`, `jpeg`, `mp4`, `mov`, `mp3`, `zip`... |
| `tool` | The tool the creation was made with |
| `project_reference` | The project the creation belongs to |
| `board_uuid` | The Space it was downloaded from |

### `account.session.login`

A member signed in.

| Field | Description |
| - | - |
| `action.resource_id` | User ID of the member |
| `action.verb` | `login` |
| `action.data.provider` | How they signed in: `password`, `google.com`, `oidc` (single sign-on), or a token exchange made by a connected client (`xaa`, `mcp_session_exchange`) |
| `source.ip`, `source.user_agent` | Where the sign-in came from |

## One row per generation

To build a table with one row per generation, its cost and what happened to it:

**1. Read the generations**

Read `creation.executed` and group the events by `action.resource_id`. The latest event by `date` gives the current status; `member`, `action.context.tool` and `action.data.project_reference` are the same in all of them.

**2. Take the charge**

The charge of a generation is `action.data.credits_consumed` when it is present, and otherwise the highest `action.data.credits` among its events. Do not add up `credits` across the events of one generation: every event repeats the same amount.

**3. Add the billing detail**

For the quantity and the unit that were billed, read `account.credits.consumed` with `verb: consumed` and match its `transaction_ids` with the `transaction_ids` of the generation.

**4. Apply the refunds**

Read `account.credits.consumed` with `verb: refunded`. A refund belongs to the generation whose `transaction_ids` contain its `rolled_back_transaction_id`. Net cost is the charge minus `credits_refunded`.

**5. Add the file and the downloads**

`project.file.changed` with `verb: created` and `action.data.creation_sqid` equal to the generation's `action.resource_id` gives the file and its project. `creation.downloaded` with that same `action.resource_id` gives who downloaded it and when.

Filter the feed with `event_type` to read only these types, for example `event_type=creation.executed,account.credits.consumed`.

> [!WARNING]
>
> An `event_type` value that is not in the [list below](#all-event-types) is ignored instead of rejected. If none of the values you send is valid, the response holds events of every type.

## Delivery and deduplication

Events are delivered **at least once**: the same event can reach you more than once, always with the same `event_id`. Keep one row per `event_id`.

Events are recorded when they happen, not when a generation ends, so the events of one generation can be far apart in time and fall in different pages or different exports. Join by identifier, never by position.

## All event types

`event_type` accepts these values.

| Area | Event types |
| - | - |
| Creations | `creation.executed`, `creation.downloaded`, `creation.metadata.exported`, `creation.lineage.viewed`, `creation.tag.assigned`, `creation.tag.unassigned` |
| Credits | `account.credits.consumed`, `account.credits.adjusted` |
| Projects | `project.opened`, `project.file.changed`, `project.folder.changed`, `project.folder.shared`, `project.budget_increase_requested`, `project.tag.created`, `project.tag.updated`, `project.tag.deleted` |
| Spaces | `board.opened`, `board.published`, `board.shared`, `board.state_changed`, `board.invite.created`, `board.resource.linked`, `board.workflow.run.executed`, `board.workflow.node.executed` |
| AI tools | `ai.agent.invoked`, `prompt_enhancer.executed`, `mcp.tool.executed`, `mcp.client.authorized`, `mcp.identity.authenticated` |
| Sessions and credentials | `account.session.login`, `account.session.revoked`, `account.mfa.changed`, `account.password.changed`, `account.password.reset`, `account.credential.linked`, `account.credential.unlinked`, `account.sso.changed` |
| Accounts | `account.email.changed`, `account.profile.changed`, `account.plan.changed`, `account.deleted`, `account.ban.changed`, `account.impersonation.started`, `account.resource.shared` |
| Team | `account.team.membership.changed`, `account.team.permissions.changed`, `account.team.group.changed`, `account.team.member.banned`, `account.team.feature.changed`, `account.team.ownership_transfer.requested` |
| API keys and models | `account.apikey.changed`, `account.modelhub.providerkey.changed`, `account.modelhub.model.changed`, `account.modelhub.cost.changed` |
| Audit logs | `account.auditlogs.config.changed`, `account.auditlogs.export.requested`, `account.auditlogs.report.downloaded`, `account.auditlogs.report.renamed`, `account.auditlogs.report.deleted` |
| Security | `security.access.denied` |

New event types and new keys in `action.data` can be added at any time. Ignore the ones you do not know instead of failing on them.

## Related

* **[Audit Logs API overview](https://docs.magnific.com/api-reference/audit-logs/overview.md)**: authentication, filtering, pagination and the CSV export.
* **[Search events](https://docs.magnific.com/api-reference/audit-logs/events.md)**: the endpoint reference.
* **[Analytics API](https://docs.magnific.com/api-reference/analytics/overview.md)**: aggregated credit consumption over time.


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