diff --git a/src/api/routes/guilds/#guild_id/audit-logs.ts b/src/api/routes/guilds/#guild_id/audit-logs.ts
index e8765a99b..2f99aea00 100644
--- a/src/api/routes/guilds/#guild_id/audit-logs.ts
+++ b/src/api/routes/guilds/#guild_id/audit-logs.ts
@@ -1,6 +1,6 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
- Copyright (C) 2023 Spacebar and Spacebar Contributors
+ Copyright (C) 2026 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
@@ -18,18 +18,64 @@
import { Router, Response, Request } from "express";
import { route } from "@spacebar/api/middlewares";
+import { AuditLogResponse } from "@spacebar/schemas";
const router = Router({ mergeParams: true });
//TODO: implement audit logs
-router.get("/", route({}), (req: Request, res: Response) => {
- res.json({
- audit_log_entries: [],
- users: [],
- integrations: [],
- webhooks: [],
- guild_scheduled_events: [],
- threads: [],
- application_commands: [],
- });
-});
+router.get(
+ "/",
+ route({
+ permission: "VIEW_AUDIT_LOG",
+ query: {
+ before: {
+ required: false,
+ type: "string",
+ description: "Entries before this ID",
+ },
+ after: {
+ required: false,
+ type: "string",
+ description: "Entries after this ID",
+ },
+ limit: {
+ required: false,
+ type: "number",
+ description: "Amount of results to return",
+ default: 50,
+ },
+ user_id: {
+ required: false,
+ type: "string",
+ description: "User ID of the user taking the action",
+ },
+ target_id: {
+ required: false,
+ type: "string",
+ description: "User ID of the user targeted by the action",
+ },
+ action_type: {
+ required: false,
+ type: "number",
+ description: "Type of audit log event",
+ },
+ },
+ responses: {
+ 200: {
+ body: "AuditLogResponse",
+ },
+ },
+ }),
+ (req: Request, res: Response) => {
+ res.json({
+ audit_log_entries: [],
+ users: [],
+ integrations: [],
+ webhooks: [],
+ guild_scheduled_events: [],
+ threads: [],
+ application_commands: [],
+ auto_moderation_rules: [],
+ } satisfies AuditLogResponse);
+ },
+);
export default router;
|