API Documentation

DrawDog provides a RESTful API for interacting with media, users, groups, and notifications. All endpoints require authentication unless noted otherwise. Requests must include a valid CSRF token in the X-CSRF-Token header for state-changing methods.

Authentication

MethodEndpointDescription
POST/api/auth/csrfGet CSRF token
POST/api/auth/[...nextauth]NextAuth session management
POST/api/auth/request-resetRequest password reset email
POST/api/auth/reset-passwordReset password with token
GET/api/auth/verifyVerify account email
POST/api/auth/resend-verifyResend verification email

Media

MethodEndpointDescription
GET/api/media/[id]Get media item details
PUT/api/media/[id]Update media item (owner only; optional commentsEnabled)
POST/api/uploadUpload new media file
POST/api/media/[id]/commentPost a comment or reply (optional parentId)
PATCH/api/media/[id]/comment/[commentId]Hide/unhide a comment (work author only)
DELETE/api/media/[id]/comment/[commentId]Delete a comment (its author or the work's author)
GET/api/media/[id]/downloadDownload original file
GET/api/media/[id]/extract-textExtract text from document

User Profile

MethodEndpointDescription
GET/api/user/profileGet current user profile
PATCH/api/user/profileUpdate current user profile (username is fixed)
GET/api/user/profile/[id]Get user profile by ID
POST/api/user/avatar/routeUpload avatar image
GET/api/user/commissionsGet user commissions
PATCH/api/user/notification-prefsUpdate in-app notification preferences

Groups & Forum

MethodEndpointDescription
GET/api/groupsList all groups
POST/api/groupsCreate a new group
GET/api/groups/[slug]Get group details
PUT/api/groups/[slug]/privacyUpdate group privacy setting
GET/api/groups/[slug]/membersList group members
POST/api/groups/[slug]/invitesSend group invite
DELETE/api/groups/[slug]/forum/thread/[threadId]/comments/[commentId]Delete a forum comment (its author or a moderator)

Notifications

MethodEndpointDescription
GET/api/notifications/listList notifications
GET/api/notifications/unread-countGet unread count + new-art feed count
POST/api/notifications/read-allMark all as read
PATCH/api/notifications/[id]/readMark single notification as read

Following Feed

MethodEndpointDescription
POST/api/following/clearMark followed-artist feed entries as seen

Authentication

Most endpoints require an authenticated session. Use the CSRF endpoint first to obtain a token, then include it in your request headers. Session cookies are managed automatically by NextAuth.