Create, update, and delete email folders programmatically
POST /api/settings/folders
{
"name": "Projects",
"parentId": null
}Response:
{
"ok": true,
"data": {
"id": "folder_123",
"name": "Projects",
"parentId": null,
"createdAt": "2024-01-15T10:00:00Z"
}
}PATCH /api/settings/folders/[id]
{
"name": "Work Projects"
}DELETE /api/settings/folders/[id]
Deletes the folder and optionally moves its contents to another folder.
GET /api/settings/folders
{
"ok": true,
"data": [
{
"id": "folder_123",
"name": "Projects",
"parentId": null,
"messageCount": 42
},
{
"id": "folder_456",
"name": "Archive",
"parentId": null,
"messageCount": 150
}
]
}400 - Invalid folder name or structure401 - Unauthorized404 - Folder not found409 - Folder name already exists