Update an Email

Updating an Email

PATCH /emails/{emailId}

Description

Updates the settings for a specific email account. The settings can include the number of emails to be sent per day, target country, and other preferences. Requires a JSON payload with the new settings values. This is a non-destructive option, meaning that omitting data does not update it.

Request

const response = await fetch(`https://partners.leadwarm.ai/api/v1/emails/${emailId}`, {
    method: "PATCH",
    headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${YOUR_API_KEY}`,
    },
    body: JSON.stringify({
        pass: "xxxx",
        sending_limit: 50,
        sending_increase: 3,
        sending_active: true,
        smtp_domain: "smtp.example.com",
        smtp_port: 587,
        smtp_tls: false,
        imap_domain: "imap.example.com",
        imap_port: 993,
        imap_tls: true,
    }),
});

Parameters

  • emailId (required): The unique identifier of the email to update settings for.
  • pass (optional): Update the password
  • sending_limit (optional): Update the sending limit. Must be between 0 and 100
  • sending_increase (optional): Update the sending increase. Must be between 0 and 5
  • sending_active (optional): Enable or disable the sending of the email
  • smtp_domain (optional): The domain for the smtp server
  • smtp_port (optional): The port of the smtp server
  • smtp_tls (optional): Whether to use TLS encryption (needed for Port 465)
  • imap_domain (optional): The domain for the imap server
  • imap_port (optional): The port of the imap server
  • imap_tls (optional): Whether to use TLS encryption (needed for Port 993)

Response

  • 200 OK: Successfully updated the settings.
  • 400 Bad Request: Required data is missing or data format is incorrect.
  • 401 Unauthorized: Authentication credentials are not provided or are invalid.
  • 404 Not Found: No email found with the provided identifier.