Workflow

Send Gmail Email with Attachments

Sends an email using available Gmail accounts with optional file attachments. The system automatically selects the best Gmail account based on daily send limits and downloads attachments from provided URLs.

post/api/v1/workflow/agent/send-gmail

Request

  • Base URL: https://api.kolect.com
  • URL: https://api.kolect.com/api/v1/workflow/agent/send-gmail
  • Auth: HTTP bearer

Request body

receiver_addressstring email required

Email address of the recipient

subjectstring required

Email subject line

bodystring required

Email body content (supports HTML and markdown)

sender_namestring

Display name for the sender

attachmentsstring[]

Array of URLs to download and attach as files

Example request

{
  "receiver_address": "recipient@example.com",
  "subject": "Important Document Attached",
  "body": "Please find the attached documents for your review.",
  "sender_name": "Max Zou From Kolect",
  "attachments": [
    "https://example.com/document.pdf",
    "https://example.com/image.jpg",
    "https://example.com/spreadsheet.xlsx"
  ]
}

Response

Email processing completed (success or failure)

send_addressstring email

Gmail account used to send the email (null if failed)

receiver_addressstring email

Email address of the recipient

subjectstring

Email subject line

status'success' | 'failed'

Status of the email sending operation

messagestring

Detailed message about the operation result

time_elapsednumber

Time taken to process the request in milliseconds

attachments_processednumber

Number of attachments successfully downloaded and attached

messageIdstring

Gmail message ID (only present on success)

threadIdstring

Gmail thread ID (only present on success)

Example response

{
  "send_address": "sender@gmail.com",
  "receiver_address": "recipient@example.com",
  "subject": "Important Document Attached",
  "status": "success",
  "message": "Email sent successfully",
  "time_elapsed": 2500,
  "attachments_processed": 2,
  "messageId": "1a2b3c4d5e6f7g8h",
  "threadId": "9i8h7g6f5e4d3c2b"
}

Changes

No recorded changes to this operation across all 1 revision of this API.