title: Connect Imap keywords: - connect imap - post - connect - imap # Connect Imap Connect IMAP/SMTP email account with username/password authentication. #### Query Parameters **`organization_id`** string required Organization ID #### Request Body **`email_address`** string required Email address **`password`** string required Email password **`imap_host`** string required IMAP server hostname **`imap_port`** integer optional · Defaults to `993` IMAP port (993 for SSL, 143 for STARTTLS) **`smtp_host`** string required SMTP server hostname **`smtp_port`** integer optional · Defaults to `465` SMTP port (465 for SSL, 587 for STARTTLS) **`use_ssl`** boolean optional · Defaults to `true` Use SSL/TLS connection ## Returns **`credential_id`** string Credential ID **`email_address`** string Connected email address **`message`** string Success message Example ```bash cURL curl -X POST "https://api.aitronos.com/v1/personal-connectors/connect-imap" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email_address": "your_email_address", "password": "your_password", "imap_host": "your_imap_host", "smtp_host": "your_smtp_host" }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.post( "https://api.aitronos.com/v1/personal-connectors/connect-imap", headers={"X-API-Key": api_key}, json={'email_address': 'your_email_address', 'password': 'your_password', 'imap_host': 'your_imap_host', 'smtp_host': 'your_smtp_host'} ) print(response.json()) ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const response = await fetch('https://api.aitronos.com/v1/personal-connectors/connect-imap', { method: 'POST', headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify({"email_address": "your_email_address", "password": "your_password", "imap_host": "your_imap_host", "smtp_host": "your_smtp_host"}) }); const data = await response.json(); console.log(data); ``` **Response:** ```json 200 OK { "credential_id": "cred_abc123def456", "email_address": "example_email_address", "message": "Operation completed successfully" } ``` Errors ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Missing or invalid authorization header", "type": "authentication_error", "status": 401, "trace_id": "req_abc123xyz", "timestamp": "2025-11-11T10:30:00Z", "details": {} } } ``` ```json 403 Forbidden { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "You do not have permission to access this resource.", "system_message": "Insufficient permissions for this operation", "type": "authorization_error", "status": 403, "trace_id": "req_def456uvw", "timestamp": "2025-11-11T10:30:00Z", "details": {} } } ``` ## Related Resources - [List Connectors](/docs/api-reference/connectors/introduction)