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

# List Audit Events

> Retrieve your team's audit events with a read-only SIEM key and forward them to your SIEM

Audit events cover:

* Sign-ins, password resets, email changes, and other account security actions
* API key creation, changes, and revocation
* Voice model creation, changes, deletion, and downloads
* Team member, role, and invitation changes
* Self-hosted license and bundle downloads, and container image pulls
* Deploy tokens, OAuth app approvals, billing settings, and more (see [Filters](#filters))
* Actions by Fish Audio staff on your team (`actor.type` is `support`)

> [!NOTE]
>
> Audit logs are available only with an Enterprise contract, the [Scale
> plan](https://fish.audio/pricing), or approval from Fish Audio ([contact
> sales](https://fish.audio/contact-sales/)). Enterprise and Scale teams have
> them on by default.

## Before you start

A team owner or admin creates a SIEM key, an API key with the `audit_log:read` scope:

1. Open [Audit Logs](https://fish.audio/app/team/audit-logs) in the console, click **API access**, then **Create SIEM key**.
2. Choose how long the key lasts: 7, 30, or 90 days, or no expiration. You may be asked to confirm a code sent to your email.
3. Copy the key. It is shown only once.

Send the key in the `Authorization: Bearer` header of every request.

The key stops working when it expires or when its creator is no longer an owner or admin, so create it from an account that will keep that role.

A SIEM key can only read audit events, but events include team members' emails, IP addresses, and user agents, so keep the key in a secret manager.

## Poll for new events

1. On the first call, omit `cursor`. You receive the last 24 hours of events.

   > [!TIP]
   >
   > To start from an earlier time, pass it as `since` on the first call. It can
   > be up to 90 days ago. Write it in ISO 8601, such as `2026-11-01T00:00:00Z`.
   > A time without a time zone is read as UTC.

2. Send `events` to your SIEM. Once it accepts them, store `next_cursor`, the position to read from next. Store it even when `events` is empty.

3. If `has_more` is `true`, call again right away with `cursor` set to the stored value. If it is `false`, you have caught up for now: on your next run, call again with the stored cursor. Once a minute is enough.

Send the same filters on every call. To change filters or start from an earlier `since`, clear the stored cursor and pass `since`.

The loop below is a skeleton: you supply `load_cursor`, `save_cursor`, `send_to_siem`, and alerting.

```python theme={null}
import os

import requests

URL = "https://api.fish.audio/v1/audit-logs"
HEADERS = {"Authorization": f"Bearer {os.environ['FISH_SIEM_KEY']}"}


def pull(load_cursor, save_cursor, since=None, filters=None):
    """Forward new events page by page, storing the cursor after each page."""
    base = {"limit": 1000, **(filters or {})}
    params = dict(base)
    cursor = load_cursor()
    if cursor:
        params["cursor"] = cursor
    elif since:
        params["since"] = since  # first run only, e.g. "2026-11-01T00:00:00Z"
    while True:
        response = requests.get(URL, headers=HEADERS, params=params, timeout=30)
        # 401 or 403: alert, retrying won't help (see Errors).
        # 429 or 503: stop and retry later (for 429, after Retry-After).
        response.raise_for_status()
        page = response.json()
        if page["events"]:
            send_to_siem(page["events"])  # your code, see below
        save_cursor(page["next_cursor"])  # only after the events are delivered
        if not page["has_more"]:
            return
        params = {**base, "cursor": page["next_cursor"]}
```

Run `pull` on a schedule, for example from cron or a serverless function, one run at a time so the stored cursor only moves forward.

Implement `send_to_siem` to post each page to your SIEM's HTTPS ingestion endpoint, such as a Panther HTTP log source, and split pages that exceed its request size limit. If your SIEM rejects a request, raise an error so the cursor isn't stored.

To check the setup end to end, look in your SIEM for the `api_key.create` event of your SIEM key, about 5 minutes after you create the key. If the key is more than 24 hours old at your first call, pass a `since` from before you created it.

## Ordering and delivery

* An event is returned about 5 minutes after its `published_at`, the time our log pipeline received it. The Audit Logs page in the console shows events sooner.
* Events are sorted by `published_at`, then `id`, and `since` filters by `published_at` too. Use `occurred_at` as the event time in your SIEM; it can be earlier than events you have already received.
* The same event can be returned more than once, including in a later run. Deduplicate on `id` in your SIEM.
* If we notify you that an incident delayed writes to our log, pause your job, clear the stored cursor, and pull again with `since` set to the start time in the notice, deduplicating on `id` as usual. Outside such incidents, polling returns every event written to the log.
* Field names stay the same within a `schema_version`. New fields and categories can be added, so accept values you don't recognize.

## Filters

To narrow the results, pass `category`, `action`, or `outcome` (`success` or `failure`). `category` and `action` take comma-separated lists that match any of their values; different parameters must all match. For example, `category=api_key,deploy_token&outcome=failure` returns failed API key and deploy token events.

| Category | What it records | Example action |
| - | - | - |
| `auth` | Sign-ins, OAuth token exchanges, password resets, email changes, step-up checks | `auth.sign_in` |
| `oauth` | OAuth app approvals | `oauth.grant.approve` |
| `api_key` | API key creation, changes, and revocation | `api_key.revoke` |
| `deploy_token` | Self-hosting deploy tokens | `deploy_token.rotate` |
| `voice_model` | Voice model creation, changes, publishing, deletion, and downloads | `voice_model.download` |
| `pvc_job` | Cancelled and deleted professional voice cloning jobs; trained voices appear under `voice_model` | `pvc_job.cancel` |
| `pronunciation_dictionary` | Pronunciation dictionaries and their versions | `pronunciation_dictionary.update` |
| `team` | Members, roles, invitations, workspaces, and team settings | `team.member.role_update` |
| `billing` | Billing profile, contacts, purchase orders, and auto-recharge | `billing.profile.update` |
| `deployment` | Self-hosted deployments, license downloads, and bundle downloads | `deployment.bundle.download` |
| `registry` | Deploy-token checks, image pull and push authorizations, documentation and voice-pack downloads | `registry.image_pull.authorize` |
| `audit_log` | Audit log exports | `audit_log.export` |

## Limits

* Each team can make 60 requests per minute.
* Each page holds up to 1,000 events (`limit`, default 100).
* History goes back up to 90 days, but not before your team had audit logs.

## Errors

Retrying won't fix `401` or `403`: alert on them, fix the cause, then resume from your stored cursor.

| Status | Cause | What to do |
| - | - | - |
| `400` | `cursor_too_old`: the cursor or `since` is more than 90 days old | Clear the stored cursor and start again with a `since` within the last 90 days. |
| `400` | `cursor` or `since` is malformed or in the future (`cursor_in_future`), or both were sent | Fix the request. |
| `401` | No API key in the `Authorization: Bearer` header | Fix the request. |
| `401` | The key is invalid, expired, or revoked | Create a new SIEM key. |
| `401` | `account_pending_closure`: the key's creator is closing their account | Have another owner or admin create a new SIEM key. |
| `403` | The key is a regular API key, without the `audit_log:read` scope | Use a SIEM key. |
| `403` | The key's creator is no longer an owner or admin of the team | Have an owner or admin create a new SIEM key. |
| `403` | `audit_log_disabled`: the team doesn't have audit logs | Upgrade to the [Scale plan](https://fish.audio/pricing) or [contact sales](https://fish.audio/contact-sales/). |
| `403` | `team_mismatch`: `team_id` names another team | Use that team's SIEM key, or fix `team_id`. |
| `404` | The team was deleted or closed | Stop the job. |
| `422` | `limit` is out of range, or `outcome` is not `success` or `failure` | Fix the request. |
| `429` | Your team made more than 60 requests this minute | Retry after the number of seconds in the `Retry-After` header. |
| `503` | Temporarily unavailable | Retry later. |

Error bodies come in three shapes:

| Body | Returned for |
| - | - |
| `code` and `message` | Errors with a `code` in the table above, such as `cursor_too_old` |
| Plain text | A `401` for a missing or malformed `Authorization` header |
| `status` and `message` | All other errors. A `422` also has `errors`, with one entry per invalid parameter |

## Rotate or revoke a key

To rotate a key, create a new one, switch your job to it, then delete the old one under **API access** › **Manage keys** on the Audit Logs page. Your stored cursor keeps working with the new key. To keep using a key past its expiry, change its expiry there instead; the key value stays the same. If a key leaks, delete it there, or revoke it without signing in with [Revoke Exposed API Keys](https://docs.fish.audio/api-reference/endpoint/apikey/revoke-api-keys.md).

## Request and response

```bash cURL theme={null}
# First call: the last 24 hours
curl -G "https://api.fish.audio/v1/audit-logs" \
  -H "Authorization: Bearer $FISH_SIEM_KEY" \
  --data-urlencode "limit=1000"

# Later calls: pass the previous next_cursor
NEXT_CURSOR="<next_cursor from the previous response>"
curl -G "https://api.fish.audio/v1/audit-logs" \
  -H "Authorization: Bearer $FISH_SIEM_KEY" \
  --data-urlencode "limit=1000" \
  --data-urlencode "cursor=$NEXT_CURSOR"

# Optional: failed sign-ins since a given time
# Later calls: same filters, cursor instead of since
curl -G "https://api.fish.audio/v1/audit-logs" \
  -H "Authorization: Bearer $FISH_SIEM_KEY" \
  --data-urlencode "limit=1000" \
  --data-urlencode "since=2026-11-01T00:00:00Z" \
  --data-urlencode "action=auth.sign_in" \
  --data-urlencode "outcome=failure"
```

```python Python theme={null}
import os

import requests

URL = "https://api.fish.audio/v1/audit-logs"
HEADERS = {"Authorization": f"Bearer {os.environ['FISH_SIEM_KEY']}"}

# First call: the last 24 hours
params = {"limit": 1000}
page = requests.get(URL, headers=HEADERS, params=params).json()

# Later calls: pass the previous next_cursor
params["cursor"] = page["next_cursor"]
page = requests.get(URL, headers=HEADERS, params=params).json()

# Optional: failed sign-ins since a given time
# Later calls: same filters, cursor instead of since
params = {
    "limit": 1000,
    "since": "2026-11-01T00:00:00Z",
    "action": "auth.sign_in",
    "outcome": "failure",
}
page = requests.get(URL, headers=HEADERS, params=params).json()
```

```javascript JavaScript theme={null}
const url = "https://api.fish.audio/v1/audit-logs";
const headers = { Authorization: `Bearer ${process.env.FISH_SIEM_KEY}` };

// First call: the last 24 hours
let page = await (await fetch(`${url}?limit=1000`, { headers })).json();

// Later calls: pass the previous next_cursor
let params = new URLSearchParams({ limit: "1000", cursor: page.next_cursor });
page = await (await fetch(`${url}?${params}`, { headers })).json();

// Optional: failed sign-ins since a given time
// Later calls: same filters, cursor instead of since
params = new URLSearchParams({
  limit: "1000",
  since: "2026-11-01T00:00:00Z",
  action: "auth.sign_in",
  outcome: "failure",
});
page = await (await fetch(`${url}?${params}`, { headers })).json();
```

```json 200 theme={null}
{
  "schema_version": "1",
  "events": [
    {
      "schema_version": "1",
      "id": "9b2f6c1e4d8a4f0b8e3c7a5d1f2e6b90",
      "team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
      "occurred_at": "2026-12-01T08:15:02.481203Z",
      "published_at": "2026-12-01T08:15:03.017554Z",
      "category": "auth",
      "action": "auth.sign_in",
      "outcome": "success",
      "error_code": null,
      "http_status": 200,
      "actor": {
        "type": "user",
        "id": "c4a8e2f6b0d94c1e8f3a7b5d9e1c3f50",
        "label": "alex@example.com",
        "user_id": "c4a8e2f6b0d94c1e8f3a7b5d9e1c3f50"
      },
      "target": {
        "type": "user",
        "id": "c4a8e2f6b0d94c1e8f3a7b5d9e1c3f50",
        "label": "alex@example.com"
      },
      "source_ip": "203.0.113.24",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
      "country": "US",
      "request_id": "f1e2d3c4b5a69788f1e2d3c4b5a69788",
      "metadata": { "method": "google", "device_type": "desktop" }
    }
  ],
  "has_more": false,
  "next_cursor": "eyJ2IjoxLCJ0IjoiMjAyNi0xMi0wMVQwODoyMTo0MC41MTIzNDUrMDA6MDAiLCJpZCI6IiJ9"
}
```

```json Empty page theme={null}
{
  "schema_version": "1",
  "events": [],
  "has_more": false,
  "next_cursor": "eyJ2IjoxLCJ0IjoiMjAyNi0xMi0wMVQwODoyMjo0MS4yMDg4NzcrMDA6MDAiLCJpZCI6IiJ9"
}
```

```json 400 theme={null}
{
  "code": "cursor_too_old",
  "message": "The cursor or 'since' is more than 90 days old; start again with a recent 'since'."
}
```

```json 401 theme={null}
{
  "status": 401,
  "message": "Invalid token"
}
```

```json 403 theme={null}
{
  "code": "audit_log_disabled",
  "message": "Audit logs are not enabled for this team.",
  "required_tier": "scale",
  "current_tier": "free"
}
```

```json 422 theme={null}
{
  "status": 422,
  "message": "limit: Must be at most 1000",
  "errors": [
    {
      "field": "limit",
      "in": "query",
      "code": "out_of_range",
      "message": "Must be at most 1000"
    }
  ]
}
```


## OpenAPI

````yaml get /v1/audit-logs
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/audit-logs:
    get:
      tags:
        - Audit Logs
      summary: List audit events
      description: |-
        A team's security audit events (sign-ins, API keys, voice models, team
        members, self-host deployments) in the order they entered the log, for
        a SIEM to poll. Requires an API key created with the `audit_log:read`
        scope by an owner or admin of a team with audit logs enabled.

        Store `next_cursor` and pass it as `cursor` on the next call; it is set
        even when a page is empty. Call again at once while `has_more` is true.
        Events appear about 5 minutes after they happen, and the same event can
        be returned more than once: deduplicate on `id`.
      parameters:
        - in: query
          name: cursor
          description: >-
            The `next_cursor` of the previous call. Omit on the first call;
            mutually exclusive with `since`.
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Cursor
          deprecated: false
        - in: query
          name: since
          description: >-
            First call only: ISO-8601 instant to start from (inclusive), at most
            90 days ago. Defaults to 24 hours ago.
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Since
          deprecated: false
        - in: query
          name: limit
          description: Events per page (1-1000).
          required: false
          schema:
            default: 100
            maximum: 1000
            minimum: 1
            title: Limit
            type: integer
          deprecated: false
        - in: query
          name: category
          description: Comma-separated categories, e.g. `auth,api_key`.
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Category
          deprecated: false
        - in: query
          name: action
          description: Comma-separated actions, e.g. `auth.sign_in`.
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Action
          deprecated: false
        - in: query
          name: outcome
          description: ''
          required: false
          schema:
            anyOf:
              - enum:
                  - success
                  - failure
                type: string
              - type: 'null'
            default: null
            title: Outcome
          deprecated: false
        - in: query
          name: team_id
          description: >-
            Optional: the team you expect the key to belong to. A key always
            reads its own team; a different value is refused.
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Team Id
          deprecated: false
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                description: >-
                  One page of a team's audit events in ascending
                  ``published_at`` order.
                properties:
                  schema_version:
                    const: '1'
                    default: '1'
                    title: Schema Version
                    type: string
                  events:
                    items:
                      $ref: '#/components/schemas/AuditLogV1Event'
                    title: Events
                    type: array
                  has_more:
                    description: 'More events are ready now: call again with `next_cursor`.'
                    title: Has More
                    type: boolean
                  next_cursor:
                    description: >-
                      Always set. Store it and pass it as `cursor` on the next
                      call, even when this page is empty.
                    title: Next Cursor
                    type: string
                required:
                  - events
                  - has_more
                  - next_cursor
                type: object
        '400':
          description: Bad request syntax or unsupported method
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '403':
          description: Request forbidden -- authorization will not help
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '429':
          description: >-
            The user has sent too many requests in a given amount of time ("rate
            limiting")
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
components:
  schemas:
    AuditLogV1Event:
      description: 'One audit event. Delivery is at least once: dedupe on ``id``.'
      properties:
        schema_version:
          const: '1'
          default: '1'
          description: Version of this event's shape.
          title: Schema Version
          type: string
        id:
          description: Unique, immutable event ID. Dedupe on it.
          title: Id
          type: string
        team_id:
          title: Team Id
          type: string
        occurred_at:
          description: When the action happened (UTC).
          format: date-time
          title: Occurred At
          type: string
        published_at:
          description: >-
            When the event entered the log pipeline (UTC); the order events are
            served in.
          format: date-time
          title: Published At
          type: string
        category:
          description: auth, api_key, voice_model, team, ...
          title: Category
          type: string
        action:
          description: Dot-delimited event name, e.g. auth.sign_in.
          title: Action
          type: string
        outcome:
          enum:
            - success
            - failure
          title: Outcome
          type: string
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Error Code
        http_status:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Http Status
        actor:
          $ref: '#/components/schemas/AuditLogV1Actor'
        target:
          anyOf:
            - $ref: '#/components/schemas/AuditLogV1Target'
            - type: 'null'
          default: null
        source_ip:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Source Ip
        user_agent:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: User Agent
        country:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: ISO 3166-1 alpha-2, from the edge.
          title: Country
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        metadata:
          additionalProperties: true
          description: Event-specific, redacted context.
          title: Metadata
          type: object
      required:
        - id
        - team_id
        - occurred_at
        - published_at
        - category
        - action
        - outcome
        - actor
      title: AuditLogV1Event
      type: object
    AuditLogV1Actor:
      properties:
        type:
          description: user, api_key, deploy_token, system or anonymous.
          enum:
            - user
            - api_key
            - deploy_token
            - system
            - anonymous
            - support
          title: Type
          type: string
        id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The user, API key or deploy token ID. Never a secret.
          title: Id
        label:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Human-readable actor, such as an email.
          title: Label
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The user behind an API key or deploy token.
          title: User Id
      required:
        - type
      title: AuditLogV1Actor
      type: object
    AuditLogV1Target:
      properties:
        type:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Affected resource type.
          title: Type
        id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Affected resource ID.
          title: Id
        label:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Human-readable resource.
          title: Label
      title: AuditLogV1Target
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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