v1

latestOpenAPI 3.1.02026-07-14159142161.9 KB
emailService

Add Email Credentials

Adds new email credentials for IMAP and SMTP access. Only accessible by authorized users.

post/email/v1/emails/credentials

Request body

emailstring email required
passwordstring required
imap_hoststring nullable
imap_portinteger nullable
smtp_hoststring nullable
smtp_portinteger nullable

Example request

{
  "email": "user@example.com",
  "password": "securepassword123",
  "imap_host": "imap.gmail.com",
  "imap_port": 993,
  "smtp_host": "smtp.gmail.com",
  "smtp_port": 587
}

Response

OK

idinteger
added_byinteger
auth_user_idinteger
imap_hoststring
imap_portinteger
smtp_hoststring nullable
smtp_portinteger nullable
emailstring
status'pending_settings' | 'first_sync' | 'connected' | 'auth_fail'
created_atinteger
updated_atinteger

Example response

{
  "id": 2,
  "added_by": 1,
  "auth_user_id": 557,
  "imap_host": "imap.gmail.com",
  "imap_port": 993,
  "smtp_host": "smtp.gmail.com",
  "smtp_port": 587,
  "email": "stark@gmail.com",
  "status": "pending_settings",
  "created_at": 1711385960,
  "updated_at": 1729099182,
  "sync_folders": [
    [
      {
        "folder_name": "INBOX",
        "path": "INBOX",
        "delimitter": "/",
        "has_children": false,
        "is_root": true,
        "is_inbox": true
      },
      {
        "folder_name": "Notes",
        "path": "Notes",
        "delimitter": "/",
        "has_children": false,
        "is_root": true
      },
      {
        "folder_name": "Drafts",
        "path": "[Gmail]/Drafts",
        "delimitter": "/",
        "has_children": false,
        "is_root": false,
        "is_draft": true
      },
      {
        "folder_name": "Sent Mail",
        "path": "[Gmail]/Sent Mail",
        "delimitter": "/",
        "has_children": false,
        "is_root": false,
        "is_sent": true
      },
      {
        "folder_name": "Spam",
        "path": "[Gmail]/Spam",
        "delimitter": "/",
        "has_children": false,
        "is_root": false,
        "is_junk": true
      },
      {
        "folder_name": "Trash",
        "path": "[Gmail]/Trash",
        "delimitter": "/",
        "has_children": false,
        "is_root": false,
        "is_trash": true
      }
    ]
  ]
}