Skip to content

Uploads emails

Method upload.emails
Description Uploads emails
Available to Agent, Client
Required component Email tracking

Request parameters

Name Type Required Valid values Description
access_token string yes Access token used to authenticate the request.
user_id number no Unique ID of the client user on whose behalf the agent is making the request. Required for agents. To retrieve a list of client users, use the get.customer_users method.
emails array no Email messages to upload.
site_id number no CallGear site ID. Use get.sites to retrieve available sites.
session_id number no CallGear visitor session ID.
source_id number no CallGear traffic source ID.
date_time date yes Date and time when the email was received, in the client account time zone.
sender_name string no Sender name.
subject string no Email subject.
message string yes Plain-text email body.
message_html string yes HTML email body.
email_from string yes Sender email address.
email_to string yes Primary recipient email address. At least one of email_to, email_to_cc, or email_to_bcc is required.
email_to_cc array no CC recipient email addresses.
email_to_bcc array no BCC recipient email addresses.

Response parameters

Name Type Valid values Filtering Sorting Description
id number yes Unique ID of the uploaded email.

Example request

{
  "jsonrpc":"2.0",
  "id":"number",
  "method":"upload.emails",
  "params":{
    "access_token":"string",
    "user_id":"number",
    "emails":[
        {
          "date_time": "2023-02-16 00:00:00",
          "session_id": 122343,
          "source_id": -999,
          "site_id": 258,
          "sender_name": "John Smith",
          "subject": "Product inquiry",
          "message": "Please contact me.",
          "message_html": "<p>Please contact me.</p>",
          "email_from": "email_from@gmail.com",
          "email_to": "email_to@gmail.com",
          "email_to_cc": ["email_cc@gmail.com"],
          "email_to_bcc": ["email_bcc@gmail.com"]
        }
    ]
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": "number",
  "result": {
    "metadata": {
    },
    "data": [
            {
                "id": "number"
            }
        ]
  }
}

Possible errors

See the "Errors for upload methods" section.