Skip to main content

OAuth integrations

Initiate OAuth

Start the OAuth flow for a third-party provider.
GET /api/integrations/{provider}/auth
Authentication: Required Path parameters:
ParameterTypeDescription
providerstringProvider name: gmail, outlook, github, google
Response 200 OK:
{
  "authUrl": "https://provider.com/oauth/authorize?..."
}

OAuth callback

Handles the OAuth callback from the third-party provider.
GET /api/integrations/{provider}/callback
Processes the authorization code exchange and stores tokens.

Disconnect

Remove a third-party integration.
POST /api/integrations/{provider}/disconnect
Authentication: Required CSRF: Required Response 200 OK:
{
  "success": true
}

Refresh tokens

Manually refresh OAuth tokens for a provider.
POST /api/integrations/{provider}/refresh
Authentication: Required CSRF: Required Response 200 OK:
{
  "success": true,
  "expiresAt": "2026-03-04T13:00:00Z"
}

IMAP email

For non-Gmail email providers, PassAgent supports IMAP connections.

Connect IMAP

POST /api/integrations/imap/connect
Authentication: Required CSRF: Required Request body:
{
  "host": "imap.example.com",
  "port": 993,
  "username": "user@example.com",
  "password": "app-password",
  "tls": true
}
Response 200 OK:
{
  "success": true,
  "email": "user@example.com"
}

Disconnect IMAP

POST /api/integrations/imap/disconnect
Authentication: Required CSRF: Required Response 200 OK:
{
  "success": true
}

List connected integrations

GET /api/user-integrations
Authentication: Required Response 200 OK:
{
  "integrations": [
    {
      "provider": "gmail",
      "email": "user@gmail.com",
      "connectedAt": "2026-02-01T10:00:00Z",
      "status": "active"
    },
    {
      "provider": "imap",
      "email": "user@outlook.com",
      "connectedAt": "2026-02-15T14:00:00Z",
      "status": "active"
    }
  ]
}

Password import

Import credentials from other password managers. See the passwords import endpoint for full details.

Supported formats

FormatSourceFile type
1password1Password exportCSV
lastpassLastPass exportCSV
bitwardenBitwarden exportJSON or CSV
chromeChrome browser exportCSV
csvGeneric CSVCSV with headers: name, url, username, password
jsonGeneric JSONJSON array of credential objects