Workspaces
List, create, and update workspaces.
Workspaces group your social accounts, posts, media, and team. Most content routes need X-Workspace-Id set to one of these ids.
List workspaces
GET /api/workspaces
curl https://api.dunsocial.com/api/workspaces \
-H "Authorization: Bearer YOUR_TOKEN"Returns each workspace with your role.
Create a workspace
POST /api/workspaces
Body: { "name": "Acme", "slug"?: "acme", "timezone"?: "America/New_York" }
Returns 201. Explicit slug conflicts return 409.
Check a slug first: GET /api/workspaces/slug-availability?slug=acme
Get a workspace
GET /api/workspaces/:id
Requires membership. Includes role and a short subscription summary.
Update a workspace
PATCH /api/workspaces/:id
Body: { "name"?, "timezone"?, "logo"? }
Members with role member cannot update (403). Owners and admins can.
Profile and logo
| Method | Path | Notes |
|---|---|---|
PATCH |
/api/workspaces/:id/profile |
{ name, slug, logo? } — slug conflicts return 409 |
POST |
/api/workspaces/:id/logo/upload-url |
Presigned upload |
DELETE |
/api/workspaces/:id/logo |
Clear logo |
AI voice settings
| Method | Path |
|---|---|
GET / PATCH |
/api/workspaces/:id/ai-voice-settings |
GET / POST |
/api/workspaces/:id/ai-voice-presets |
PATCH / DELETE |
/api/workspaces/:id/ai-voice-presets/:presetId |
Members cannot change voice settings.
Notification preferences
GET / PATCH /api/workspaces/:id/notification-preferences
Social accounts on a workspace
GET /api/workspaces/:id/social-accounts — sanitized list (no OAuth tokens). Same data as Social accounts.
Close or transfer (owner only)
| Method | Path | Body |
|---|---|---|
GET |
/api/workspaces/:id/close-impact |
— |
POST |
/api/workspaces/:id/close |
{ confirmName } must match the workspace name |
POST |
/api/workspaces/:id/transfer-ownership |
{ newOwnerUserId } |
Closing permanently removes the workspace and its data. Transfer first if others should keep access.