---
title: "Audit Log Query"
method: GET
path: "/servers/{target}/audit_logs"
tags: ["Audit Logs"]
---

# Audit Log Query

`GET /servers/{target}/audit_logs`

Queries a server's audit logs.

## Path parameters

- `target` string, required

## Query parameters

- `user` string, nullable — Filter by who ran the action
- `target` string, nullable — Filter by who the action is targetting
- `type` string[], nullable — Filter by the action type
- `before` string, nullable — Entries before a certain entry id
- `after` string, nullable — Entries after a certain entry id
- `limit` integer, nullable — Maximum number of entries to fetch

## Response `200`

- AuditLogQueryResponse — Response containing the audit log entries and the users involved
  - `audit_logs` AuditLogEntry[], required — List of audit logs
    - `_id` string, required — Unique ID
    - `server` string, required — The server the entry happened in
    - `reason` string, nullable — User provided reason
    - `user` string, required — User who ran the action
    - `target` string, nullable — User this action is targetting
    - `action` union, required — Indivual action stored on the audit log
      - object
        - `type` 'MessageDelete', required
        - `author` string, required
        - `channel` string, required
      - object
        - `type` 'MessageBulkDelete', required
        - `channel` string, required
        - `count` integer, required
      - object
        - `type` 'MessagePin', required
        - `message` string, required
        - `author` string, required
        - `channel` string, required
      - object
        - `type` 'MessageUnpin', required
        - `message` string, required
        - `author` string, required
        - `channel` string, required
      - object
        - `type` 'BanCreate', required
        - `user` string, required
      - object
        - `type` 'BanDelete', required
        - `user` string, required
      - object
        - `type` 'ChannelCreate', required
        - `channel` string, required
        - `name` string, required
      - object
        - `type` 'ChannelEdit', required
        - `channel` string, required
        - `before` PartialChannel, required — Partial representation of a channel
          - `name` string, nullable
          - `owner` string, nullable
          - `description` string, nullable
          - `icon` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `nsfw` boolean, nullable
          - `active` boolean, nullable
          - `permissions` integer, nullable
          - `role_permissions` object, nullable
          - `default_permissions` OverrideField — Representation of a single permission override as it appears on models and in the database
            - `a` integer, required — Allow bit flags
            - `d` integer, required — Disallow bit flags
          - `last_message_id` string, nullable
          - `voice` VoiceInformation — Voice information for a channel
            - `max_users` integer, nullable — Maximium amount of users allowed in the voice channel at once
          - `slowmode` integer, nullable
        - `after` PartialChannel, required — Partial representation of a channel
          - `name` string, nullable
          - `owner` string, nullable
          - `description` string, nullable
          - `icon` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `nsfw` boolean, nullable
          - `active` boolean, nullable
          - `permissions` integer, nullable
          - `role_permissions` object, nullable
          - `default_permissions` OverrideField — Representation of a single permission override as it appears on models and in the database
            - `a` integer, required — Allow bit flags
            - `d` integer, required — Disallow bit flags
          - `last_message_id` string, nullable
          - `voice` VoiceInformation — Voice information for a channel
            - `max_users` integer, nullable — Maximium amount of users allowed in the voice channel at once
          - `slowmode` integer, nullable
      - object
        - `type` 'ChannelRolePermissionsEdit', required
        - `channel` string, required
        - `role` string, required
        - `permissions` Override, required — Representation of a single permission override
          - `allow` integer, required — Allow bit flags
          - `deny` integer, required — Disallow bit flags
      - object
        - `type` 'ChannelDelete', required
        - `channel` string, required
        - `name` string, required
      - object
        - `type` 'MemberEdit', required
        - `user` string, required
        - `before` PartialMember, required
          - `id` MemberCompositeKey — Composite primary key consisting of server and user id
            - `server` string, required — Server Id
            - `user` string, required — User Id
          - `joined_at` string, date-time — ISO8601 formatted timestamp
          - `nickname` string, nullable
          - `pronouns` string, nullable
          - `avatar` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `roles` string[], nullable
          - `timeout` string, date-time — ISO8601 formatted timestamp
          - `can_publish` boolean, nullable
          - `can_receive` boolean, nullable
        - `after` PartialMember, required
          - `id` MemberCompositeKey — Composite primary key consisting of server and user id
            - `server` string, required — Server Id
            - `user` string, required — User Id
          - `joined_at` string, date-time — ISO8601 formatted timestamp
          - `nickname` string, nullable
          - `pronouns` string, nullable
          - `avatar` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `roles` string[], nullable
          - `timeout` string, date-time — ISO8601 formatted timestamp
          - `can_publish` boolean, nullable
          - `can_receive` boolean, nullable
      - object
        - `type` 'MemberKick', required
        - `user` string, required
      - object
        - `type` 'ServerEdit', required
        - `before` PartialServer, required
          - `id` string, nullable
          - `owner` string, nullable
          - `name` string, nullable
          - `description` string, nullable
          - `channels` string[], nullable
          - `categories` Category[], nullable
            - `id` string, required — Unique ID for this category
            - `title` string, required — Title for this category
            - `channels` string[], required — Channels in this category
          - `system_messages` SystemMessageChannels — System message channel assignments
            - `user_joined` string, nullable — ID of channel to send user join messages in
            - `user_left` string, nullable — ID of channel to send user left messages in
            - `user_kicked` string, nullable — ID of channel to send user kicked messages in
            - `user_banned` string, nullable — ID of channel to send user banned messages in
          - `roles` object, nullable
          - `default_permissions` integer, nullable
          - `icon` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `banner` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `flags` integer, nullable
          - `nsfw` boolean, nullable
          - `analytics` boolean, nullable
          - `discoverable` boolean, nullable
          - `approximate_member_count` integer, nullable
        - `after` PartialServer, required
          - `id` string, nullable
          - `owner` string, nullable
          - `name` string, nullable
          - `description` string, nullable
          - `channels` string[], nullable
          - `categories` Category[], nullable
            - `id` string, required — Unique ID for this category
            - `title` string, required — Title for this category
            - `channels` string[], required — Channels in this category
          - `system_messages` SystemMessageChannels — System message channel assignments
            - `user_joined` string, nullable — ID of channel to send user join messages in
            - `user_left` string, nullable — ID of channel to send user left messages in
            - `user_kicked` string, nullable — ID of channel to send user kicked messages in
            - `user_banned` string, nullable — ID of channel to send user banned messages in
          - `roles` object, nullable
          - `default_permissions` integer, nullable
          - `icon` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `banner` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
          - `flags` integer, nullable
          - `nsfw` boolean, nullable
          - `analytics` boolean, nullable
          - `discoverable` boolean, nullable
          - `approximate_member_count` integer, nullable
      - object
        - `type` 'RoleEdit', required
        - `role` string, required
        - `before` PartialRole, required
          - `id` string, nullable
          - `name` string, nullable
          - `permissions` OverrideField — Representation of a single permission override as it appears on models and in the database
            - `a` integer, required — Allow bit flags
            - `d` integer, required — Disallow bit flags
          - `colour` string, nullable
          - `hoist` boolean, nullable
          - `rank` integer, nullable
          - `icon` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
        - `after` PartialRole, required
          - `id` string, nullable
          - `name` string, nullable
          - `permissions` OverrideField — Representation of a single permission override as it appears on models and in the database
            - `a` integer, required — Allow bit flags
            - `d` integer, required — Disallow bit flags
          - `colour` string, nullable
          - `hoist` boolean, nullable
          - `rank` integer, nullable
          - `icon` File — File
            - `_id` string, required — Unique Id
            - `tag` string, required — Tag / bucket this file was uploaded to
            - `filename` string, required — Original filename
            - `metadata` union, required — Metadata associated with a file
              - …
            - `content_type` string, required — Raw content type of this file
            - `size` integer, required — Size of this file (in bytes)
            - `deleted` boolean, nullable — Whether this file was deleted
            - `reported` boolean, nullable — Whether this file was reported
            - `message_id` string, nullable
            - `user_id` string, nullable
            - `server_id` string, nullable
            - `object_id` string, nullable — Id of the object this file is associated with
      - object
        - `type` 'RoleCreate', required
        - `role` string, required
        - `name` string, required
      - object
        - `type` 'RoleDelete', required
        - `role` string, required
        - `name` string, required
      - object
        - `type` 'RolesReorder', required
        - `before` string[], required
        - `after` string[], required
      - object
        - `type` 'InviteCreate', required
        - `invite` string, required
        - `channel` string, required
      - object
        - `type` 'InviteDelete', required
        - `invite` string, required
        - `channel` string, required
      - object
        - `type` 'WebhookCreate', required
        - `webhook` string, required
        - `name` string, required
        - `channel` string, required
      - object
        - `type` 'WebhookDelete', required
        - `webhook` string, required
        - `name` string, required
        - `channel` string, required
      - object
        - `type` 'EmojiCreate', required
        - `emoji` string, required
        - `name` string, required
      - object
        - `type` 'EmojiUpdate', required
        - `emoji` string, required
        - `before` PartialEmoji, required — Partial emoji representation
          - `name` string, nullable
        - `after` PartialEmoji, required — Partial emoji representation
          - `name` string, nullable
      - object
        - `type` 'EmojiDelete', required
        - `emoji` string, required
        - `name` string, required
  - `users` User[], required — List of users
    - `_id` string, required — Unique Id
    - `username` string, required — Username
    - `discriminator` string, required — Discriminator
    - `display_name` string, nullable — Display name
    - `pronouns` string, nullable — User's pronouns
    - `avatar` File — File
      - `_id` string, required — Unique Id
      - `tag` string, required — Tag / bucket this file was uploaded to
      - `filename` string, required — Original filename
      - `metadata` union, required — Metadata associated with a file
        - object — File is just a generic uncategorised file
          - `type` 'File', required
        - object — File contains textual data and should be displayed as such
          - `type` 'Text', required
        - object — File is an image with specific dimensions, and may be animated
          - `type` 'Image', required
          - `width` integer, required
          - `height` integer, required
          - `thumbhash` integer[], nullable
          - `animated` boolean, nullable
        - object — File is a video with specific dimensions
          - `type` 'Video', required
          - `width` integer, required
          - `height` integer, required
        - object — File is audio
          - `type` 'Audio', required
      - `content_type` string, required — Raw content type of this file
      - `size` integer, required — Size of this file (in bytes)
      - `deleted` boolean, nullable — Whether this file was deleted
      - `reported` boolean, nullable — Whether this file was reported
      - `message_id` string, nullable
      - `user_id` string, nullable
      - `server_id` string, nullable
      - `object_id` string, nullable — Id of the object this file is associated with
    - `relations` Relationship[] — Relationships with other users
      - `_id` string, required — Other user's Id
      - `status` union, required — User's relationship with another user (or themselves)
        - 'None' — No relationship with other user
        - 'User' — Other user is us
        - 'Friend' — Friends with the other user
        - 'Outgoing' — Pending friend request to user
        - 'Incoming' — Incoming friend request from user
        - 'Blocked' — Blocked this user
        - 'BlockedOther' — Blocked by this user
    - `badges` integer — Bitfield of user badges https://docs.rs/revolt-models/latest/revolt_models/v0/enum.UserBadges.html
    - `status` UserStatus — User's active status
      - `text` string, nullable — Custom status text
      - `presence` union — Presence status
        - 'Online' — User is online
        - 'Idle' — User is not currently available
        - 'Focus' — User is focusing / will only receive mentions
        - 'Busy' — User is busy / will not receive any notifications
        - 'Invisible' — User appears to be offline
    - `flags` integer — Enum of user flags https://docs.rs/revolt-models/latest/revolt_models/v0/enum.UserFlags.html
    - `privileged` boolean — Whether this user is privileged
    - `bot` BotInformation — Bot information for if the user is a bot
      - `owner` string, required — Id of the owner of this bot
    - `relationship` union, required — User's relationship with another user (or themselves)
      - 'None' — No relationship with other user
      - 'User' — Other user is us
      - 'Friend' — Friends with the other user
      - 'Outgoing' — Pending friend request to user
      - 'Incoming' — Incoming friend request from user
      - 'Blocked' — Blocked this user
      - 'BlockedOther' — Blocked by this user
    - `online` boolean, required — Whether this user is currently online
  - `members` Member[], required — List of members
    - `_id` MemberCompositeKey, required — Composite primary key consisting of server and user id
      - `server` string, required — Server Id
      - `user` string, required — User Id
    - `joined_at` string, date-time, required — ISO8601 formatted timestamp
    - `nickname` string, nullable — Member's nickname
    - `pronouns` string, nullable — Member's pronouns
    - `avatar` File — File
      - `_id` string, required — Unique Id
      - `tag` string, required — Tag / bucket this file was uploaded to
      - `filename` string, required — Original filename
      - `metadata` union, required — Metadata associated with a file
        - object — File is just a generic uncategorised file
          - `type` 'File', required
        - object — File contains textual data and should be displayed as such
          - `type` 'Text', required
        - object — File is an image with specific dimensions, and may be animated
          - `type` 'Image', required
          - `width` integer, required
          - `height` integer, required
          - `thumbhash` integer[], nullable
          - `animated` boolean, nullable
        - object — File is a video with specific dimensions
          - `type` 'Video', required
          - `width` integer, required
          - `height` integer, required
        - object — File is audio
          - `type` 'Audio', required
      - `content_type` string, required — Raw content type of this file
      - `size` integer, required — Size of this file (in bytes)
      - `deleted` boolean, nullable — Whether this file was deleted
      - `reported` boolean, nullable — Whether this file was reported
      - `message_id` string, nullable
      - `user_id` string, nullable
      - `server_id` string, nullable
      - `object_id` string, nullable — Id of the object this file is associated with
    - `roles` string[] — Member's roles
    - `timeout` string, date-time — ISO8601 formatted timestamp
    - `can_publish` boolean — Whether the member is server-wide voice muted
    - `can_receive` boolean — Whether the member is server-wide voice deafened

## Other responses

- `default` — An error occurred.

---

[API](https://skmtc.net/revolt/apis/revolt-api.md) · [All operations](https://skmtc.net/revolt/apis/revolt-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/revolt/revolt-api/revisions/fee80de86d4d/schema)
