Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: api keys couldn't be created

Andrej04c8f8f7ab65
diff --git a/apps/api/auth-schema.ts b/apps/api/auth-schema.ts
new file mode 100644
index 000000000..c33ff568c
--- /dev/null
+++ b/apps/api/auth-schema.ts
@@ -0,0 +1,280 @@
+import { relations } from "drizzle-orm";
+import {
+ boolean,
+ index,
+ integer,
+ pgTable,
+ text,
+ timestamp,
+ uniqueIndex,
+} from "drizzle-orm/pg-core";
+
+export const user = pgTable("user", {
+ id: text("id").primaryKey(),
+ name: text("name").notNull(),
+ email: text("email").notNull().unique(),
+ emailVerified: boolean("email_verified").default(false).notNull(),
+ image: text("image"),
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at")
+ .defaultNow()
+ .$onUpdate(() => /* @__PURE__ */ new Date())
+ .notNull(),
+ isAnonymous: boolean("is_anonymous").default(false),
+});
+
+export const session = pgTable(
+ "session",
+ {
+ id: text("id").primaryKey(),
+ expiresAt: timestamp("expires_at").notNull(),
+ token: text("token").notNull().unique(),
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at")
+ .$onUpdate(() => /* @__PURE__ */ new Date())
+ .notNull(),
+ ipAddress: text("ip_address"),
+ userAgent: text("user_agent"),
+ userId: text("user_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ activeOrganizationId: text("active_organization_id"),
+ activeTeamId: text("active_team_id"),
+ },
+ (table) => [index("session_userId_idx").on(table.userId)],
+);
+
+export const account = pgTable(
+ "account",
+ {
+ id: text("id").primaryKey(),
+ accountId: text("account_id").notNull(),
+ providerId: text("provider_id").notNull(),
+ userId: text("user_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ accessToken: text("access_token"),
+ refreshToken: text("refresh_token"),
+ idToken: text("id_token"),
+ accessTokenExpiresAt: timestamp("access_token_expires_at"),
+ refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
+ scope: text("scope"),
+ password: text("password"),
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at")
+ .$onUpdate(() => /* @__PURE__ */ new Date())
+ .notNull(),
+ },
+ (table) => [index("account_userId_idx").on(table.userId)],
+);
+
+export const verification = pgTable(
+ "verification",
+ {
+ id: text("id").primaryKey(),
+ identifier: text("identifier").notNull(),
+ value: text("value").notNull(),
+ expiresAt: timestamp("expires_at").notNull(),
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at")
+ .defaultNow()
+ .$onUpdate(() => /* @__PURE__ */ new Date())
+ .notNull(),
+ },
+ (table) => [index("verification_identifier_idx").on(table.identifier)],
+);
+
+export const workspace = pgTable(
+ "workspace",
+ {
+ id: text("id").primaryKey(),
+ name: text("name").notNull(),
+ slug: text("slug").notNull().unique(),
+ logo: text("logo"),
+ createdAt: timestamp("created_at").notNull(),
+ metadata: text("metadata"),
+ description: text("description"),
+ },
+ (table) => [uniqueIndex("workspace_slug_uidx").on(table.slug)],
+);
+
+export const team = pgTable(
+ "team",
+ {
+ id: text("id").primaryKey(),
+ name: text("name").notNull(),
+ workspaceId: text("workspace_id")
+ .notNull()
+ .references(() => workspace.id, { onDelete: "cascade" }),
+ createdAt: timestamp("created_at").notNull(),
+ updatedAt: timestamp("updated_at").$onUpdate(
+ () => /* @__PURE__ */ new Date(),
+ ),
+ },
+ (table) => [index("team_workspaceId_idx").on(table.workspaceId)],
+);
+
+export const teamMember = pgTable(
+ "team_member",
+ {
+ id: text("id").primaryKey(),
+ teamId: text("team_id")
+ .notNull()
+ .references(() => team.id, { onDelete: "cascade" }),
+ userId: text("user_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ createdAt: timestamp("created_at"),
+ },
+ (table) => [
+ index("teamMember_teamId_idx").on(table.teamId),
+ index("teamMember_userId_idx").on(table.userId),
+ ],
+);
+
+export const workspace_member = pgTable(
+ "workspace_member",
+ {
+ id: text("id").primaryKey(),
+ workspaceId: text("workspace_id")
+ .notNull()
+ .references(() => workspace.id, { onDelete: "cascade" }),
+ userId: text("user_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ role: text("role").default("member").notNull(),
+ joinedAt: timestamp("joined_at").notNull(),
+ },
+ (table) => [
+ index("workspace_member_workspaceId_idx").on(table.workspaceId),
+ index("workspace_member_userId_idx").on(table.userId),
+ ],
+);
+
+export const invitation = pgTable(
+ "invitation",
+ {
+ id: text("id").primaryKey(),
+ workspaceId: text("workspace_id")
+ .notNull()
+ .references(() => workspace.id, { onDelete: "cascade" }),
+ email: text("email").notNull(),
+ role: text("role"),
+ teamId: text("team_id"),
+ status: text("status").default("pending").notNull(),
+ expiresAt: timestamp("expires_at").notNull(),
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ inviterId: text("inviter_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ },
+ (table) => [
+ index("invitation_workspaceId_idx").on(table.workspaceId),
+ index("invitation_email_idx").on(table.email),
+ ],
+);
+
+export const apikey = pgTable(
+ "apikey",
+ {
+ id: text("id").primaryKey(),
+ configId: text("config_id").default("default").notNull(),
+ name: text("name"),
+ start: text("start"),
+ referenceId: text("reference_id").notNull(),
+ prefix: text("prefix"),
+ key: text("key").notNull(),
+ refillInterval: integer("refill_interval"),
+ refillAmount: integer("refill_amount"),
+ lastRefillAt: timestamp("last_refill_at"),
+ enabled: boolean("enabled").default(true),
+ rateLimitEnabled: boolean("rate_limit_enabled").default(true),
+ rateLimitTimeWindow: integer("rate_limit_time_window").default(86400000),
+ rateLimitMax: integer("rate_limit_max").default(10),
+ requestCount: integer("request_count").default(0),
+ remaining: integer("remaining"),
+ lastRequest: timestamp("last_request"),
+ expiresAt: timestamp("expires_at"),
+ createdAt: timestamp("created_at").notNull(),
+ updatedAt: timestamp("updated_at").notNull(),
+ permissions: text("permissions"),
+ metadata: text("metadata"),
+ },
+ (table) => [
+ index("apikey_configId_idx").on(table.configId),
+ index("apikey_referenceId_idx").on(table.referenceId),
+ index("apikey_key_idx").on(table.key),
+ ],
+);
+
+export const userRelations = relations(user, ({ many }) => ({
+ sessions: many(session),
+ accounts: many(account),
+ teamMembers: many(teamMember),
+ workspace_members: many(workspace_member),
+ invitations: many(invitation),
+}));
+
+export const sessionRelations = relations(session, ({ one }) => ({
+ user: one(user, {
+ fields: [session.userId],
+ references: [user.id],
+ }),
+}));
+
+export const accountRelations = relations(account, ({ one }) => ({
+ user: one(user, {
+ fields: [account.userId],
+ references: [user.id],
+ }),
+}));
+
+export const workspaceRelations = relations(workspace, ({ many }) => ({
+ teams: many(team),
+ workspace_members: many(workspace_member),
+ invitations: many(invitation),
+}));
+
+export const teamRelations = relations(team, ({ one, many }) => ({
+ workspace: one(workspace, {
+ fields: [team.workspaceId],
+ references: [workspace.id],
+ }),
+ teamMembers: many(teamMember),
+}));
+
+export const teamMemberRelations = relations(teamMember, ({ one }) => ({
+ team: one(team, {
+ fields: [teamMember.teamId],
+ references: [team.id],
+ }),
+ user: one(user, {
+ fields: [teamMember.userId],
+ references: [user.id],
+ }),
+}));
+
+export const workspace_memberRelations = relations(
+ workspace_member,
+ ({ one }) => ({
+ workspace: one(workspace, {
+ fields: [workspace_member.workspaceId],
+ references: [workspace.id],
+ }),
+ user: one(user, {
+ fields: [workspace_member.userId],
+ references: [user.id],
+ }),
+ }),
+);
+
+export const invitationRelations = relations(invitation, ({ one }) => ({
+ workspace: one(workspace, {
+ fields: [invitation.workspaceId],
+ references: [workspace.id],
+ }),
+ user: one(user, {
+ fields: [invitation.inviterId],
+ references: [user.id],
+ }),
+}));
diff --git a/apps/api/drizzle/0013_quiet_gladiator.sql b/apps/api/drizzle/0013_quiet_gladiator.sql
new file mode 100644
index 000000000..c8c61029b
--- /dev/null
+++ b/apps/api/drizzle/0013_quiet_gladiator.sql
@@ -0,0 +1,4 @@
+ALTER TABLE "apikey" ADD COLUMN "config_id" text DEFAULT 'default' NOT NULL;--> statement-breakpoint
+ALTER TABLE "apikey" ADD COLUMN "reference_id" text;--> statement-breakpoint
+CREATE INDEX "apikey_configId_idx" ON "apikey" USING btree ("config_id");--> statement-breakpoint
+CREATE INDEX "apikey_referenceId_idx" ON "apikey" USING btree ("reference_id");
\ No newline at end of file
diff --git a/apps/api/drizzle/meta/0013_snapshot.json b/apps/api/drizzle/meta/0013_snapshot.json
new file mode 100644
index 000000000..58653fb98
--- /dev/null
+++ b/apps/api/drizzle/meta/0013_snapshot.json
@@ -0,0 +1,2083 @@
+{
+ "id": "b2199ce0-8bcf-4961-b656-fa144e41bbb3",
+ "prevId": "a8fd55db-33b9-40a0-892e-a11e36505fc0",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.account": {
+ "name": "account",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_id": {
+ "name": "account_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "id_token": {
+ "name": "id_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_token_expires_at": {
+ "name": "access_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token_expires_at": {
+ "name": "refresh_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "account_userId_idx": {
+ "name": "account_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "account_user_id_user_id_fk": {
+ "name": "account_user_id_user_id_fk",
+ "tableFrom": "account",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.activity": {
+ "name": "activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_user_name": {
+ "name": "external_user_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_user_avatar": {
+ "name": "external_user_avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_source": {
+ "name": "external_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_url": {
+ "name": "external_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "activity_task_id_task_id_fk": {
+ "name": "activity_task_id_task_id_fk",
+ "tableFrom": "activity",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "activity_user_id_user_id_fk": {
+ "name": "activity_user_id_user_id_fk",
+ "tableFrom": "activity",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.apikey": {
+ "name": "apikey",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "config_id": {
+ "name": "config_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'default'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start": {
+ "name": "start",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_id": {
+ "name": "reference_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refill_interval": {
+ "name": "refill_interval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refill_amount": {
+ "name": "refill_amount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_refill_at": {
+ "name": "last_refill_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "rate_limit_enabled": {
+ "name": "rate_limit_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "rate_limit_time_window": {
+ "name": "rate_limit_time_window",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 86400000
+ },
+ "rate_limit_max": {
+ "name": "rate_limit_max",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 10
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "remaining": {
+ "name": "remaining",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_request": {
+ "name": "last_request",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "apikey_configId_idx": {
+ "name": "apikey_configId_idx",
+ "columns": [
+ {
+ "expression": "config_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_key_idx": {
+ "name": "apikey_key_idx",
+ "columns": [
+ {
+ "expression": "key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_referenceId_idx": {
+ "name": "apikey_referenceId_idx",
+ "columns": [
+ {
+ "expression": "reference_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_userId_idx": {
+ "name": "apikey_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "apikey_user_id_user_id_fk": {
+ "name": "apikey_user_id_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.column": {
+ "name": "column",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_final": {
+ "name": "is_final",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "column_projectId_idx": {
+ "name": "column_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "column_project_id_project_id_fk": {
+ "name": "column_project_id_project_id_fk",
+ "tableFrom": "column",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.external_link": {
+ "name": "external_link",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "integration_id": {
+ "name": "integration_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "external_id": {
+ "name": "external_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "external_link_taskId_idx": {
+ "name": "external_link_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_integrationId_idx": {
+ "name": "external_link_integrationId_idx",
+ "columns": [
+ {
+ "expression": "integration_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_externalId_idx": {
+ "name": "external_link_externalId_idx",
+ "columns": [
+ {
+ "expression": "external_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_resourceType_idx": {
+ "name": "external_link_resourceType_idx",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "external_link_task_id_task_id_fk": {
+ "name": "external_link_task_id_task_id_fk",
+ "tableFrom": "external_link",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "external_link_integration_id_integration_id_fk": {
+ "name": "external_link_integration_id_integration_id_fk",
+ "tableFrom": "external_link",
+ "tableTo": "integration",
+ "columnsFrom": ["integration_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_integration": {
+ "name": "github_integration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "repository_owner": {
+ "name": "repository_owner",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "repository_name": {
+ "name": "repository_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "github_integration_project_id_project_id_fk": {
+ "name": "github_integration_project_id_project_id_fk",
+ "tableFrom": "github_integration",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_integration_project_id_unique": {
+ "name": "github_integration_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.integration": {
+ "name": "integration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "integration_projectId_idx": {
+ "name": "integration_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "integration_type_idx": {
+ "name": "integration_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "integration_project_id_project_id_fk": {
+ "name": "integration_project_id_project_id_fk",
+ "tableFrom": "integration",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.invitation": {
+ "name": "invitation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "inviter_id": {
+ "name": "inviter_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "invitation_workspaceId_idx": {
+ "name": "invitation_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "invitation_email_idx": {
+ "name": "invitation_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "invitation_workspace_id_workspace_id_fk": {
+ "name": "invitation_workspace_id_workspace_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "invitation_inviter_id_user_id_fk": {
+ "name": "invitation_inviter_id_user_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "user",
+ "columnsFrom": ["inviter_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.label": {
+ "name": "label",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "label_task_id_task_id_fk": {
+ "name": "label_task_id_task_id_fk",
+ "tableFrom": "label",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "label_workspace_id_workspace_id_fk": {
+ "name": "label_workspace_id_workspace_id_fk",
+ "tableFrom": "label",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification": {
+ "name": "notification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'info'"
+ },
+ "is_read": {
+ "name": "is_read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_user_id_user_id_fk": {
+ "name": "notification_user_id_user_id_fk",
+ "tableFrom": "notification",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.project": {
+ "name": "project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'Layout'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_public": {
+ "name": "is_public",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "project_workspace_id_workspace_id_fk": {
+ "name": "project_workspace_id_workspace_id_fk",
+ "tableFrom": "project",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session": {
+ "name": "session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "active_organization_id": {
+ "name": "active_organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "active_team_id": {
+ "name": "active_team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "session_userId_idx": {
+ "name": "session_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_user_id_user_id_fk": {
+ "name": "session_user_id_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_token_unique": {
+ "name": "session_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task": {
+ "name": "task",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "number": {
+ "name": "number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "assignee_id": {
+ "name": "assignee_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'to-do'"
+ },
+ "column_id": {
+ "name": "column_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "priority": {
+ "name": "priority",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'low'"
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "task_project_id_project_id_fk": {
+ "name": "task_project_id_project_id_fk",
+ "tableFrom": "task",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_assignee_id_user_id_fk": {
+ "name": "task_assignee_id_user_id_fk",
+ "tableFrom": "task",
+ "tableTo": "user",
+ "columnsFrom": ["assignee_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_column_id_column_id_fk": {
+ "name": "task_column_id_column_id_fk",
+ "tableFrom": "task",
+ "tableTo": "column",
+ "columnsFrom": ["column_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team": {
+ "name": "team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "team_workspaceId_idx": {
+ "name": "team_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_workspace_id_workspace_id_fk": {
+ "name": "team_workspace_id_workspace_id_fk",
+ "tableFrom": "team",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team_member": {
+ "name": "team_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "teamMember_teamId_idx": {
+ "name": "teamMember_teamId_idx",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "teamMember_userId_idx": {
+ "name": "teamMember_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_member_team_id_team_id_fk": {
+ "name": "team_member_team_id_team_id_fk",
+ "tableFrom": "team_member",
+ "tableTo": "team",
+ "columnsFrom": ["team_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "team_member_user_id_user_id_fk": {
+ "name": "team_member_user_id_user_id_fk",
+ "tableFrom": "team_member",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.time_entry": {
+ "name": "time_entry",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "time_entry_task_id_task_id_fk": {
+ "name": "time_entry_task_id_task_id_fk",
+ "tableFrom": "time_entry",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "time_entry_user_id_user_id_fk": {
+ "name": "time_entry_user_id_user_id_fk",
+ "tableFrom": "time_entry",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user": {
+ "name": "user",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email_verified": {
+ "name": "email_verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_anonymous": {
+ "name": "is_anonymous",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_email_unique": {
+ "name": "user_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.verification": {
+ "name": "verification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "verification_identifier_idx": {
+ "name": "verification_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workflow_rule": {
+ "name": "workflow_rule",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "integration_type": {
+ "name": "integration_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "column_id": {
+ "name": "column_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "workflow_rule_projectId_idx": {
+ "name": "workflow_rule_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workflow_rule_project_id_project_id_fk": {
+ "name": "workflow_rule_project_id_project_id_fk",
+ "tableFrom": "workflow_rule",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "workflow_rule_column_id_column_id_fk": {
+ "name": "workflow_rule_column_id_column_id_fk",
+ "tableFrom": "workflow_rule",
+ "tableTo": "column",
+ "columnsFrom": ["column_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace": {
+ "name": "workspace",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo": {
+ "name": "logo",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_slug_unique": {
+ "name": "workspace_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": ["slug"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_member": {
+ "name": "workspace_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "workspace_member_workspaceId_idx": {
+ "name": "workspace_member_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_member_userId_idx": {
+ "name": "workspace_member_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_member_workspace_id_workspace_id_fk": {
+ "name": "workspace_member_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "workspace_member_user_id_user_id_fk": {
+ "name": "workspace_member_user_id_user_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json
index c5ed6a886..e7da74f59 100644
--- a/apps/api/drizzle/meta/_journal.json
+++ b/apps/api/drizzle/meta/_journal.json
@@ -92,6 +92,13 @@
"when": 1770375054098,
"tag": "0012_mixed_thor_girl",
"breakpoints": true
+ },
+ {
+ "idx": 13,
+ "version": "7",
+ "when": 1772660160328,
+ "tag": "0013_quiet_gladiator",
+ "breakpoints": true
}
]
}
diff --git a/apps/api/package.json b/apps/api/package.json
index 9bc795c1c..285be9d44 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -22,7 +22,8 @@
"db:seed:user-data": "tsx scripts/seed-user-data.ts"
},
"dependencies": {
- "@better-auth/api-key": "^1.5.1",
+ "@better-auth/api-key": "^1.5.3",
+ "@better-auth/drizzle-adapter": "^1.5.3",
"@hono/node-server": "^1.19.9",
"@hono/standard-validator": "^0.2.2",
"@kaneo/email": "workspace:*",
@@ -32,7 +33,7 @@
"@paralleldrive/cuid2": "^3.3.0",
"@valibot/to-json-schema": "^1.5.0",
"bcrypt": "^6.0.0",
- "better-auth": "^1.5.1",
+ "better-auth": "^1.5.3",
"croner": "^10.0.1",
"drizzle-kit": "^0.31.9",
"drizzle-orm": "^0.45.1",
diff --git a/apps/api/src/auth.ts b/apps/api/src/auth.ts
index c942e545e..5ff9d59bd 100644
--- a/apps/api/src/auth.ts
+++ b/apps/api/src/auth.ts
@@ -14,6 +14,7 @@ import {
genericOAuth,
lastLoginMethod,
magicLink,
+ openAPI,
organization,
} from "better-auth/plugins";
import { config } from "dotenv-mono";
@@ -238,7 +239,11 @@ export const auth = betterAuth({
},
],
}),
- apiKey(),
+ apiKey({
+ enableSessionForAPIKeys: true,
+ apiKeyHeaders: "x-api-key",
+ }),
+ openAPI(),
],
session: {
cookieCache: {
diff --git a/apps/api/src/database/relations.ts b/apps/api/src/database/relations.ts
index f870116f3..fa8a2497a 100644
--- a/apps/api/src/database/relations.ts
+++ b/apps/api/src/database/relations.ts
@@ -224,7 +224,7 @@ export const invitationTableRelations = relations(
export const apikeyTableRelations = relations(apikeyTable, ({ one }) => ({
user: one(userTable, {
- fields: [apikeyTable.userId],
+ fields: [apikeyTable.referenceId],
references: [userTable.id],
}),
}));
diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.ts
index 9374f9334..aa6d6b61d 100644
--- a/apps/api/src/database/schema.ts
+++ b/apps/api/src/database/schema.ts
@@ -1,4 +1,5 @@
import { createId } from "@paralleldrive/cuid2";
+import { relations } from "drizzle-orm";
import {
boolean,
index,
@@ -464,13 +465,17 @@ export const apikeyTable = pgTable(
id: text("id")
.$defaultFn(() => createId())
.primaryKey(),
+ configId: text("config_id").default("default").notNull(),
name: text("name"),
start: text("start"),
- prefix: text("prefix"),
- key: text("key").notNull(),
- userId: text("user_id")
+ referenceId: text("reference_id")
.notNull()
.references(() => userTable.id, { onDelete: "cascade" }),
+ prefix: text("prefix"),
+ key: text("key").notNull(),
+ userId: text("user_id").references(() => userTable.id, {
+ onDelete: "cascade",
+ }),
refillInterval: integer("refill_interval"),
refillAmount: integer("refill_amount"),
lastRefillAt: timestamp("last_refill_at", { mode: "date" }),
@@ -488,7 +493,94 @@ export const apikeyTable = pgTable(
metadata: text("metadata"),
},
(table) => [
+ index("apikey_configId_idx").on(table.configId),
index("apikey_key_idx").on(table.key),
+ index("apikey_referenceId_idx").on(table.referenceId),
index("apikey_userId_idx").on(table.userId),
],
);
+
+// Auth-schema compatible aliases in schema.ts
+export const user = userTable;
+export const session = sessionTable;
+export const account = accountTable;
+export const verification = verificationTable;
+export const workspace = workspaceTable;
+export const team = teamTable;
+export const teamMember = teamMemberTable;
+export const workspace_member = workspaceUserTable;
+export const invitation = invitationTable;
+export const apikey = apikeyTable;
+
+// Auth-schema compatible relation exports in schema.ts
+export const userRelations = relations(user, ({ many }) => ({
+ sessions: many(session),
+ accounts: many(account),
+ teamMembers: many(teamMember),
+ workspace_members: many(workspace_member),
+ invitations: many(invitation),
+}));
+
+export const sessionRelations = relations(session, ({ one }) => ({
+ user: one(user, {
+ fields: [session.userId],
+ references: [user.id],
+ }),
+}));
+
+export const accountRelations = relations(account, ({ one }) => ({
+ user: one(user, {
+ fields: [account.userId],
+ references: [user.id],
+ }),
+}));
+
+export const workspaceRelations = relations(workspace, ({ many }) => ({
+ teams: many(team),
+ workspace_members: many(workspace_member),
+ invitations: many(invitation),
+}));
+
+export const teamRelations = relations(team, ({ one, many }) => ({
+ workspace: one(workspace, {
+ fields: [team.workspaceId],
+ references: [workspace.id],
+ }),
+ teamMembers: many(teamMember),
+}));
+
+export const teamMemberRelations = relations(teamMember, ({ one }) => ({
+ team: one(team, {
+ fields: [teamMember.teamId],
+ references: [team.id],
+ }),
+ user: one(user, {
+ fields: [teamMember.userId],
+ references: [user.id],
+ }),
+}));
+
+export const workspace_memberRelations = relations(
+ workspace_member,
+ ({ one }) => ({
+ workspace: one(workspace, {
+ fields: [workspace_member.workspaceId],
+ references: [workspace.id],
+ }),
+ user: one(user, {
+ fields: [workspace_member.userId],
+ references: [user.id],
+ }),
+ }),
+);
+
+export const invitationRelations = relations(invitation, ({ one }) => ({
+ workspace: one(workspace, {
+ fields: [invitation.workspaceId],
+ references: [workspace.id],
+ }),
+ user: one(user, {
+ fields: [invitation.inviterId],
+ references: [user.id],
+ }),
+}));
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 82bfb09aa..0bfbb16ac 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -1,6 +1,6 @@
import { serve } from "@hono/node-server";
import type { Session, User } from "better-auth/types";
-import { migrate } from "drizzle-orm/postgres-js/migrator";
+import { migrate } from "drizzle-orm/node-postgres/migrator";
import { Hono } from "hono";
import { cors } from "hono/cors";
import { HTTPException } from "hono/http-exception";
@@ -26,6 +26,7 @@ import search from "./search";
import task from "./task";
import timeEntry from "./time-entry";
import { getInvitationDetails } from "./utils/check-registration-allowed";
+import { migrateApiKeyReferenceId } from "./utils/migrate-apikey-reference-id";
import { migrateSessionColumn } from "./utils/migrate-session-column";
import { migrateWorkspaceUserEmail } from "./utils/migrate-workspace-user-email";
import { verifyApiKey } from "./utils/verify-api-key";
@@ -99,45 +100,143 @@ const invitationPublicApi = api.get("/invitation/public/:id", async (c) => {
const configApi = api.route("/config", config);
-api.get(
- "/openapi",
- openAPIRouteHandler(api, {
- documentation: {
- openapi: "3.0.0",
- info: {
- title: "Kaneo API",
- version: "1.0.0",
- description:
- "Kaneo Project Management API - Manage projects, tasks, labels, and more",
+const normalizeApiServerUrl = (baseUrl: string): string => {
+ const trimmed = baseUrl.replace(/\/+$/, "");
+ return trimmed.endsWith("/api") ? trimmed : `${trimmed}/api`;
+};
+
+const mergeOpenApiSpecs = (
+ honoSpec: Record<string, unknown>,
+ authSpec: Record<string, unknown>,
+) => {
+ const mergeRecord = (a: unknown, b: unknown): Record<string, unknown> => ({
+ ...((a as Record<string, unknown>) || {}),
+ ...((b as Record<string, unknown>) || {}),
+ });
+
+ const mergeArray = (a: unknown, b: unknown): unknown[] => [
+ ...((a as unknown[]) || []),
+ ...((b as unknown[]) || []),
+ ];
+
+ return {
+ ...honoSpec,
+ openapi:
+ (honoSpec as { openapi?: string }).openapi ||
+ (authSpec as { openapi?: string }).openapi ||
+ "3.0.3",
+ info:
+ (honoSpec as { info?: unknown }).info ||
+ (authSpec as { info?: unknown }).info,
+ servers:
+ (honoSpec as { servers?: unknown[] }).servers ||
+ (authSpec as { servers?: unknown[] }).servers,
+ security:
+ (honoSpec as { security?: unknown[] }).security ||
+ (authSpec as { security?: unknown[] }).security,
+ paths: mergeRecord(
+ (honoSpec as { paths?: unknown }).paths,
+ (authSpec as { paths?: unknown }).paths,
+ ),
+ tags: mergeArray(
+ (honoSpec as { tags?: unknown[] }).tags,
+ (authSpec as { tags?: unknown[] }).tags,
+ ),
+ components: {
+ ...mergeRecord(
+ (honoSpec as { components?: unknown }).components,
+ (authSpec as { components?: unknown }).components,
+ ),
+ schemas: mergeRecord(
+ (honoSpec as { components?: { schemas?: unknown } }).components
+ ?.schemas,
+ (authSpec as { components?: { schemas?: unknown } }).components
+ ?.schemas,
+ ),
+ securitySchemes: mergeRecord(
+ (honoSpec as { components?: { securitySchemes?: unknown } }).components
+ ?.securitySchemes,
+ (authSpec as { components?: { securitySchemes?: unknown } }).components
+ ?.securitySchemes,
+ ),
+ },
+ };
+};
+
+const honoOpenApiHandler = openAPIRouteHandler(api, {
+ documentation: {
+ openapi: "3.0.3",
+ info: {
+ title: "Kaneo API",
+ version: "1.0.0",
+ description:
+ "Kaneo Project Management API - Manage projects, tasks, labels, and more",
+ },
+ servers: [
+ {
+ url: normalizeApiServerUrl(
+ process.env.KANEO_API_URL || "https://cloud.kaneo.app",
+ ),
+ description: "Kaneo API Server",
},
- servers: [
- {
- url: process.env.KANEO_API_URL || "http://localhost:1337",
- description: "Kaneo API Server",
- },
- ],
- components: {
- securitySchemes: {
- bearerAuth: {
- type: "http",
- scheme: "bearer",
- description: "API Key authentication",
- },
+ ],
+ components: {
+ securitySchemes: {
+ bearerAuth: {
+ type: "http",
+ scheme: "bearer",
+ description: "API Key authentication",
},
},
- security: [{ bearerAuth: [] }],
},
- }),
-);
+ security: [{ bearerAuth: [] }],
+ },
+});
-api.on(["POST", "GET", "PUT", "DELETE"], "/auth/*", (c) =>
- auth.handler(c.req.raw),
-);
+api.get("/openapi", async (c) => {
+ const maybeResponse = await honoOpenApiHandler(c, async () => {});
+ const honoSpecResponse = maybeResponse ?? c.res;
+ const honoSpec = (await honoSpecResponse.json()) as Record<string, unknown>;
+
+ let authSpec: Record<string, unknown> = {};
+ try {
+ authSpec = (await auth.api.generateOpenAPISchema()) as Record<
+ string,
+ unknown
+ >;
+ } catch (error) {
+ console.error("Failed to generate Better Auth OpenAPI schema:", error);
+ }
+
+ return c.json(mergeOpenApiSpecs(honoSpec, authSpec));
+});
+
+api.on(["POST", "GET", "PUT", "DELETE"], "/auth/*", (c) => {
+ const authHeader = c.req.header("Authorization");
+
+ if (authHeader?.startsWith("Bearer ")) {
+ const apiKey = authHeader.substring(7).replace(/\s+/g, "").trim();
+ const headers = new Headers(c.req.raw.headers);
+
+ // Better Auth API key plugin validates from x-api-key by default.
+ if (!headers.get("x-api-key")) {
+ headers.set("x-api-key", apiKey);
+ }
+
+ return auth.handler(
+ new Request(c.req.raw, {
+ headers,
+ }),
+ );
+ }
+
+ return auth.handler(c.req.raw);
+});
api.use("*", async (c, next) => {
const authHeader = c.req.header("Authorization");
if (authHeader?.startsWith("Bearer ")) {
- const apiKey = authHeader.substring(7);
+ const apiKey = authHeader.substring(7).replace(/\s+/g, "").trim();
try {
const result = await verifyApiKey(apiKey);
@@ -199,6 +298,7 @@ app.route("/api", api);
try {
await migrateWorkspaceUserEmail();
await migrateSessionColumn();
+ await migrateApiKeyReferenceId();
console.log("🔄 Migrating database...");
await migrate(db, {
diff --git a/apps/api/src/utils/migrate-apikey-reference-id.ts b/apps/api/src/utils/migrate-apikey-reference-id.ts
new file mode 100644
index 000000000..df2b3e572
--- /dev/null
+++ b/apps/api/src/utils/migrate-apikey-reference-id.ts
@@ -0,0 +1,129 @@
+import { sql } from "drizzle-orm";
+import db from "../database";
+
+/**
+ * Ensures API key schema matches Better Auth expectations:
+ * - reference_id exists and is populated from user_id when needed
+ * - config_id exists with default value
+ * - user_id is nullable (Better Auth inserts reference_id, not user_id)
+ */
+export async function migrateApiKeyReferenceId() {
+ console.log("🔄 Checking apikey table reference_id migration...");
+
+ try {
+ const tableExists = await db.execute(sql`
+ SELECT EXISTS (
+ SELECT 1
+ FROM information_schema.tables
+ WHERE table_name = 'apikey'
+ ) AS exists;
+ `);
+
+ const exists =
+ tableExists.rows[0]?.exists === true ||
+ tableExists.rows[0]?.exists === "t";
+ if (!exists) {
+ console.log("🛈 apikey table does not exist — skipping migration.");
+ return;
+ }
+
+ const hasReferenceIdColumn = await db.execute(sql`
+ SELECT column_name
+ FROM information_schema.columns
+ WHERE table_name = 'apikey'
+ AND column_name = 'reference_id'
+ `);
+
+ const hasConfigIdColumn = await db.execute(sql`
+ SELECT column_name
+ FROM information_schema.columns
+ WHERE table_name = 'apikey'
+ AND column_name = 'config_id'
+ `);
+
+ const hasUserIdColumn = await db.execute(sql`
+ SELECT column_name
+ FROM information_schema.columns
+ WHERE table_name = 'apikey'
+ AND column_name = 'user_id'
+ `);
+
+ if (hasReferenceIdColumn.rows.length === 0) {
+ console.log("➕ Adding reference_id column to apikey...");
+ await db.execute(sql`
+ ALTER TABLE "apikey" ADD COLUMN "reference_id" text;
+ `);
+ }
+
+ if (hasConfigIdColumn.rows.length === 0) {
+ console.log("➕ Adding config_id column to apikey...");
+ await db.execute(sql`
+ ALTER TABLE "apikey" ADD COLUMN "config_id" text DEFAULT 'default';
+ `);
+ }
+
+ if (hasUserIdColumn.rows.length > 0) {
+ await db.execute(sql`
+ UPDATE "apikey"
+ SET "reference_id" = "user_id"
+ WHERE "reference_id" IS NULL AND "user_id" IS NOT NULL;
+ `);
+
+ // Better Auth creates keys with reference_id and can leave user_id null.
+ await db.execute(sql`
+ ALTER TABLE "apikey"
+ ALTER COLUMN "user_id" DROP NOT NULL;
+ `);
+ }
+
+ await db.execute(sql`
+ UPDATE "apikey"
+ SET "config_id" = 'default'
+ WHERE "config_id" IS NULL;
+ `);
+
+ const hasConfigIndex = await db.execute(sql`
+ SELECT indexname
+ FROM pg_indexes
+ WHERE tablename = 'apikey'
+ AND indexname = 'apikey_configId_idx'
+ `);
+
+ if (hasConfigIndex.rows.length === 0) {
+ await db.execute(sql`
+ CREATE INDEX "apikey_configId_idx" ON "apikey" ("config_id");
+ `);
+ }
+
+ const hasReferenceIndex = await db.execute(sql`
+ SELECT indexname
+ FROM pg_indexes
+ WHERE tablename = 'apikey'
+ AND indexname = 'apikey_referenceId_idx'
+ `);
+
+ if (hasReferenceIndex.rows.length === 0) {
+ await db.execute(sql`
+ CREATE INDEX "apikey_referenceId_idx" ON "apikey" ("reference_id");
+ `);
+ }
+
+ const hasKeyIndex = await db.execute(sql`
+ SELECT indexname
+ FROM pg_indexes
+ WHERE tablename = 'apikey'
+ AND indexname = 'apikey_key_idx'
+ `);
+
+ if (hasKeyIndex.rows.length === 0) {
+ await db.execute(sql`
+ CREATE INDEX "apikey_key_idx" ON "apikey" ("key");
+ `);
+ }
+
+ console.log("✅ API key reference_id migration completed successfully!");
+ } catch (error) {
+ console.error("❌ Error during apikey migration:", error);
+ throw error;
+ }
+}
diff --git a/apps/api/src/utils/validate-workspace-access.ts b/apps/api/src/utils/validate-workspace-access.ts
index 70f44f7ee..17886d984 100644
--- a/apps/api/src/utils/validate-workspace-access.ts
+++ b/apps/api/src/utils/validate-workspace-access.ts
@@ -1,4 +1,4 @@
-import { and, eq } from "drizzle-orm";
+import { and, eq, or } from "drizzle-orm";
import { HTTPException } from "hono/http-exception";
import db, { schema } from "../database";
@@ -14,7 +14,10 @@ export async function validateWorkspaceAccess(
.where(
and(
eq(schema.apikeyTable.id, apiKeyId),
- eq(schema.apikeyTable.userId, userId),
+ or(
+ eq(schema.apikeyTable.referenceId, userId),
+ eq(schema.apikeyTable.userId, userId),
+ ),
eq(schema.apikeyTable.enabled, true),
),
)
diff --git a/apps/api/src/utils/verify-api-key.ts b/apps/api/src/utils/verify-api-key.ts
index dc2e74c51..d73f74492 100644
--- a/apps/api/src/utils/verify-api-key.ts
+++ b/apps/api/src/utils/verify-api-key.ts
@@ -37,7 +37,7 @@ export async function verifyApiKey(key: string) {
valid: true,
key: {
id: apiKey.id,
- userId: apiKey.userId,
+ userId: apiKey.referenceId ?? apiKey.userId ?? "",
name: apiKey.name,
prefix: apiKey.prefix,
start: apiKey.start,
diff --git a/apps/docs/openapi.json b/apps/docs/openapi.json
index 8ba452693..3ed1de4c7 100644
--- a/apps/docs/openapi.json
+++ b/apps/docs/openapi.json
@@ -7,7 +7,7 @@
},
"servers": [
{
- "url": "https://cloud.kaneo.app/api",
+ "url": "http://localhost:1337/api",
"description": "Kaneo API Server"
}
],
@@ -16,7 +16,451 @@
"bearerAuth": {
"type": "http",
"scheme": "bearer",
- "description": "API Key authentication"
+ "description": "Bearer token authentication"
+ },
+ "apiKeyCookie": {
+ "type": "apiKey",
+ "in": "cookie",
+ "name": "apiKeyCookie",
+ "description": "API Key authentication via cookie"
+ }
+ },
+ "schemas": {
+ "User": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "emailVerified": {
+ "type": "boolean",
+ "default": false,
+ "readOnly": true
+ },
+ "image": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ },
+ "isAnonymous": {
+ "type": "boolean",
+ "default": false,
+ "readOnly": true
+ }
+ },
+ "required": [
+ "name",
+ "email",
+ "createdAt",
+ "updatedAt"
+ ]
+ },
+ "Session": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "token": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "ipAddress": {
+ "type": "string"
+ },
+ "userAgent": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "activeOrganizationId": {
+ "type": "string"
+ },
+ "activeTeamId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "expiresAt",
+ "token",
+ "createdAt",
+ "updatedAt",
+ "userId"
+ ]
+ },
+ "Account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "accountId": {
+ "type": "string"
+ },
+ "providerId": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "accessToken": {
+ "type": "string"
+ },
+ "refreshToken": {
+ "type": "string"
+ },
+ "idToken": {
+ "type": "string"
+ },
+ "accessTokenExpiresAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "refreshTokenExpiresAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "scope": {
+ "type": "string"
+ },
+ "password": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "required": [
+ "accountId",
+ "providerId",
+ "userId",
+ "createdAt",
+ "updatedAt"
+ ]
+ },
+ "Verification": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "identifier": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ }
+ },
+ "required": [
+ "identifier",
+ "value",
+ "expiresAt",
+ "createdAt",
+ "updatedAt"
+ ]
+ },
+ "Organization": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "logo": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "slug",
+ "createdAt"
+ ]
+ },
+ "Team": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "required": [
+ "name",
+ "organizationId",
+ "createdAt"
+ ]
+ },
+ "TeamMember": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "teamId": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "required": [
+ "teamId",
+ "userId"
+ ]
+ },
+ "Member": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "default": "member"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "required": [
+ "organizationId",
+ "userId",
+ "role",
+ "createdAt"
+ ]
+ },
+ "Invitation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "teamId": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string",
+ "default": "pending"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "default": "Generated at runtime"
+ },
+ "inviterId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "organizationId",
+ "email",
+ "status",
+ "expiresAt",
+ "createdAt",
+ "inviterId"
+ ]
+ },
+ "Apikey": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "configId": {
+ "type": "string",
+ "default": "default",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "readOnly": true
+ },
+ "start": {
+ "type": "string",
+ "readOnly": true
+ },
+ "referenceId": {
+ "type": "string",
+ "readOnly": true
+ },
+ "prefix": {
+ "type": "string",
+ "readOnly": true
+ },
+ "key": {
+ "type": "string",
+ "readOnly": true
+ },
+ "refillInterval": {
+ "type": "number",
+ "readOnly": true
+ },
+ "refillAmount": {
+ "type": "number",
+ "readOnly": true
+ },
+ "lastRefillAt": {
+ "type": "string",
+ "format": "date-time",
+ "readOnly": true
+ },
+ "enabled": {
+ "type": "boolean",
+ "default": true,
+ "readOnly": true
+ },
+ "rateLimitEnabled": {
+ "type": "boolean",
+ "default": true,
+ "readOnly": true
+ },
+ "rateLimitTimeWindow": {
+ "type": "number",
+ "default": 86400000,
+ "readOnly": true
+ },
+ "rateLimitMax": {
+ "type": "number",
+ "default": 10,
+ "readOnly": true
+ },
+ "requestCount": {
+ "type": "number",
+ "default": 0,
+ "readOnly": true
+ },
+ "remaining": {
+ "type": "number",
+ "readOnly": true
+ },
+ "lastRequest": {
+ "type": "string",
+ "format": "date-time",
+ "readOnly": true
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time",
+ "readOnly": true
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "readOnly": true
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "readOnly": true
+ },
+ "permissions": {
+ "type": "string",
+ "readOnly": true
+ },
+ "metadata": {
+ "type": "string"
+ }
+ },
+ "required": []
}
}
},
@@ -42,8 +486,14 @@
"type": "object",
"properties": {
"disableRegistration": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"isDemoMode": {
"type": "boolean"
@@ -52,24 +502,54 @@
"type": "boolean"
},
"hasGithubSignIn": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"hasGoogleSignIn": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"hasDiscordSignIn": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"hasCustomOAuth": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"hasGuestAccess": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -116,20 +596,40 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"name": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"isPublic": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -183,20 +683,40 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"name": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"isPublic": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -270,20 +790,40 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"name": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"isPublic": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -344,20 +884,40 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"name": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"isPublic": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -443,20 +1003,40 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"name": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"isPublic": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -498,7 +1078,9 @@
"description": "Project with tasks organized by columns",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -537,23 +1119,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
- },
- "number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "number": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -565,11 +1171,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
+ },
+ "dueDate": {
+
},
- "dueDate": {},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -657,23 +1266,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -685,11 +1318,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
},
- "dueDate": {},
- "createdAt": {}
+ "dueDate": {
+
+ },
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -740,23 +1376,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -768,11 +1428,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
+ },
+ "dueDate": {
+
},
- "dueDate": {},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -866,23 +1529,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -894,11 +1581,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
},
- "dueDate": {},
- "createdAt": {}
+ "dueDate": {
+
+ },
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -941,7 +1631,9 @@
"description": "Exported tasks data",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -970,7 +1662,9 @@
"description": "Tasks imported successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -1012,8 +1706,14 @@
"type": "string"
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -1054,23 +1754,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -1082,11 +1806,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
},
- "dueDate": {},
- "createdAt": {}
+ "dueDate": {
+
+ },
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -1156,23 +1883,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -1184,11 +1935,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
+ },
+ "dueDate": {
+
},
- "dueDate": {},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -1258,23 +2012,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -1286,11 +2064,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
},
- "dueDate": {},
- "createdAt": {}
+ "dueDate": {
+
+ },
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -1360,23 +2141,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -1388,11 +2193,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
+ },
+ "dueDate": {
+
},
- "dueDate": {},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -1430,7 +2238,8 @@
"dueDate": {
"type": "string"
}
- }
+ },
+ "required": []
}
}
}
@@ -1459,23 +2268,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
- },
- "title": {
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "title": {
+ "type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -1487,11 +2320,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
},
- "dueDate": {},
- "createdAt": {}
+ "dueDate": {
+
+ },
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -1561,23 +2397,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -1589,11 +2449,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
+ },
+ "dueDate": {
+
},
- "dueDate": {},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -1653,7 +2516,9 @@
"description": "List of columns ordered by position",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -1680,7 +2545,9 @@
"description": "Column created successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -1735,7 +2602,9 @@
"description": "Columns reordered successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -1796,7 +2665,9 @@
"description": "Column updated successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -1821,17 +2692,30 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"color": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"isFinal": {
"type": "boolean"
}
- }
+ },
+ "required": []
}
}
}
@@ -1848,7 +2732,9 @@
"description": "Column deleted successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -1900,33 +2786,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -1992,33 +2915,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2102,33 +3062,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2202,33 +3199,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2302,33 +3336,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2391,20 +3462,44 @@
"type": "string"
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "startTime": {
+
+ },
+ "endTime": {
+
},
- "startTime": {},
- "endTime": {},
"duration": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -2455,20 +3550,44 @@
"type": "string"
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "startTime": {
+
+ },
+ "endTime": {
+
},
- "startTime": {},
- "endTime": {},
"duration": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -2516,20 +3635,44 @@
"type": "string"
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "startTime": {
+
+ },
+ "endTime": {
+
},
- "startTime": {},
- "endTime": {},
"duration": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -2602,20 +3745,44 @@
"type": "string"
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "startTime": {
+
+ },
+ "endTime": {
+
},
- "startTime": {},
- "endTime": {},
"duration": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -2686,14 +3853,28 @@
"color": {
"type": "string"
},
- "createdAt": {},
+ "createdAt": {
+
+ },
"taskId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"workspaceId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2748,14 +3929,28 @@
"color": {
"type": "string"
},
- "createdAt": {},
+ "createdAt": {
+
+ },
"taskId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"workspaceId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2808,14 +4003,28 @@
"color": {
"type": "string"
},
- "createdAt": {},
+ "createdAt": {
+
+ },
"taskId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"workspaceId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2885,14 +4094,28 @@
"color": {
"type": "string"
},
- "createdAt": {},
+ "createdAt": {
+
+ },
"taskId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"workspaceId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -2942,14 +4165,28 @@
"color": {
"type": "string"
},
- "createdAt": {},
+ "createdAt": {
+
+ },
"taskId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"workspaceId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -3020,14 +4257,28 @@
"color": {
"type": "string"
},
- "createdAt": {},
+ "createdAt": {
+
+ },
"taskId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"workspaceId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -3082,8 +4333,14 @@
"type": "string"
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"type": {
"enum": [
@@ -3093,8 +4350,7 @@
"task_status_changed",
"task_assignee_changed",
"time_entry_created"
- ],
- "type": "string"
+ ]
},
"isRead": {
"type": "boolean"
@@ -3106,10 +4362,11 @@
"enum": [
"task",
"workspace"
- ],
- "type": "string"
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -3150,8 +4407,14 @@
"type": "string"
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"type": {
"enum": [
@@ -3161,8 +4424,7 @@
"task_status_changed",
"task_assignee_changed",
"time_entry_created"
- ],
- "type": "string"
+ ]
},
"isRead": {
"type": "boolean"
@@ -3174,10 +4436,11 @@
"enum": [
"task",
"workspace"
- ],
- "type": "string"
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -3254,8 +4517,14 @@
"type": "string"
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"type": {
"enum": [
@@ -3265,8 +4534,7 @@
"task_status_changed",
"task_assignee_changed",
"time_entry_created"
- ],
- "type": "string"
+ ]
},
"isRead": {
"type": "boolean"
@@ -3278,10 +4546,11 @@
"enum": [
"task",
"workspace"
- ],
- "type": "string"
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -3399,23 +4668,47 @@
"type": "string"
},
"position": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"number": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"title": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string"
@@ -3427,11 +4720,14 @@
"medium",
"high",
"urgent"
- ],
- "type": "string"
+ ]
},
- "dueDate": {},
- "createdAt": {}
+ "dueDate": {
+
+ },
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -3462,20 +4758,40 @@
"type": "string"
},
"icon": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"name": {
"type": "string"
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"isPublic": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -3505,18 +4821,38 @@
"type": "string"
},
"logo": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"metadata": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"description": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {}
+ "createdAt": {
+
+ }
},
"required": [
"id",
@@ -3552,33 +4888,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -3618,33 +4991,70 @@
"title_changed",
"description_changed",
"create"
- ],
- "type": "string"
+ ]
+ },
+ "createdAt": {
+
},
- "createdAt": {},
"userId": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"content": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUserAvatar": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalSource": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"externalUrl": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -3661,7 +5071,8 @@
]
}
}
- }
+ },
+ "required": []
}
}
}
@@ -3689,8 +5100,7 @@
"comments",
"activities"
],
- "default": "all",
- "type": "string"
+ "default": "all"
}
},
{
@@ -3711,10 +5121,10 @@
"in": "query",
"name": "limit",
"schema": {
- "type": "integer",
+ "type": "string",
"minimum": 1,
"maximum": 50,
- "default": 20
+ "default": "20"
}
},
{
@@ -3744,8 +5154,14 @@
"type": "object",
"properties": {
"appName": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -3901,15 +5317,31 @@
"type": "string"
},
"installationId": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"isActive": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {},
- "updatedAt": {}
+ "createdAt": {
+
+ },
+ "updatedAt": {
+
+ }
},
"required": [
"id",
@@ -3964,15 +5396,31 @@
"type": "string"
},
"installationId": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"isActive": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {},
- "updatedAt": {}
+ "createdAt": {
+
+ },
+ "updatedAt": {
+
+ }
},
"required": [
"id",
@@ -4050,15 +5498,31 @@
"type": "string"
},
"installationId": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"isActive": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {},
- "updatedAt": {}
+ "createdAt": {
+
+ },
+ "updatedAt": {
+
+ }
},
"required": [
"id",
@@ -4112,7 +5576,8 @@
"isActive": {
"type": "boolean"
}
- }
+ },
+ "required": []
}
}
}
@@ -4145,15 +5610,31 @@
"type": "string"
},
"installationId": {
- "type": "number",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"isActive": {
- "type": "boolean",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "createdAt": {},
- "updatedAt": {}
+ "createdAt": {
+
+ },
+ "updatedAt": {
+
+ }
},
"required": [
"id",
@@ -4274,12 +5755,24 @@
"type": "string"
},
"title": {
- "type": "string",
- "nullable": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "metadata": {},
- "createdAt": {},
- "updatedAt": {}
+ "metadata": {
+
+ },
+ "createdAt": {
+
+ },
+ "updatedAt": {
+
+ }
},
"required": [
"id",
@@ -4323,7 +5816,9 @@
"description": "List of workflow rules",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -4350,7 +5845,9 @@
"description": "Workflow rule upserted successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -4404,7 +5901,9 @@
"description": "Workflow rule deleted successfully",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+
+ }
}
}
}
@@ -4557,6 +6056,13565 @@
}
]
}
+ },
+ "/sign-in/social": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Sign in with a social provider",
+ "operationId": "socialSignIn",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "callbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Callback URL to redirect to after the user has signed in"
+ },
+ "newUserCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "errorCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Callback URL to redirect to if an error happens"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "disableRedirect": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Disable automatic redirection to the provider. Useful for handling the redirection yourself"
+ },
+ "idToken": {
+ "type": [
+ "object",
+ "null"
+ ],
+ "properties": {
+ "token": {
+ "type": "string",
+ "description": "ID token from the provider"
+ },
+ "nonce": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Nonce used to generate the token"
+ },
+ "accessToken": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Access token from the provider"
+ },
+ "refreshToken": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Refresh token from the provider"
+ },
+ "expiresAt": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "Expiry date of the token"
+ }
+ },
+ "required": [
+ "token"
+ ]
+ },
+ "scopes": {
+ "type": [
+ "array",
+ "null"
+ ],
+ "description": "Array of scopes to request from the provider. This will override the default scopes passed."
+ },
+ "requestSignUp": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider"
+ },
+ "loginHint": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The login hint to use for the authorization code request"
+ },
+ "additionalData": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "provider"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success - Returns either session details or redirect URL",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "Session response when idToken is provided",
+ "properties": {
+ "token": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "url": {
+ "type": "string"
+ },
+ "redirect": {
+ "type": "boolean",
+ "enum": [false]
+ }
+ },
+ "required": [
+ "redirect",
+ "token",
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/callback/{id}": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/get-session": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Get the current session",
+ "operationId": "getSession",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "nullable": true,
+ "properties": {
+ "session": {
+ "$ref": "#/components/schemas/Session"
+ },
+ "user": {
+ "$ref": "#/components/schemas/User"
+ }
+ },
+ "required": [
+ "session",
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Get the current session",
+ "operationId": "getSession",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "nullable": true,
+ "properties": {
+ "session": {
+ "$ref": "#/components/schemas/Session"
+ },
+ "user": {
+ "$ref": "#/components/schemas/User"
+ }
+ },
+ "required": [
+ "session",
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/sign-out": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Sign out the current user",
+ "operationId": "signOut",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/sign-up/email": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Sign up a user using email and password",
+ "operationId": "signUpWithEmailAndPassword",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the user"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the user"
+ },
+ "password": {
+ "type": "string",
+ "description": "The password of the user"
+ },
+ "image": {
+ "type": "string",
+ "description": "The profile image URL of the user"
+ },
+ "callbackURL": {
+ "type": "string",
+ "description": "The URL to use for email verification callback"
+ },
+ "rememberMe": {
+ "type": "boolean",
+ "description": "If this is false, the session will not be remembered. Default is `true`."
+ }
+ },
+ "required": [
+ "name",
+ "email",
+ "password"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Successfully created user",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string",
+ "nullable": true,
+ "description": "Authentication token for the session"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the user"
+ },
+ "email": {
+ "type": "string",
+ "format": "email",
+ "description": "The email address of the user"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the user"
+ },
+ "image": {
+ "type": "string",
+ "format": "uri",
+ "nullable": true,
+ "description": "The profile image URL of the user"
+ },
+ "emailVerified": {
+ "type": "boolean",
+ "description": "Whether the email has been verified"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the user was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the user was last updated"
+ }
+ },
+ "required": [
+ "id",
+ "email",
+ "name",
+ "emailVerified",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ },
+ "required": [
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "422": {
+ "description": "Unprocessable Entity. User already exists or failed to create user.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/sign-in/email": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Sign in with email and password",
+ "operationId": "signInEmail",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email of the user"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password of the user"
+ },
+ "callbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Callback URL to use as a redirect for email verification"
+ },
+ "rememberMe": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "If this is false, the session will not be remembered. Default is `true`.",
+ "default": true
+ }
+ },
+ "required": [
+ "email",
+ "password"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success - Returns either session details or redirect URL",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "Session response when idToken is provided",
+ "properties": {
+ "redirect": {
+ "type": "boolean",
+ "enum": [false]
+ },
+ "token": {
+ "type": "string",
+ "description": "Session token"
+ },
+ "url": {
+ "type": "string",
+ "nullable": true
+ },
+ "user": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ }
+ },
+ "required": [
+ "redirect",
+ "token",
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/reset-password": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Reset the password for a user",
+ "operationId": "resetPassword",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newPassword": {
+ "type": "string",
+ "description": "The new password to set"
+ },
+ "token": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The token to reset the password"
+ }
+ },
+ "required": [
+ "newPassword"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/verify-password": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Verify the current user's password",
+ "operationId": "verifyPassword",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "password": {
+ "type": "string",
+ "description": "The password to verify"
+ }
+ },
+ "required": [
+ "password"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/verify-email": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Verify the email of the user",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "token",
+ "in": "query",
+ "description": "The token to verify the email",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "callbackURL",
+ "in": "query",
+ "description": "The URL to redirect to after email verification",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if the email was verified successfully"
+ }
+ },
+ "required": [
+ "user",
+ "status"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/send-verification-email": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Send a verification email to the user",
+ "operationId": "sendVerificationEmail",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "The email to send the verification email to",
+ "example": "[email protected]"
+ },
+ "callbackURL": {
+ "type": "string",
+ "description": "The URL to use for email verification callback",
+ "example": "https://example.com/callback",
+ "nullable": true
+ }
+ },
+ "required": [
+ "email"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if the email was sent successfully",
+ "example": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string",
+ "description": "Error message",
+ "example": "Verification email isn't enabled"
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/change-email": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "operationId": "changeEmail",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newEmail": {
+ "type": "string",
+ "description": "The new email address to set must be a valid email address"
+ },
+ "callbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to after email verification"
+ }
+ },
+ "required": [
+ "newEmail"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Email change request processed successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if the request was successful"
+ },
+ "message": {
+ "type": "string",
+ "enum": [
+ "Email updated",
+ "Verification email sent"
+ ],
+ "description": "Status message of the email change process",
+ "nullable": true
+ }
+ },
+ "required": [
+ "status"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/change-password": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Change the password of the user",
+ "operationId": "changePassword",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newPassword": {
+ "type": "string",
+ "description": "The new password to set"
+ },
+ "currentPassword": {
+ "type": "string",
+ "description": "The current password is required"
+ },
+ "revokeOtherSessions": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Must be a boolean value"
+ }
+ },
+ "required": [
+ "newPassword",
+ "currentPassword"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Password successfully changed",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string",
+ "nullable": true,
+ "description": "New session token if other sessions were revoked"
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the user"
+ },
+ "email": {
+ "type": "string",
+ "format": "email",
+ "description": "The email address of the user"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the user"
+ },
+ "image": {
+ "type": "string",
+ "format": "uri",
+ "nullable": true,
+ "description": "The profile image URL of the user"
+ },
+ "emailVerified": {
+ "type": "boolean",
+ "description": "Whether the email has been verified"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the user was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the user was last updated"
+ }
+ },
+ "required": [
+ "id",
+ "email",
+ "name",
+ "emailVerified",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ },
+ "required": [
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/update-session": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Update the current session",
+ "operationId": "updateSession",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "session": {
+ "type": "object",
+ "$ref": "#/components/schemas/Session"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/update-user": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Update the current user",
+ "operationId": "updateUser",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the user"
+ },
+ "image": {
+ "type": "string",
+ "description": "The image of the user",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/delete-user": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Delete the user",
+ "operationId": "deleteUser",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "callbackURL": {
+ "type": "string",
+ "description": "The callback URL to redirect to after the user is deleted"
+ },
+ "password": {
+ "type": "string",
+ "description": "The user's password. Required if session is not fresh"
+ },
+ "token": {
+ "type": "string",
+ "description": "The deletion verification token"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "User deletion processed successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "description": "Indicates if the operation was successful"
+ },
+ "message": {
+ "type": "string",
+ "enum": [
+ "User deleted",
+ "Verification email sent"
+ ],
+ "description": "Status message of the deletion process"
+ }
+ },
+ "required": [
+ "success",
+ "message"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/request-password-reset": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Send a password reset email to the user",
+ "operationId": "requestPasswordReset",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "The email address of the user to send a password reset email to"
+ },
+ "redirectTo": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"
+ }
+ },
+ "required": [
+ "email"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/reset-password/{token}": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Redirects the user to the callback URL with the token",
+ "operationId": "resetPasswordCallback",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "token",
+ "in": "path",
+ "required": true,
+ "description": "The token to reset the password",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "callbackURL",
+ "in": "query",
+ "required": true,
+ "description": "The URL to redirect the user to reset their password",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/list-sessions": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "List all active sessions for the user",
+ "operationId": "listUserSessions",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Session"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/revoke-session": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Revoke a single session",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string",
+ "description": "The token to revoke"
+ }
+ },
+ "required": [
+ "token"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if the session was revoked successfully"
+ }
+ },
+ "required": [
+ "status"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/revoke-sessions": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Revoke all sessions for the user",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if all sessions were revoked successfully"
+ }
+ },
+ "required": [
+ "status"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/revoke-other-sessions": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Revoke all other sessions for the user except the current one",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if all other sessions were revoked successfully"
+ }
+ },
+ "required": [
+ "status"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/link-social": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Link a social account to the user",
+ "operationId": "linkSocialAccount",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "callbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to after the user has signed in"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "idToken": {
+ "type": [
+ "object",
+ "null"
+ ],
+ "properties": {
+ "token": {
+ "type": "string"
+ },
+ "nonce": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "accessToken": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "refreshToken": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "scopes": {
+ "type": [
+ "array",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "token"
+ ]
+ },
+ "requestSignUp": {
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
+ "scopes": {
+ "type": [
+ "array",
+ "null"
+ ],
+ "description": "Additional scopes to request from the provider"
+ },
+ "errorCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to if there is an error during the link process"
+ },
+ "disableRedirect": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Disable automatic redirection to the provider. Useful for handling the redirection yourself"
+ },
+ "additionalData": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "provider"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The authorization URL to redirect the user to"
+ },
+ "redirect": {
+ "type": "boolean",
+ "description": "Indicates if the user should be redirected to the authorization URL"
+ },
+ "status": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "redirect"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/list-accounts": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "List all accounts linked to the user",
+ "operationId": "listUserAccounts",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "providerId": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "accountId": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "scopes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "id",
+ "providerId",
+ "createdAt",
+ "updatedAt",
+ "accountId",
+ "userId",
+ "scopes"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/delete-user/callback": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Callback to complete user deletion with verification token",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "token",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "description": "The token to verify the deletion request"
+ }
+ },
+ {
+ "name": "callbackURL",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to after deletion"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "User successfully deleted",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "description": "Indicates if the deletion was successful"
+ },
+ "message": {
+ "type": "string",
+ "enum": [
+ "User deleted"
+ ],
+ "description": "Confirmation message"
+ }
+ },
+ "required": [
+ "success",
+ "message"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/unlink-account": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Unlink an account",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "providerId": {
+ "type": "string"
+ },
+ "accountId": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "providerId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/refresh-token": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Refresh the access token using a refresh token",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "providerId": {
+ "type": "string",
+ "description": "The provider ID for the OAuth provider"
+ },
+ "accountId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The account ID associated with the refresh token"
+ },
+ "userId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The user ID associated with the account"
+ }
+ },
+ "required": [
+ "providerId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Access token refreshed successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "tokenType": {
+ "type": "string"
+ },
+ "idToken": {
+ "type": "string"
+ },
+ "accessToken": {
+ "type": "string"
+ },
+ "refreshToken": {
+ "type": "string"
+ },
+ "accessTokenExpiresAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "refreshTokenExpiresAt": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid refresh token or provider configuration"
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/get-access-token": {
+ "post": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Get a valid access token, doing a refresh if needed",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "providerId": {
+ "type": "string",
+ "description": "The provider ID for the OAuth provider"
+ },
+ "accountId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The account ID associated with the refresh token"
+ },
+ "userId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The user ID associated with the account"
+ }
+ },
+ "required": [
+ "providerId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "A Valid access token",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "tokenType": {
+ "type": "string"
+ },
+ "idToken": {
+ "type": "string"
+ },
+ "accessToken": {
+ "type": "string"
+ },
+ "accessTokenExpiresAt": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid refresh token or provider configuration"
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/account-info": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Get the account info provided by the provider",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "image": {
+ "type": "string"
+ },
+ "emailVerified": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "id",
+ "emailVerified"
+ ]
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+
+ },
+ "additionalProperties": true
+ }
+ },
+ "required": [
+ "user",
+ "data"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/ok": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Check if the API is working",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "API is working",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ok": {
+ "type": "boolean",
+ "description": "Indicates if the API is working"
+ }
+ },
+ "required": [
+ "ok"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/error": {
+ "get": {
+ "tags": [
+ "Default"
+ ],
+ "description": "Displays an error page",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "text/html": {
+ "schema": {
+ "type": "string",
+ "description": "The HTML content of the error page"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/sign-in/anonymous": {
+ "post": {
+ "tags": [
+ "Anonymous"
+ ],
+ "description": "Sign in anonymously",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Sign in anonymously",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "user": {
+ "$ref": "#/components/schemas/User"
+ },
+ "session": {
+ "$ref": "#/components/schemas/Session"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/delete-anonymous-user": {
+ "post": {
+ "tags": [
+ "Anonymous"
+ ],
+ "description": "Delete an anonymous user",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Anonymous user deleted",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Anonymous user deletion is disabled",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/sign-in/magic-link": {
+ "post": {
+ "tags": [
+ "Magic-link"
+ ],
+ "description": "Sign in with magic link",
+ "operationId": "signInWithMagicLink",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address to send the magic link"
+ },
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "User display name. Only used if the user is registering for the first time. Eg: \"my-name\""
+ },
+ "callbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "URL to redirect after magic link verification"
+ },
+ "newUserCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "URL to redirect after new user signup. Only used if the user is registering for the first time."
+ },
+ "errorCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "URL to redirect after error."
+ }
+ },
+ "required": [
+ "email"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/magic-link/verify": {
+ "get": {
+ "tags": [
+ "Magic-link"
+ ],
+ "description": "Verify magic link",
+ "operationId": "verifyMagicLink",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "token",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "description": "Verification token"
+ }
+ },
+ {
+ "name": "callbackURL",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "URL to redirect after magic link verification, if not provided the user will be redirected to the root URL. Eg: \"/dashboard\""
+ }
+ },
+ {
+ "name": "errorCallbackURL",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "URL to redirect after error."
+ }
+ },
+ {
+ "name": "newUserCallbackURL",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "URL to redirect after new user signup. Only used if the user is registering for the first time."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "session": {
+ "$ref": "#/components/schemas/Session"
+ },
+ "user": {
+ "$ref": "#/components/schemas/User"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/send-verification-otp": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Send a verification OTP to an email",
+ "operationId": "sendEmailVerificationOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address to send the OTP"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the OTP"
+ }
+ },
+ "required": [
+ "email",
+ "type"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/check-verification-otp": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Verify an email with an OTP",
+ "operationId": "verifyEmailWithOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address the OTP was sent to"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the OTP"
+ },
+ "otp": {
+ "type": "string",
+ "description": "OTP to verify"
+ }
+ },
+ "required": [
+ "email",
+ "type",
+ "otp"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/verify-email": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Verify email with OTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address to verify"
+ },
+ "otp": {
+ "type": "string",
+ "description": "OTP to verify"
+ }
+ },
+ "required": [
+ "email",
+ "otp"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "boolean",
+ "description": "Indicates if the verification was successful",
+ "enum": [true]
+ },
+ "token": {
+ "type": "string",
+ "nullable": true,
+ "description": "Session token if autoSignInAfterVerification is enabled, otherwise null"
+ },
+ "user": {
+ "$ref": "#/components/schemas/User"
+ }
+ },
+ "required": [
+ "status",
+ "token",
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/sign-in/email-otp": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Sign in with email and OTP",
+ "operationId": "signInWithEmailOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string",
+ "description": "Session token for the authenticated session"
+ },
+ "user": {
+ "$ref": "#/components/schemas/User"
+ }
+ },
+ "required": [
+ "token",
+ "user"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/request-password-reset": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Request password reset with email and OTP",
+ "operationId": "requestPasswordResetWithEmailOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address to send the OTP"
+ }
+ },
+ "required": [
+ "email"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "description": "Indicates if the OTP was sent successfully"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/forget-password/email-otp": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Deprecated: Use /email-otp/request-password-reset instead.",
+ "operationId": "forgetPasswordWithEmailOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address to send the OTP"
+ }
+ },
+ "required": [
+ "email"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "description": "Indicates if the OTP was sent successfully"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/reset-password": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Reset password with email and OTP",
+ "operationId": "resetPasswordWithEmailOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email address to reset the password"
+ },
+ "otp": {
+ "type": "string",
+ "description": "OTP sent to the email"
+ },
+ "password": {
+ "type": "string",
+ "description": "New password"
+ }
+ },
+ "required": [
+ "email",
+ "otp",
+ "password"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/request-email-change": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Request email change with verification OTP sent to the new email",
+ "operationId": "requestEmailChangeWithEmailOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newEmail": {
+ "type": "string",
+ "description": "New email address to send the OTP"
+ },
+ "otp": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "newEmail"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/email-otp/change-email": {
+ "post": {
+ "tags": [
+ "Email-otp"
+ ],
+ "description": "Verify new email with OTP and change the email if verification is successful",
+ "operationId": "changeEmailWithEmailOTP",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newEmail": {
+ "type": "string",
+ "description": "New email address to verify and change to"
+ },
+ "otp": {
+ "type": "string",
+ "description": "OTP sent to the new email"
+ }
+ },
+ "required": [
+ "newEmail",
+ "otp"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/create": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Create an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the organization"
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the organization"
+ },
+ "userId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server. server-only. Eg: \"user-id\""
+ },
+ "logo": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The logo of the organization"
+ },
+ "metadata": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The metadata of the organization"
+ },
+ "keepCurrentActiveOrganization": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Whether to keep the current active organization active after creating a new one. Eg: true"
+ },
+ "description": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "slug"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The organization that was created",
+ "$ref": "#/components/schemas/Organization"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/update": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Update an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The name of the organization"
+ },
+ "slug": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The slug of the organization"
+ },
+ "logo": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The logo of the organization"
+ },
+ "metadata": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The metadata of the organization"
+ }
+ }
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The organization ID. Eg: \"org-id\""
+ }
+ },
+ "required": [
+ "data"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The updated organization",
+ "$ref": "#/components/schemas/Organization"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/delete": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Delete an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "organizationId": {
+ "type": "string",
+ "description": "The organization id to delete"
+ }
+ },
+ "required": [
+ "organizationId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "string",
+ "description": "The organization id that was deleted"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/set-active": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Set the active organization",
+ "operationId": "setActiveOrganization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "organizationSlug": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided. Eg: \"org-slug\""
+ }
+ },
+ "required": []
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The organization",
+ "$ref": "#/components/schemas/Organization"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/get-full-organization": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Get the full organization",
+ "operationId": "getOrganization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The organization",
+ "$ref": "#/components/schemas/Organization"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "List all organizations",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Organization"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/invite-member": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Create an invitation to an organization",
+ "operationId": "createOrganizationInvitation",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "The email address of the user to invite"
+ },
+ "role": {
+ "type": "string",
+ "description": "The role(s) to assign to the user. It can be `admin`, `member`, owner. Eg: \"member\""
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The organization ID to invite the user to"
+ },
+ "resend": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Resend the invitation email, if the user is already invited. Eg: true"
+ },
+ "teamId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "email",
+ "role",
+ "teamId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "inviterId": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "expiresAt": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "email",
+ "role",
+ "organizationId",
+ "inviterId",
+ "status",
+ "expiresAt",
+ "createdAt"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/cancel-invitation": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "invitationId": {
+ "type": "string",
+ "description": "The ID of the invitation to cancel"
+ }
+ },
+ "required": [
+ "invitationId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/accept-invitation": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Accept an invitation to an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "invitationId": {
+ "type": "string",
+ "description": "The ID of the invitation to accept"
+ }
+ },
+ "required": [
+ "invitationId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "invitation": {
+ "type": "object"
+ },
+ "member": {
+ "type": "object"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/get-invitation": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Get an invitation by ID",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "id",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the invitation to get"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "inviterId": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "expiresAt": {
+ "type": "string"
+ },
+ "organizationName": {
+ "type": "string"
+ },
+ "organizationSlug": {
+ "type": "string"
+ },
+ "inviterEmail": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "email",
+ "role",
+ "organizationId",
+ "inviterId",
+ "status",
+ "expiresAt",
+ "organizationName",
+ "organizationSlug",
+ "inviterEmail"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/reject-invitation": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Reject an invitation to an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "invitationId": {
+ "type": "string",
+ "description": "The ID of the invitation to reject"
+ }
+ },
+ "required": [
+ "invitationId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "invitation": {
+ "type": "object"
+ },
+ "member": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list-invitations": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/get-active-member": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Get the member details of the active organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "organizationId",
+ "role"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/check-slug": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string",
+ "description": "The organization slug to check. Eg: \"my-org\""
+ }
+ },
+ "required": [
+ "slug"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/remove-member": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Remove a member from an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "memberIdOrEmail": {
+ "type": "string",
+ "description": "The ID or email of the member to remove"
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The ID of the organization to remove the member from. If not provided, the active organization will be used. Eg: \"org-id\""
+ }
+ },
+ "required": [
+ "memberIdOrEmail"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "member": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "organizationId",
+ "role"
+ ]
+ }
+ },
+ "required": [
+ "member"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/update-member-role": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Update the role of a member in an organization",
+ "operationId": "updateOrganizationMemberRole",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "role": {
+ "type": "string",
+ "description": "The new role to be applied. This can be a string or array of strings representing the roles. Eg: [\"admin\", \"sale\"]"
+ },
+ "memberId": {
+ "type": "string",
+ "description": "The member id to apply the role update to. Eg: \"member-id\""
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "An optional organization ID which the member is a part of to apply the role update. If not provided, you must provide session headers to get the active organization. Eg: \"organization-id\""
+ }
+ },
+ "required": [
+ "role",
+ "memberId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "member": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "organizationId",
+ "role"
+ ]
+ }
+ },
+ "required": [
+ "member"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/leave": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "organizationId": {
+ "type": "string",
+ "description": "The organization Id for the member to leave. Eg: \"organization-id\""
+ }
+ },
+ "required": [
+ "organizationId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list-user-invitations": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "List all invitations a user has received",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "organizationName": {
+ "type": "string"
+ },
+ "inviterId": {
+ "type": "string",
+ "description": "The ID of the user who created the invitation"
+ },
+ "teamId": {
+ "type": "string",
+ "description": "The ID of the team associated with the invitation",
+ "nullable": true
+ },
+ "status": {
+ "type": "string"
+ },
+ "expiresAt": {
+ "type": "string"
+ },
+ "createdAt": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "email",
+ "role",
+ "organizationId",
+ "organizationName",
+ "inviterId",
+ "status",
+ "expiresAt",
+ "createdAt"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list-members": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/get-active-member-role": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/create-team": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Create a new team within an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the team. Eg: \"my-team\""
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The organization ID which the team will be created in. Defaults to the active organization. Eg: \"organization-id\""
+ }
+ },
+ "required": [
+ "name"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Team created successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the created team"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the team"
+ },
+ "organizationId": {
+ "type": "string",
+ "description": "ID of the organization the team belongs to"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team was last updated"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "organizationId",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list-teams": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "List all teams in an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Teams retrieved successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the team"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the team"
+ },
+ "organizationId": {
+ "type": "string",
+ "description": "ID of the organization the team belongs to"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team was last updated"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "organizationId",
+ "createdAt",
+ "updatedAt"
+ ]
+ },
+ "description": "Array of team objects within the organization"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/remove-team": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Remove a team from an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "teamId": {
+ "type": "string",
+ "description": "The team ID of the team to remove. Eg: \"team-id\""
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The organization ID which the team falls under. If not provided, it will default to the user's active organization. Eg: \"organization-id\""
+ }
+ },
+ "required": [
+ "teamId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Team removed successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string",
+ "description": "Confirmation message indicating successful removal",
+ "enum": [
+ "Team removed successfully."
+ ]
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/update-team": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Update an existing team in an organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "teamId": {
+ "type": "string",
+ "description": "The ID of the team to be updated. Eg: \"team-id\""
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "default": "icQPfLVaGoklNpvoH3pn9AZiFFsoFAqD"
+ },
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "createdAt": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "updatedAt": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ }
+ }
+ },
+ "required": [
+ "teamId",
+ "data"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Team updated successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the updated team"
+ },
+ "name": {
+ "type": "string",
+ "description": "Updated name of the team"
+ },
+ "organizationId": {
+ "type": "string",
+ "description": "ID of the organization the team belongs to"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team was last updated"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "organizationId",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/set-active-team": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Set the active team",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "teamId": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": []
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The team",
+ "$ref": "#/components/schemas/Team"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list-user-teams": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "List all teams that the current user is a part of.",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Teams retrieved successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "The team",
+ "$ref": "#/components/schemas/Team"
+ },
+ "description": "Array of team objects within the organization"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/list-team-members": {
+ "get": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "List the members of the given team.",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Teams retrieved successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "The team member",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the team member"
+ },
+ "userId": {
+ "type": "string",
+ "description": "The user ID of the team member"
+ },
+ "teamId": {
+ "type": "string",
+ "description": "The team ID of the team the team member is in"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team member was created"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "teamId",
+ "createdAt"
+ ]
+ },
+ "description": "Array of team member objects within the team"
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/add-team-member": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "The newly created member",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "teamId": {
+ "type": "string",
+ "description": "The team the user should be a member of."
+ },
+ "userId": {
+ "type": "string",
+ "description": "The user Id which represents the user to be added as a member."
+ }
+ },
+ "required": [
+ "teamId",
+ "userId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Team member created successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "The team member",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the team member"
+ },
+ "userId": {
+ "type": "string",
+ "description": "The user ID of the team member"
+ },
+ "teamId": {
+ "type": "string",
+ "description": "The team ID of the team the team member is in"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Timestamp when the team member was created"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "teamId",
+ "createdAt"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/remove-team-member": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Remove a member from a team",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "teamId": {
+ "type": "string",
+ "description": "The team the user should be removed from."
+ },
+ "userId": {
+ "type": "string",
+ "description": "The user which should be removed from the team."
+ }
+ },
+ "required": [
+ "teamId",
+ "userId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Team member removed successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string",
+ "description": "Confirmation message indicating successful removal",
+ "enum": [
+ "Team member removed successfully."
+ ]
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/organization/has-permission": {
+ "post": {
+ "tags": [
+ "Organization"
+ ],
+ "description": "Check if the user has permission",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "permission": {
+ "type": "object",
+ "description": "The permission to check",
+ "deprecated": true
+ },
+ "permissions": {
+ "type": "object",
+ "description": "The permission to check"
+ }
+ },
+ "required": [
+ "permissions"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "success"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/sign-in/oauth2": {
+ "post": {
+ "tags": [
+ "Generic-oauth"
+ ],
+ "description": "Sign in with OAuth2",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "providerId": {
+ "type": "string",
+ "description": "The provider ID for the OAuth provider"
+ },
+ "callbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to after sign in"
+ },
+ "errorCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to if an error occurs"
+ },
+ "newUserCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to after login if the user is new. Eg: \"/welcome\""
+ },
+ "disableRedirect": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Disable redirect"
+ },
+ "scopes": {
+ "type": [
+ "array",
+ "null"
+ ],
+ "description": "Scopes to be passed to the provider authorization request."
+ },
+ "requestSignUp": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider. Eg: false"
+ },
+ "additionalData": {
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "providerId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Sign in with OAuth2",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "redirect": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/oauth2/callback/{providerId}": {
+ "get": {
+ "tags": [
+ "Generic-oauth"
+ ],
+ "description": "OAuth2 callback",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "code",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The OAuth2 code"
+ }
+ },
+ {
+ "name": "error",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The error message, if any"
+ }
+ },
+ {
+ "name": "error_description",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The error description, if any"
+ }
+ },
+ {
+ "name": "state",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The state parameter from the OAuth2 request"
+ }
+ },
+ {
+ "name": "iss",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The issuer identifier"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OAuth2 callback",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/oauth2/link": {
+ "post": {
+ "tags": [
+ "Generic-oauth"
+ ],
+ "description": "Link an OAuth2 account to the current user session",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "providerId": {
+ "type": "string"
+ },
+ "callbackURL": {
+ "type": "string"
+ },
+ "scopes": {
+ "type": [
+ "array",
+ "null"
+ ],
+ "description": "Additional scopes to request when linking the account"
+ },
+ "errorCallbackURL": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The URL to redirect to if there is an error during the link process"
+ }
+ },
+ "required": [
+ "providerId",
+ "callbackURL"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Authorization URL generated successfully for linking an OAuth2 account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The authorization URL to redirect the user to for linking the OAuth2 account"
+ },
+ "redirect": {
+ "type": "boolean",
+ "description": "Indicates that the client should redirect to the provided URL",
+ "enum": [true]
+ }
+ },
+ "required": [
+ "url",
+ "redirect"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/api-key/create": {
+ "post": {
+ "tags": [
+ "Api-key"
+ ],
+ "description": "Create a new API key for a user",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "configId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The configuration ID to use for the API key. If not provided, the default configuration will be used."
+ },
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Name of the Api Key"
+ },
+ "expiresIn": {
+ "type": "string",
+ "default": null
+ },
+ "prefix": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Prefix of the Api Key"
+ },
+ "remaining": {
+ "type": "string",
+ "default": null
+ },
+ "metadata": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "refillAmount": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "Amount to refill the remaining count of the Api Key. server-only. Eg: 100"
+ },
+ "refillInterval": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "Interval to refill the Api Key in milliseconds. server-only. Eg: 1000"
+ },
+ "rateLimitTimeWindow": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "The duration in milliseconds where each request is counted. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 1000"
+ },
+ "rateLimitMax": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"
+ },
+ "rateLimitEnabled": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Whether the key has rate limiting enabled. server-only. Eg: true"
+ },
+ "permissions": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Permissions of the Api Key."
+ },
+ "userId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "User Id of the user that the Api Key belongs to. server-only. Eg: \"user-id\""
+ },
+ "organizationId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'"
+ }
+ },
+ "required": [
+ "expiresIn",
+ "remaining"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "API key created successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the API key"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Creation timestamp"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Last update timestamp"
+ },
+ "name": {
+ "type": "string",
+ "nullable": true,
+ "description": "Name of the API key"
+ },
+ "prefix": {
+ "type": "string",
+ "nullable": true,
+ "description": "Prefix of the API key"
+ },
+ "start": {
+ "type": "string",
+ "nullable": true,
+ "description": "Starting characters of the key (if configured)"
+ },
+ "key": {
+ "type": "string",
+ "description": "The full API key (only returned on creation)"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the key is enabled"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "Expiration timestamp"
+ },
+ "referenceId": {
+ "type": "string",
+ "description": "ID of the reference owning the key"
+ },
+ "lastRefillAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "Last refill timestamp"
+ },
+ "lastRequest": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "Last request timestamp"
+ },
+ "metadata": {
+ "type": "object",
+ "nullable": true,
+ "additionalProperties": true,
+ "description": "Metadata associated with the key"
+ },
+ "rateLimitMax": {
+ "type": "number",
+ "nullable": true,
+ "description": "Maximum requests in time window"
+ },
+ "rateLimitTimeWindow": {
+ "type": "number",
+ "nullable": true,
+ "description": "Rate limit time window in milliseconds"
+ },
+ "remaining": {
+ "type": "number",
+ "nullable": true,
+ "description": "Remaining requests"
+ },
+ "refillAmount": {
+ "type": "number",
+ "nullable": true,
+ "description": "Amount to refill"
+ },
+ "refillInterval": {
+ "type": "number",
+ "nullable": true,
+ "description": "Refill interval in milliseconds"
+ },
+ "rateLimitEnabled": {
+ "type": "boolean",
+ "description": "Whether rate limiting is enabled"
+ },
+ "requestCount": {
+ "type": "number",
+ "description": "Current request count in window"
+ },
+ "permissions": {
+ "type": "object",
+ "nullable": true,
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": "Permissions associated with the key"
+ }
+ },
+ "required": [
+ "id",
+ "createdAt",
+ "updatedAt",
+ "key",
+ "enabled",
+ "referenceId",
+ "rateLimitEnabled",
+ "requestCount"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/api-key/get": {
+ "get": {
+ "tags": [
+ "Api-key"
+ ],
+ "description": "Retrieve an existing API key by ID",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "configId",
+ "in": "query",
+ "schema": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The configuration ID to use for the API key lookup. If not provided, the default configuration will be used."
+ }
+ },
+ {
+ "name": "id",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "description": "The id of the Api Key"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "API key retrieved successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID"
+ },
+ "name": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the key"
+ },
+ "start": {
+ "type": "string",
+ "nullable": true,
+ "description": "Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."
+ },
+ "prefix": {
+ "type": "string",
+ "nullable": true,
+ "description": "The API Key prefix. Stored as plain text."
+ },
+ "userId": {
+ "type": "string",
+ "description": "The owner of the user id"
+ },
+ "refillInterval": {
+ "type": "number",
+ "nullable": true,
+ "description": "The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"
+ },
+ "refillAmount": {
+ "type": "number",
+ "nullable": true,
+ "description": "The amount to refill"
+ },
+ "lastRefillAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "The last refill date"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Sets if key is enabled or disabled",
+ "default": true
+ },
+ "rateLimitEnabled": {
+ "type": "boolean",
+ "description": "Whether the key has rate limiting enabled"
+ },
+ "rateLimitTimeWindow": {
+ "type": "number",
+ "nullable": true,
+ "description": "The duration in milliseconds"
+ },
+ "rateLimitMax": {
+ "type": "number",
+ "nullable": true,
+ "description": "Maximum amount of requests allowed within a window"
+ },
+ "requestCount": {
+ "type": "number",
+ "description": "The number of requests made within the rate limit time window"
+ },
+ "remaining": {
+ "type": "number",
+ "nullable": true,
+ "description": "Remaining requests (every time api key is used this should updated and should be updated on refill as well)"
+ },
+ "lastRequest": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When last request occurred"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "Expiry date of a key"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "created at"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "updated at"
+ },
+ "metadata": {
+ "type": "object",
+ "nullable": true,
+ "additionalProperties": true,
+ "description": "Extra metadata about the apiKey"
+ },
+ "permissions": {
+ "type": "string",
+ "nullable": true,
+ "description": "Permissions for the api key (stored as JSON string)"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "enabled",
+ "rateLimitEnabled",
+ "requestCount",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/api-key/update": {
+ "post": {
+ "tags": [
+ "Api-key"
+ ],
+ "description": "Update an existing API key by ID",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "configId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The configuration ID to use for the API key lookup. If not provided, the default configuration will be used."
+ },
+ "keyId": {
+ "type": "string",
+ "description": "The id of the Api Key"
+ },
+ "userId": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The id of the user which the api key belongs to. server-only. Eg: \"some-user-id\""
+ },
+ "name": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The name of the key"
+ },
+ "enabled": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Whether the Api Key is enabled or not"
+ },
+ "remaining": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "The number of remaining requests"
+ },
+ "refillAmount": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "The refill amount"
+ },
+ "refillInterval": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "The refill interval"
+ },
+ "metadata": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "expiresIn": {
+ "type": "string"
+ },
+ "rateLimitEnabled": {
+ "type": [
+ "boolean",
+ "null"
+ ],
+ "description": "Whether the key has rate limiting enabled."
+ },
+ "rateLimitTimeWindow": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "The duration in milliseconds where each request is counted. server-only. Eg: 1000"
+ },
+ "rateLimitMax": {
+ "type": [
+ "number",
+ "null"
+ ],
+ "description": "Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"
+ },
+ "permissions": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "keyId",
+ "expiresIn",
+ "permissions"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "API key updated successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID"
+ },
+ "name": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the key"
+ },
+ "start": {
+ "type": "string",
+ "nullable": true,
+ "description": "Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."
+ },
+ "prefix": {
+ "type": "string",
+ "nullable": true,
+ "description": "The API Key prefix. Stored as plain text."
+ },
+ "userId": {
+ "type": "string",
+ "description": "The owner of the user id"
+ },
+ "refillInterval": {
+ "type": "number",
+ "nullable": true,
+ "description": "The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"
+ },
+ "refillAmount": {
+ "type": "number",
+ "nullable": true,
+ "description": "The amount to refill"
+ },
+ "lastRefillAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "The last refill date"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Sets if key is enabled or disabled",
+ "default": true
+ },
+ "rateLimitEnabled": {
+ "type": "boolean",
+ "description": "Whether the key has rate limiting enabled"
+ },
+ "rateLimitTimeWindow": {
+ "type": "number",
+ "nullable": true,
+ "description": "The duration in milliseconds"
+ },
+ "rateLimitMax": {
+ "type": "number",
+ "nullable": true,
+ "description": "Maximum amount of requests allowed within a window"
+ },
+ "requestCount": {
+ "type": "number",
+ "description": "The number of requests made within the rate limit time window"
+ },
+ "remaining": {
+ "type": "number",
+ "nullable": true,
+ "description": "Remaining requests (every time api key is used this should updated and should be updated on refill as well)"
+ },
+ "lastRequest": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When last request occurred"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "Expiry date of a key"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "created at"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "updated at"
+ },
+ "metadata": {
+ "type": "object",
+ "nullable": true,
+ "additionalProperties": true,
+ "description": "Extra metadata about the apiKey"
+ },
+ "permissions": {
+ "type": "string",
+ "nullable": true,
+ "description": "Permissions for the api key (stored as JSON string)"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "enabled",
+ "rateLimitEnabled",
+ "requestCount",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/api-key/delete": {
+ "post": {
+ "tags": [
+ "Api-key"
+ ],
+ "description": "Delete an existing API key",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "keyId": {
+ "type": "string",
+ "description": "The id of the API key to delete"
+ }
+ },
+ "required": [
+ "keyId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "API key deleted successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "description": "Indicates if the API key was successfully deleted"
+ }
+ },
+ "required": [
+ "success"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ },
+ "/api-key/list": {
+ "get": {
+ "tags": [
+ "Api-key"
+ ],
+ "description": "List all API keys for the authenticated user or for a specific organization",
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "API keys retrieved successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "apiKeys": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "ID"
+ },
+ "name": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the key"
+ },
+ "start": {
+ "type": "string",
+ "nullable": true,
+ "description": "Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."
+ },
+ "prefix": {
+ "type": "string",
+ "nullable": true,
+ "description": "The API Key prefix. Stored as plain text."
+ },
+ "userId": {
+ "type": "string",
+ "description": "The owner of the user id"
+ },
+ "refillInterval": {
+ "type": "number",
+ "nullable": true,
+ "description": "The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"
+ },
+ "refillAmount": {
+ "type": "number",
+ "nullable": true,
+ "description": "The amount to refill"
+ },
+ "lastRefillAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "The last refill date"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Sets if key is enabled or disabled",
+ "default": true
+ },
+ "rateLimitEnabled": {
+ "type": "boolean",
+ "description": "Whether the key has rate limiting enabled"
+ },
+ "rateLimitTimeWindow": {
+ "type": "number",
+ "nullable": true,
+ "description": "The duration in milliseconds"
+ },
+ "rateLimitMax": {
+ "type": "number",
+ "nullable": true,
+ "description": "Maximum amount of requests allowed within a window"
+ },
+ "requestCount": {
+ "type": "number",
+ "description": "The number of requests made within the rate limit time window"
+ },
+ "remaining": {
+ "type": "number",
+ "nullable": true,
+ "description": "Remaining requests (every time api key is used this should updated and should be updated on refill as well)"
+ },
+ "lastRequest": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "When last request occurred"
+ },
+ "expiresAt": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true,
+ "description": "Expiry date of a key"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "created at"
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "updated at"
+ },
+ "metadata": {
+ "type": "object",
+ "nullable": true,
+ "additionalProperties": true,
+ "description": "Extra metadata about the apiKey"
+ },
+ "permissions": {
+ "type": "string",
+ "nullable": true,
+ "description": "Permissions for the api key (stored as JSON string)"
+ }
+ },
+ "required": [
+ "id",
+ "userId",
+ "enabled",
+ "rateLimitEnabled",
+ "requestCount",
+ "createdAt",
+ "updatedAt"
+ ]
+ }
+ },
+ "total": {
+ "type": "number",
+ "description": "Total number of API keys"
+ },
+ "limit": {
+ "type": "number",
+ "nullable": true,
+ "description": "The limit used for pagination"
+ },
+ "offset": {
+ "type": "number",
+ "nullable": true,
+ "description": "The offset used for pagination"
+ }
+ },
+ "required": [
+ "apiKeys",
+ "total"
+ ]
+ }
+ }
+ }
+ },
+ "400": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
+ },
+ "401": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message"
+ ]
+ }
+ }
+ },
+ "description": "Unauthorized. Due to missing or invalid authentication."
+ },
+ "403": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Forbidden. You do not have permission to access this resource or to perform this action."
+ },
+ "404": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Not Found. The requested resource was not found."
+ },
+ "429": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
+ },
+ "500": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "description": "Internal Server Error. This is a problem with the server that you cannot fix."
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ {
+ "name": "Default",
+ "description": "Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin."
}
- }
-}
+ ]
+}
\ No newline at end of file
diff --git a/apps/web/package.json b/apps/web/package.json
index e1775090b..d374da479 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@base-ui/react": "^1.2.0",
- "@better-auth/api-key": "^1.5.1",
+ "@better-auth/api-key": "^1.5.3",
"@blocknote/core": "^0.47.0",
"@blocknote/react": "^0.47.0",
"@blocknote/shadcn": "^0.47.0",
@@ -48,7 +48,7 @@
"@types/file-saver": "^2.0.7",
"@vitejs/plugin-react": "^5.1.4",
"babel-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
- "better-auth": "^1.5.1",
+ "better-auth": "^1.5.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
diff --git a/apps/web/src/components/settings/api-key-table.tsx b/apps/web/src/components/settings/api-key-table.tsx
index 45baeca4a..354ddd1fb 100644
--- a/apps/web/src/components/settings/api-key-table.tsx
+++ b/apps/web/src/components/settings/api-key-table.tsx
@@ -1,9 +1,21 @@
import { Trash2 } from "lucide-react";
-import { useState } from "react";
+import { useMemo, useState } from "react";
import useDeleteApiKey from "@/hooks/mutations/api-key/use-delete-api-key";
+import { cn } from "@/lib/cn";
import { toast } from "@/lib/toast";
import type { ApiKey } from "@/types/api-key";
+import {
+ AlertDialog,
+ AlertDialogClose,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "../ui/alert-dialog";
+import { Badge } from "../ui/badge";
import { Button } from "../ui/button";
+import { Frame, FramePanel } from "../ui/frame";
import {
Table,
TableBody,
@@ -18,20 +30,49 @@ type ApiKeyTableProps = {
isLoading: boolean;
};
+function formatDate(value: Date | string | null) {
+ if (!value) return "-";
+
+ const date = new Date(value);
+ return new Intl.DateTimeFormat(undefined, {
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ }).format(date);
+}
+
+function getExpirationState(expiresAt: Date | string | null) {
+ if (!expiresAt) {
+ return { label: "Never", isExpired: false };
+ }
+
+ const expirationDate = new Date(expiresAt);
+ const isExpired = expirationDate.getTime() <= Date.now();
+
+ return {
+ label: formatDate(expirationDate),
+ isExpired,
+ };
+}
+
export function ApiKeyTable({ apiKeys, isLoading }: ApiKeyTableProps) {
const { mutateAsync: deleteApiKey } = useDeleteApiKey();
const [deletingId, setDeletingId] = useState<string | null>(null);
+ const [pendingDeleteId, setPendingDeleteId] = useState<string | null>(null);
- const handleDelete = async (id: string, name: string | null) => {
- const keyName = name || "this API key";
- if (!confirm(`Are you sure you want to delete "${keyName}"?`)) {
- return;
- }
+ const pendingDeleteKey = useMemo(
+ () => apiKeys.find((key) => key.id === pendingDeleteId) ?? null,
+ [apiKeys, pendingDeleteId],
+ );
+
+ const handleDelete = async () => {
+ if (!pendingDeleteKey) return;
- setDeletingId(id);
+ setDeletingId(pendingDeleteKey.id);
try {
- await deleteApiKey(id);
+ await deleteApiKey(pendingDeleteKey.id);
toast.success("API key deleted successfully");
+ setPendingDeleteId(null);
} catch (error) {
toast.error(
error instanceof Error ? error.message : "Failed to delete API key",
@@ -43,72 +84,131 @@ export function ApiKeyTable({ apiKeys, isLoading }: ApiKeyTableProps) {
if (isLoading) {
return (
- <div className="border border-border rounded-md p-8 bg-sidebar">
- <p className="text-sm text-muted-foreground text-center">
- Loading API keys...
- </p>
- </div>
+ <Frame>
+ <FramePanel className="p-8">
+ <p className="text-sm text-muted-foreground text-center">
+ Loading API keys...
+ </p>
+ </FramePanel>
+ </Frame>
);
}
if (apiKeys.length === 0) {
return (
- <div className="border border-border rounded-md p-8 bg-sidebar">
- <p className="text-sm text-muted-foreground text-center">
- No API keys yet. Create one to get started.
- </p>
- </div>
+ <Frame>
+ <FramePanel className="p-8">
+ <p className="text-sm text-muted-foreground text-center">
+ No API keys yet. Create one to get started.
+ </p>
+ </FramePanel>
+ </Frame>
);
}
return (
- <div className="border border-border rounded-md bg-sidebar overflow-hidden">
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>Name</TableHead>
- <TableHead>Key</TableHead>
- <TableHead>Created</TableHead>
- <TableHead>Expires</TableHead>
- <TableHead className="w-[100px]">Actions</TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- {apiKeys.map((apiKey) => (
- <TableRow key={apiKey.id}>
- <TableCell className="font-medium">
- {apiKey.name || "Unnamed Key"}
- </TableCell>
- <TableCell>
- <div className="flex items-center gap-2">
- <code className="text-xs bg-background px-2 py-1 rounded border border-border">
- {apiKey.start}...
- </code>
- </div>
- </TableCell>
- <TableCell className="text-muted-foreground">
- {new Date(apiKey.createdAt).toLocaleDateString()}
- </TableCell>
- <TableCell className="text-muted-foreground">
- {apiKey.expiresAt
- ? new Date(apiKey.expiresAt).toLocaleDateString()
- : "Never"}
- </TableCell>
- <TableCell>
- <Button
- variant="ghost"
- size="icon"
- className="h-8 w-8 text-destructive hover:text-destructive"
- onClick={() => handleDelete(apiKey.id, apiKey.name)}
- disabled={deletingId === apiKey.id}
- >
- <Trash2 className="h-4 w-4" />
- </Button>
- </TableCell>
+ <>
+ <Frame>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>Name</TableHead>
+ <TableHead>Key</TableHead>
+ <TableHead>Created</TableHead>
+ <TableHead>Expires</TableHead>
+ <TableHead className="w-[90px] text-right">Actions</TableHead>
</TableRow>
- ))}
- </TableBody>
- </Table>
- </div>
+ </TableHeader>
+ <TableBody>
+ {apiKeys.map((apiKey) => {
+ const expiration = getExpirationState(apiKey.expiresAt);
+
+ return (
+ <TableRow
+ key={apiKey.id}
+ className={cn(
+ expiration.isExpired &&
+ "bg-destructive/5 hover:bg-destructive/10",
+ )}
+ >
+ <TableCell
+ className={cn(
+ "font-medium",
+ expiration.isExpired && "text-destructive-foreground",
+ )}
+ >
+ {apiKey.name || "Unnamed Key"}
+ </TableCell>
+ <TableCell>
+ <code className="text-xs bg-background px-2 py-1 rounded border border-border">
+ {apiKey.start}...
+ </code>
+ </TableCell>
+ <TableCell className="text-muted-foreground">
+ {formatDate(apiKey.createdAt)}
+ </TableCell>
+ <TableCell>
+ {expiration.isExpired ? (
+ <Badge variant="error">Expired {expiration.label}</Badge>
+ ) : (
+ <span className="text-muted-foreground">
+ {expiration.label}
+ </span>
+ )}
+ </TableCell>
+ <TableCell className="text-right">
+ <Button
+ variant="ghost"
+ size="icon"
+ className="h-8 w-8 text-destructive hover:text-destructive"
+ onClick={() => setPendingDeleteId(apiKey.id)}
+ disabled={deletingId === apiKey.id}
+ aria-label={`Delete ${apiKey.name || "API key"}`}
+ >
+ <Trash2 className="h-4 w-4" />
+ </Button>
+ </TableCell>
+ </TableRow>
+ );
+ })}
+ </TableBody>
+ </Table>
+ </Frame>
+
+ <AlertDialog
+ open={Boolean(pendingDeleteKey)}
+ onOpenChange={(nextOpen) => {
+ if (!nextOpen && !deletingId) {
+ setPendingDeleteId(null);
+ }
+ }}
+ >
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle>Delete API key?</AlertDialogTitle>
+ <AlertDialogDescription>
+ This action cannot be undone. This will permanently delete
+ <span className="font-medium text-foreground">
+ {" "}
+ {pendingDeleteKey?.name || "this API key"}
+ </span>
+ .
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogClose render={<Button variant="outline" />}>
+ Cancel
+ </AlertDialogClose>
+ <Button
+ variant="destructive"
+ onClick={handleDelete}
+ disabled={Boolean(deletingId)}
+ >
+ {deletingId ? "Deleting..." : "Delete"}
+ </Button>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ </>
);
}
diff --git a/apps/web/src/components/settings/create-api-key-dialog.tsx b/apps/web/src/components/settings/create-api-key-dialog.tsx
index 46963a38f..8bbd89005 100644
--- a/apps/web/src/components/settings/create-api-key-dialog.tsx
+++ b/apps/web/src/components/settings/create-api-key-dialog.tsx
@@ -32,28 +32,35 @@ import {
SelectValue,
} from "../ui/select";
+const EXPIRATION_SECONDS = {
+ "1d": 86400,
+ "7d": 604800,
+ "30d": 2592000,
+ "90d": 7776000,
+} as const;
+
const EXPIRATION_OPTIONS = [
{
label: "1 day",
- value: "86400",
+ value: "1d",
},
{
label: "7 days",
- value: "604800",
+ value: "7d",
},
{
label: "30 days",
- value: "2592000",
+ value: "30d",
},
{
label: "90 days",
- value: "7776000",
+ value: "90d",
},
{
label: "Never",
value: "never",
},
-];
+] as const;
const createApiKeySchema = z.object({
name: z
@@ -83,19 +90,21 @@ export function CreateApiKeyDialog({
resolver: standardSchemaResolver(createApiKeySchema),
defaultValues: {
name: "",
- expiresIn: "2592000",
+ expiresIn: "30d",
},
});
const onSubmit = async (data: FormValues) => {
const expiresInValue =
- data.expiresIn === "never" ? null : Number.parseInt(data.expiresIn, 10);
+ data.expiresIn === "never"
+ ? null
+ : EXPIRATION_SECONDS[data.expiresIn as keyof typeof EXPIRATION_SECONDS];
setIsSubmitting(true);
try {
const result = await createApiKey({
name: data.name,
- expiresIn: Number.isNaN(expiresInValue) ? null : expiresInValue,
+ expiresIn: expiresInValue ?? null,
});
form.reset();
@@ -119,8 +128,8 @@ export function CreateApiKeyDialog({
return (
<Dialog open={open} onOpenChange={handleClose}>
- <DialogContent className="sm:max-w-md">
- <DialogHeader>
+ <DialogContent className="sm:max-w-lg p-0 gap-0">
+ <DialogHeader className="px-6 py-5 border-b border-border">
<DialogTitle>Create API Key</DialogTitle>
<DialogDescription>
Create a new API key to access the Kaneo API programmatically.
@@ -128,64 +137,62 @@ export function CreateApiKeyDialog({
</DialogHeader>
<Form {...form}>
- <form
- onSubmit={form.handleSubmit(onSubmit)}
- className="space-y-4 px-6"
- >
- <FormField
- control={form.control}
- name="name"
- render={({ field }) => (
- <FormItem>
- <FormLabel className="text-xs">Name</FormLabel>
- <FormControl>
- <Input
- placeholder="My API Key"
- {...field}
- disabled={isSubmitting}
- className="h-8 text-sm"
- />
- </FormControl>
- <FormDescription className="text-xs">
- A descriptive name for this API key
- </FormDescription>
- <FormMessage />
- </FormItem>
- )}
- />
+ <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-0">
+ <div className="space-y-5 px-6 py-5">
+ <FormField
+ control={form.control}
+ name="name"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Name</FormLabel>
+ <FormControl>
+ <Input
+ placeholder="My API Key"
+ {...field}
+ disabled={isSubmitting}
+ />
+ </FormControl>
+ <FormDescription>
+ A descriptive name for this API key
+ </FormDescription>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
- <FormField
- control={form.control}
- name="expiresIn"
- render={({ field }) => (
- <FormItem>
- <FormLabel className="text-xs">Expiration</FormLabel>
- <FormControl>
- <Select
- onValueChange={field.onChange}
- value={field.value}
- disabled={isSubmitting}
- >
- <SelectTrigger className="h-8 text-xs">
- <SelectValue placeholder="Select expiration" />
- </SelectTrigger>
- <SelectContent>
- {EXPIRATION_OPTIONS.map((option) => (
- <SelectItem key={option.value} value={option.value}>
- {option.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </FormControl>
- <FormDescription className="text-xs">
- Choose how long this API key should remain valid. Never will
- create a key without an automatic expiry.
- </FormDescription>
- <FormMessage />
- </FormItem>
- )}
- />
+ <FormField
+ control={form.control}
+ name="expiresIn"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Expiration</FormLabel>
+ <FormControl>
+ <Select
+ onValueChange={field.onChange}
+ value={field.value}
+ disabled={isSubmitting}
+ >
+ <SelectTrigger>
+ <SelectValue placeholder="Select expiration" />
+ </SelectTrigger>
+ <SelectContent>
+ {EXPIRATION_OPTIONS.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </FormControl>
+ <FormDescription>
+ Choose how long this API key should remain valid. Never
+ will create a key without an automatic expiry.
+ </FormDescription>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
<DialogFooter className="gap-2 sm:gap-2">
<Button
@@ -193,15 +200,10 @@ export function CreateApiKeyDialog({
variant="outline"
onClick={handleClose}
disabled={isSubmitting}
- className="h-8 text-xs"
>
Cancel
</Button>
- <Button
- type="submit"
- disabled={isSubmitting}
- className="h-8 text-xs"
- >
+ <Button type="submit" disabled={isSubmitting}>
{isSubmitting ? "Creating..." : "Create"}
</Button>
</DialogFooter>
diff --git a/apps/web/src/hooks/mutations/api-key/use-create-api-key.ts b/apps/web/src/hooks/mutations/api-key/use-create-api-key.ts
index 6f136e276..a0039c9f9 100644
--- a/apps/web/src/hooks/mutations/api-key/use-create-api-key.ts
+++ b/apps/web/src/hooks/mutations/api-key/use-create-api-key.ts
@@ -1,7 +1,7 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { authClient } from "@/lib/auth-client";
import type {
- CreateApiKeyRequest,
+ CreateApiKeyClientRequest,
CreateApiKeyResponse,
} from "@/types/api-key";
@@ -9,7 +9,7 @@ function useCreateApiKey() {
const queryClient = useQueryClient();
return useMutation({
- mutationFn: async (data: CreateApiKeyRequest) => {
+ mutationFn: async (data: CreateApiKeyClientRequest) => {
const result = await authClient.apiKey.create({
name: data.name,
expiresIn: data.expiresIn,
diff --git a/apps/web/src/hooks/queries/use-get-api-keys.ts b/apps/web/src/hooks/queries/use-get-api-keys.ts
index 41bef8586..bf4ff76f1 100644
--- a/apps/web/src/hooks/queries/use-get-api-keys.ts
+++ b/apps/web/src/hooks/queries/use-get-api-keys.ts
@@ -1,6 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { authClient } from "@/lib/auth-client";
-import type { ApiKey } from "@/types/api-key";
function useGetApiKeys() {
return useQuery({
@@ -12,7 +11,7 @@ function useGetApiKeys() {
throw new Error(result.error.message);
}
- return (result.data || []) as ApiKey[];
+ return result.data.apiKeys || [];
},
});
}
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/developer.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/developer.tsx
index 65df0cb10..7a1759789 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/developer.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/developer.tsx
@@ -1,12 +1,20 @@
import { createFileRoute } from "@tanstack/react-router";
-import { Plus } from "lucide-react";
+import { KeyRound, Plus } from "lucide-react";
import { useState } from "react";
import PageTitle from "@/components/page-title";
import { ApiKeyCreatedModal } from "@/components/settings/api-key-created-modal";
import { ApiKeyTable } from "@/components/settings/api-key-table";
import { CreateApiKeyDialog } from "@/components/settings/create-api-key-dialog";
import { Button } from "@/components/ui/button";
-import { Separator } from "@/components/ui/separator";
+import {
+ Card,
+ CardAction,
+ CardDescription,
+ CardFrame,
+ CardHeader,
+ CardPanel,
+ CardTitle,
+} from "@/components/ui/card";
import useGetApiKeys from "@/hooks/queries/use-get-api-keys";
import type { CreateApiKeyResponse } from "@/types/api-key";
@@ -46,31 +54,34 @@ function RouteComponent() {
</p>
</div>
- <div className="space-y-6">
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <div>
- <h2 className="text-md font-medium">API Keys</h2>
- <p className="text-xs text-muted-foreground">
- Create and manage API keys for programmatic access to Kaneo.
- </p>
- </div>
- <Button
- onClick={() => setCreateDialogOpen(true)}
- size="sm"
- variant="outline"
- className="gap-1.5 h-8"
- >
- <Plus className="h-3.5 w-3.5" />
- <span className="text-xs">Create API Key</span>
- </Button>
- </div>
- </div>
+ <CardFrame>
+ <Card className="!rounded-none !border-t-0">
+ <CardHeader>
+ <CardTitle className="inline-flex items-center gap-2 text-base">
+ <KeyRound className="size-4" />
+ API Keys
+ </CardTitle>
+ <CardDescription>
+ Create and manage API keys for programmatic access to Kaneo.
+ </CardDescription>
+ <CardAction>
+ <Button
+ onClick={() => setCreateDialogOpen(true)}
+ className="gap-2"
+ >
+ <Plus className="size-4" />
+ Create API Key
+ </Button>
+ </CardAction>
+ </CardHeader>
+ </Card>
- <Separator />
-
- <ApiKeyTable apiKeys={apiKeys} isLoading={isLoading} />
- </div>
+ <Card className="!rounded-none">
+ <CardPanel className="p-4">
+ <ApiKeyTable apiKeys={apiKeys} isLoading={isLoading} />
+ </CardPanel>
+ </Card>
+ </CardFrame>
</div>
<CreateApiKeyDialog
diff --git a/apps/web/src/types/api-key.ts b/apps/web/src/types/api-key.ts
index 96f9cbfaa..79fe40a98 100644
--- a/apps/web/src/types/api-key.ts
+++ b/apps/web/src/types/api-key.ts
@@ -1,33 +1,15 @@
-export type ApiKey = {
- id: string;
- name: string | null;
- prefix: string | null;
- start: string | null;
- enabled: boolean;
- createdAt: Date;
- expiresAt: Date | null;
- permissions: Record<string, string[]> | null;
- userId: string;
- refillInterval: number | null;
- refillAmount: number | null;
- lastRefillAt: Date | null;
- rateLimitEnabled: boolean;
- rateLimitTimeWindow: number | null;
- rateLimitMax: number | null;
- requestCount: number;
- remaining: number | null;
- lastRequest: Date | null;
- updatedAt: Date;
- metadata: Record<string, unknown> | null;
-};
+import type { authClient } from "@/lib/auth-client";
-export type CreateApiKeyRequest = {
- name?: string;
- expiresIn?: number | null;
- prefix?: string;
- metadata?: Record<string, unknown>;
-};
+export type ApiKey = NonNullable<
+ Awaited<ReturnType<typeof authClient.apiKey.list>>["data"]
+>;
-export type CreateApiKeyResponse = ApiKey & {
- key: string; // Full key, only shown once
-};
+export type CreateApiKeyRequest = NonNullable<
+ Parameters<typeof authClient.apiKey.create>[0]
+>;
+
+export type CreateApiKeyClientRequest = Omit<CreateApiKeyRequest, "userId">;
+
+export type CreateApiKeyResponse = NonNullable<
+ Awaited<ReturnType<typeof authClient.apiKey.create>>["data"]
+>;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f7a0adf33..b27b1c899 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -43,8 +43,11 @@ importers:
apps/api:
dependencies:
'@better-auth/api-key':
- specifier: ^1.5.1
+ specifier: ^1.5.3
+ version: 1.5.3(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])([email protected](65e06f828b3c0b60e3494db4c9af5f81))
+ '@better-auth/drizzle-adapter':
+ specifier: ^1.5.3
'@hono/node-server':
specifier: ^1.19.9
version: 1.19.9([email protected])
@@ -73,8 +76,8 @@ importers:
specifier: ^6.0.0
version: 6.0.0
better-auth:
- specifier: ^1.5.1
+ specifier: ^1.5.3
+ version: 1.5.3(65e06f828b3c0b60e3494db4c9af5f81)
croner:
specifier: ^10.0.1
version: 10.0.1
@@ -192,8 +195,8 @@ importers:
specifier: ^1.2.0
'@better-auth/api-key':
- specifier: ^1.5.1
- version: 1.5.1(bca87203997e5d454a81b6f25dd9aa18)
+ specifier: ^1.5.3
+ version: 1.5.3(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])([email protected](a660160d7f82d51a45c29b1b97b38fd9))
'@blocknote/core':
specifier: ^0.47.0
version: 0.47.0(@types/[email protected])
@@ -300,8 +303,8 @@ importers:
specifier: ^19.0.0-beta-714736e-20250131
version: 19.0.0-beta-ebf51a3-20250411
better-auth:
- specifier: ^1.5.1
+ specifier: ^1.5.3
+ version: 1.5.3(a660160d7f82d51a45c29b1b97b38fd9)
class-variance-authority:
specifier: ^0.7.1
version: 0.7.1
@@ -659,15 +662,15 @@ packages:
'@types/react':
optional: true
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-yZ24TrMySPG8eGrmcOFdZD7RyJvaQZvbqyQL4dZAvGJkl65r3CLjYSSxbUE8gxs//R5x/cLto+tGxOjx8ssmcw==}
+ '@better-auth/[email protected]':
+ resolution: {integrity: sha512-AcyPzkoR9bwzRAVFx3I3+e2lJscOdCG4h/WqQ081YMwWyFctCCjLDUTkQLSU/ZnDI9afgkHjiO9GcbGFaZdIxg==}
peerDependencies:
- '@better-auth/core': 1.5.1
+ '@better-auth/core': 1.5.3
'@better-auth/utils': 0.3.1
- better-auth: 1.5.1
+ better-auth: 1.5.3
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-lHDoChK6FFy3+oawt/tl9S08LuYNnbT1o3HKxleFrRtQIyIdUKu38X8AUJ8ueB6sE+ju5YhxBqoCFhdb6Aa67A==}
+ '@better-auth/[email protected]':
+ resolution: {integrity: sha512-fORsQjNZ6BQ7o96xMe7elz3Y4Y8DsqXmQrdyzt289G9rmzX4auwBCPTtE2cXTRTYGiVvH9bv0b97t1Uo/OWynQ==}
peerDependencies:
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
@@ -680,45 +683,30 @@ packages:
'@cloudflare/workers-types':
optional: true
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-0KKIpDTi1IWXVHL//H8w0S8oQ9KjdlE5YgN9mMloMbU1uyxZ0shhUiT8mC9025vwkZ7OXLywI2hFeGJ+mcdRBQ==}
+ '@better-auth/[email protected]':
+ resolution: {integrity: sha512-dib9V1vpwDu+TKLC+L+8Q5bLNS0uE3JCT4pGotw52pnpiQF8msoMK4eEfri19f8DtNltpb2F2yzyIsTugBBYNQ==}
peerDependencies:
- '@better-auth/core': 1.5.1
+ '@better-auth/core': 1.5.3
'@better-auth/utils': ^0.3.0
drizzle-orm: '>=0.41.0'
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-OuhmNKjxpHlSw214kww4/tGfLHjtyC/HzN6Q/HulUeRF5QyCCHqj0y44ba6WGj3hcGsvPUkdUk4SayKXCrUCFw==}
+ '@better-auth/[email protected]':
+ resolution: {integrity: sha512-eAm1KPrlPXkH/qXUXnGBcHPDgCX153b6BSlc2QJ2IeqmiWym9D/6XORqBIZOl71JiP0Cifzocr2GLpnz0gt31Q==}
peerDependencies:
- '@better-auth/core': 1.5.1
+ '@better-auth/core': 1.5.3
'@better-auth/utils': ^0.3.0
kysely: ^0.27.0 || ^0.28.0
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-FSacaykLJXEizbnShF2FWZtWk5j0f87iq5Esjfd/7XHcF9nZeXn9Ju8jItDKeOWbEasOdfErEBqWSn30hmueRQ==}
+ '@better-auth/[email protected]':
+ resolution: {integrity: sha512-QdeTI3bvUmaPkHsjcSMfroXyuGsgnxobv7wZVl57e+ox6yQVR1j4VKbqmCILP6PL6Rr2gpcBH/liHr8v5gqY5Q==}
peerDependencies:
- '@better-auth/core': 1.5.1
+ '@better-auth/core': 1.5.3
'@better-auth/utils': ^0.3.0
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-BrbVuH1cqjs86Z6ae8OFEbvNLNxibddU4hDApVNtJcz7a/BaUPUdIM1Ep7HFhDozK7DrODXWZGLFXk+yV2pt3g==}
+ '@better-auth/[email protected]':
+ resolution: {integrity: sha512-ZX/r8AsWdB6BwH+Rb7H/SyJnGtPN6EDWrNxBQEDsqRrBJVcDLwAIz165P57RXci0WwtY872T0guKq+XVyy5rkA==}
peerDependencies:
- '@better-auth/core': 1.5.1
- '@better-auth/utils': ^0.3.0
- mongodb: ^6.0.0 || ^7.0.0
-
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-24kBkBVaQbLnGe3/V/H+nX0hYaI+wNZFJhMnK16GQV7g6LyQw7UOcsd1xPDKtC61JCDmXEEEqXfnyuw5QITMVw==}
- peerDependencies:
- '@better-auth/core': 1.5.1
- '@better-auth/utils': ^0.3.0
- '@prisma/client': ^5.0.0 || ^6.0.0 || ^7.0.0
- prisma: ^5.0.0 || ^6.0.0 || ^7.0.0
-
- '@better-auth/[email protected]':
- resolution: {integrity: sha512-bHn9sdmf1bWUiC75J8FIF3rAEnL5ICihY5IBoXKVwxemaB3jSXL/sG9OpmadapPXlC8BY2OuATxdg39qbg+JlA==}
- peerDependencies:
- '@better-auth/core': 1.5.1
+ '@better-auth/core': 1.5.3
'@better-auth/[email protected]':
resolution: {integrity: sha512-+CGp4UmZSUrHHnpHhLPYu6cV+wSUSvVbZbNykxhUDocpVNTo9uFFxw/NqJlh1iC4wQ9HKKWGCKuZ5wUgS0v6Kg==}
@@ -4091,9 +4079,12 @@ packages:
resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==}
- resolution: {integrity: sha512-Hnr4Ar49WpC0wyHFKYA86eQL5HhN5sNhtNquHrsH0T0r/IDqxDxAfW1VdSnTaXv4zc2WCXCQ8b1+InAopR2hAw==}
+ resolution: {integrity: sha512-E+9kA9GMX1+gT3FfMCqRz0NufT4X/+tNhpOsHW1jLmyPZKinkHtfZkUffSBnG5qGkvfBaH/slT5c1fKttnmF5w==}
peerDependencies:
+ '@better-auth/drizzle-adapter': 1.5.3
+ '@better-auth/mongo-adapter': 1.5.3
+ '@better-auth/prisma-adapter': 1.5.3
'@lynx-js/react': '*'
'@prisma/client': ^5.0.0 || ^6.0.0 || ^7.0.0
'@sveltejs/kit': ^2.0.0
@@ -4114,6 +4105,12 @@ packages:
vitest: ^2.0.0 || ^3.0.0 || ^4.0.0
vue: ^3.0.0
peerDependenciesMeta:
+ '@better-auth/drizzle-adapter':
+ optional: true
+ '@better-auth/mongo-adapter':
+ optional: true
+ '@better-auth/prisma-adapter':
+ optional: true
'@lynx-js/react':
optional: true
'@prisma/client':
@@ -7570,21 +7567,21 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.14
dependencies:
'@better-auth/utils': 0.3.1
+ better-auth: 1.5.3(65e06f828b3c0b60e3494db4c9af5f81)
zod: 4.3.6
- '@better-auth/[email protected](bca87203997e5d454a81b6f25dd9aa18)':
dependencies:
'@better-auth/utils': 0.3.1
+ better-auth: 1.5.3(a660160d7f82d51a45c29b1b97b38fd9)
zod: 4.3.6
dependencies:
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
@@ -7595,52 +7592,33 @@ snapshots:
nanostores: 1.1.1
zod: 4.3.6
dependencies:
'@better-auth/utils': 0.3.1
+ optional: true
dependencies:
'@better-auth/utils': 0.3.1
dependencies:
'@better-auth/utils': 0.3.1
kysely: 0.28.11
dependencies:
'@better-auth/utils': 0.3.1
- dependencies:
- '@better-auth/utils': 0.3.1
- mongodb: 7.1.0
-
dependencies:
- '@better-auth/utils': 0.3.1
-
- dependencies:
- '@better-auth/utils': 0.3.1
-
- dependencies:
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
@@ -7803,15 +7781,19 @@ snapshots:
'@chevrotain/gast': 10.5.0
'@chevrotain/types': 10.5.0
lodash: 4.17.21
+ optional: true
'@chevrotain/[email protected]':
dependencies:
'@chevrotain/types': 10.5.0
lodash: 4.17.21
+ optional: true
- '@chevrotain/[email protected]': {}
+ '@chevrotain/[email protected]':
+ optional: true
- '@chevrotain/[email protected]': {}
+ '@chevrotain/[email protected]':
+ optional: true
dependencies:
@@ -7978,12 +7960,15 @@ snapshots:
'@electric-sql/[email protected](@electric-sql/[email protected])':
dependencies:
'@electric-sql/pglite': 0.3.15
+ optional: true
'@electric-sql/[email protected](@electric-sql/[email protected])':
dependencies:
'@electric-sql/pglite': 0.3.15
+ optional: true
- '@electric-sql/[email protected]': {}
+ '@electric-sql/[email protected]':
+ optional: true
'@emnapi/[email protected]':
dependencies:
@@ -8422,6 +8407,7 @@ snapshots:
dependencies:
hono: 4.11.4
+ optional: true
dependencies:
@@ -8621,11 +8607,13 @@ snapshots:
'@mongodb-js/[email protected]':
dependencies:
sparse-bitfield: 3.0.3
+ optional: true
'@mrleebo/[email protected]':
dependencies:
chevrotain: 10.5.0
lilconfig: 2.1.0
+ optional: true
dependencies:
@@ -8887,7 +8875,8 @@ snapshots:
bignumber.js: 9.3.1
error-causes: 3.0.2
- '@prisma/[email protected]': {}
+ '@prisma/[email protected]':
+ optional: true
dependencies:
@@ -8895,6 +8884,7 @@ snapshots:
optionalDependencies:
typescript: 5.8.3
+ optional: true
dependencies:
@@ -8902,6 +8892,7 @@ snapshots:
optionalDependencies:
typescript: 5.9.3
+ optional: true
'@prisma/[email protected]':
dependencies:
@@ -8911,10 +8902,13 @@ snapshots:
empathic: 2.0.0
transitivePeerDependencies:
- magicast
+ optional: true
- '@prisma/[email protected]': {}
+ '@prisma/[email protected]':
+ optional: true
- '@prisma/[email protected]': {}
+ '@prisma/[email protected]':
+ optional: true
dependencies:
@@ -8937,6 +8931,7 @@ snapshots:
zeptomatch: 2.1.0
transitivePeerDependencies:
- typescript
+ optional: true
dependencies:
@@ -8959,8 +8954,10 @@ snapshots:
zeptomatch: 2.1.0
transitivePeerDependencies:
- typescript
+ optional: true
- '@prisma/engines-version@7.5.0-10.94a226be1cf2967af2541cca5529f0f7ba866919': {}
+ '@prisma/engines-version@7.5.0-10.94a226be1cf2967af2541cca5529f0f7ba866919':
+ optional: true
'@prisma/[email protected]':
dependencies:
@@ -8968,28 +8965,34 @@ snapshots:
'@prisma/engines-version': 7.5.0-10.94a226be1cf2967af2541cca5529f0f7ba866919
'@prisma/fetch-engine': 7.4.2
'@prisma/get-platform': 7.4.2
+ optional: true
'@prisma/[email protected]':
dependencies:
'@prisma/debug': 7.4.2
'@prisma/engines-version': 7.5.0-10.94a226be1cf2967af2541cca5529f0f7ba866919
'@prisma/get-platform': 7.4.2
+ optional: true
'@prisma/[email protected]':
dependencies:
'@prisma/debug': 7.2.0
+ optional: true
'@prisma/[email protected]':
dependencies:
'@prisma/debug': 7.4.2
+ optional: true
- '@prisma/[email protected]': {}
+ '@prisma/[email protected]':
+ optional: true
dependencies:
'@types/react': 19.2.14
react: 19.2.4
react-dom: 19.2.4([email protected])
+ optional: true
'@radix-ui/[email protected]': {}
@@ -11045,11 +11048,13 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
+ '@types/[email protected]':
+ optional: true
dependencies:
'@types/webidl-conversions': 7.0.3
+ optional: true
'@ungap/[email protected]': {}
@@ -11142,7 +11147,8 @@ snapshots:
postcss: 8.5.6
postcss-value-parser: 4.2.0
+ optional: true
@@ -11209,15 +11215,12 @@ snapshots:
+ [email protected](65e06f828b3c0b60e3494db4c9af5f81):
dependencies:
- '@better-auth/memory-adapter': 1.5.1(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])
+ '@better-auth/memory-adapter': 1.5.3(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
'@noble/ciphers': 2.1.1
@@ -11229,29 +11232,27 @@ snapshots:
nanostores: 1.1.1
zod: 4.3.6
optionalDependencies:
drizzle-kit: 0.31.9
mongodb: 7.1.0
mysql2: 3.15.3
pg: 8.19.0
react: 19.2.4
react-dom: 19.2.4([email protected])
solid-js: 1.9.10
transitivePeerDependencies:
- '@cloudflare/workers-types'
+ [email protected](a660160d7f82d51a45c29b1b97b38fd9):
dependencies:
- '@better-auth/memory-adapter': 1.5.1(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])
+ '@better-auth/memory-adapter': 1.5.3(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
'@noble/ciphers': 2.1.1
@@ -11263,14 +11264,15 @@ snapshots:
nanostores: 1.1.1
zod: 4.3.6
optionalDependencies:
drizzle-kit: 0.31.9
mongodb: 7.1.0
mysql2: 3.15.3
pg: 8.19.0
react: 19.2.4
react-dom: 19.2.4([email protected])
solid-js: 1.9.10
@@ -11318,7 +11320,8 @@ snapshots:
node-releases: 2.0.27
update-browserslist-db: 1.2.2([email protected])
+ optional: true
@@ -11342,6 +11345,7 @@ snapshots:
perfect-debounce: 1.0.0
pkg-types: 2.3.0
rc9: 2.1.2
+ optional: true
dependencies:
@@ -11377,6 +11381,7 @@ snapshots:
'@chevrotain/utils': 10.5.0
lodash: 4.17.21
regexp-to-ast: 0.5.0
+ optional: true
dependencies:
@@ -11561,7 +11566,8 @@ snapshots:
+ optional: true
@@ -11576,13 +11582,15 @@ snapshots:
+ optional: true
+ optional: true
@@ -11654,6 +11662,7 @@ snapshots:
pg: 8.19.0
postgres: 3.4.7
+ optional: true
optionalDependencies:
@@ -11687,6 +11696,7 @@ snapshots:
dependencies:
'@standard-schema/spec': 1.1.0
fast-check: 3.23.2
+ optional: true
@@ -11698,7 +11708,8 @@ snapshots:
+ optional: true
@@ -12002,6 +12013,7 @@ snapshots:
dependencies:
pure-rand: 6.1.0
+ optional: true
@@ -12103,6 +12115,7 @@ snapshots:
dependencies:
is-property: 1.0.2
+ optional: true
@@ -12127,7 +12140,8 @@ snapshots:
+ optional: true
dependencies:
@@ -12153,6 +12167,7 @@ snapshots:
node-fetch-native: 1.6.7
nypm: 0.6.2
pathe: 2.0.3
+ optional: true
dependencies:
@@ -12187,9 +12202,11 @@ snapshots:
+ optional: true
+ optional: true
@@ -12354,7 +12371,8 @@ snapshots:
'@hono/standard-validator': 0.2.2(@standard-schema/[email protected])([email protected])
hono: 4.12.3
+ optional: true
@@ -12387,7 +12405,8 @@ snapshots:
statuses: 2.0.2
toidentifier: 1.0.1
+ optional: true
dependencies:
@@ -12479,7 +12498,8 @@ snapshots:
+ optional: true
@@ -12651,7 +12671,8 @@ snapshots:
lightningcss-win32-arm64-msvc: 1.31.1
lightningcss-win32-x64-msvc: 1.31.1
+ optional: true
@@ -12683,7 +12704,8 @@ snapshots:
+ optional: true
dependencies:
@@ -12695,7 +12717,8 @@ snapshots:
is-unicode-supported: 2.1.0
yoctocolors: 2.1.2
+ optional: true
@@ -12705,7 +12728,8 @@ snapshots:
dependencies:
yallist: 3.1.1
+ optional: true
dependencies:
@@ -12895,7 +12919,8 @@ snapshots:
+ optional: true
@@ -13129,12 +13154,14 @@ snapshots:
dependencies:
'@types/whatwg-url': 13.0.0
whatwg-url: 14.2.0
+ optional: true
dependencies:
'@mongodb-js/saslprep': 1.4.6
bson: 7.2.0
mongodb-connection-string-url: 7.0.1
+ optional: true
dependencies:
@@ -13182,10 +13209,12 @@ snapshots:
named-placeholders: 1.1.6
seq-queue: 0.0.5
sqlstring: 2.3.3
+ optional: true
dependencies:
lru.min: 1.1.4
+ optional: true
@@ -13272,7 +13301,8 @@ snapshots:
+ optional: true
dependencies:
@@ -13325,7 +13355,8 @@ snapshots:
'@octokit/types': 16.0.0
'@octokit/webhooks': 14.2.0
+ optional: true
dependencies:
@@ -13437,7 +13468,8 @@ snapshots:
+ optional: true
optional: true
@@ -13517,7 +13549,8 @@ snapshots:
dependencies:
xtend: 4.0.2
+ optional: true
@@ -13542,6 +13575,7 @@ snapshots:
- magicast
- react
- react-dom
+ optional: true
dependencies:
@@ -13558,6 +13592,7 @@ snapshots:
- magicast
- react
- react-dom
+ optional: true
@@ -13571,6 +13606,7 @@ snapshots:
graceful-fs: 4.2.11
retry: 0.12.0
signal-exit: 3.0.7
+ optional: true
@@ -13698,9 +13734,11 @@ snapshots:
+ optional: true
+ optional: true
dependencies:
@@ -13786,6 +13824,7 @@ snapshots:
dependencies:
defu: 6.1.4
destr: 2.0.5
+ optional: true
dependencies:
@@ -13938,7 +13977,8 @@ snapshots:
tiny-invariant: 1.3.3
tslib: 2.8.1
+ optional: true
dependencies:
@@ -14004,7 +14044,8 @@ snapshots:
mdast-util-to-markdown: 2.1.2
unified: 11.0.5
+ optional: true
@@ -14023,7 +14064,8 @@ snapshots:
onetime: 7.0.0
signal-exit: 4.1.0
+ optional: true
@@ -14107,7 +14149,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ optional: true
dependencies:
@@ -14310,14 +14353,17 @@ snapshots:
dependencies:
memory-pager: 1.5.0
+ optional: true
+ optional: true
+ optional: true
@@ -14494,6 +14540,7 @@ snapshots:
dependencies:
punycode: 2.3.1
+ optional: true
@@ -14682,6 +14729,7 @@ snapshots:
optionalDependencies:
typescript: 5.8.3
+ optional: true
optionalDependencies:
@@ -14728,7 +14776,8 @@ snapshots:
+ optional: true
@@ -14736,6 +14785,7 @@ snapshots:
dependencies:
tr46: 5.1.1
webidl-conversions: 7.0.0
+ optional: true
@@ -14823,6 +14873,7 @@ snapshots:
dependencies:
grammex: 3.1.12
graphmatch: 1.1.1
+ optional: true
dependencies: