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
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/csrf | Get CSRF token |
| POST | /api/auth/[...nextauth] | NextAuth session management |
| POST | /api/auth/request-reset | Request password reset email |
| POST | /api/auth/reset-password | Reset password with token |
| GET | /api/auth/verify | Verify account email |
| POST | /api/auth/resend-verify | Resend verification email |
Media
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/media/[id] | Get media item details |
| PUT | /api/media/[id] | Update media item (owner only; optional commentsEnabled) |
| POST | /api/upload | Upload new media file |
| POST | /api/media/[id]/comment | Post 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]/download | Download original file |
| GET | /api/media/[id]/extract-text | Extract text from document |
User Profile
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/user/profile | Get current user profile |
| PATCH | /api/user/profile | Update current user profile (username is fixed) |
| GET | /api/user/profile/[id] | Get user profile by ID |
| POST | /api/user/avatar/route | Upload avatar image |
| GET | /api/user/commissions | Get user commissions |
| PATCH | /api/user/notification-prefs | Update in-app notification preferences |
Groups & Forum
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/groups | List all groups |
| POST | /api/groups | Create a new group |
| GET | /api/groups/[slug] | Get group details |
| PUT | /api/groups/[slug]/privacy | Update group privacy setting |
| GET | /api/groups/[slug]/members | List group members |
| POST | /api/groups/[slug]/invites | Send group invite |
| DELETE | /api/groups/[slug]/forum/thread/[threadId]/comments/[commentId] | Delete a forum comment (its author or a moderator) |
Notifications
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notifications/list | List notifications |
| GET | /api/notifications/unread-count | Get unread count + new-art feed count |
| POST | /api/notifications/read-all | Mark all as read |
| PATCH | /api/notifications/[id]/read | Mark single notification as read |
Following Feed
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/following/clear | Mark 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.
