Skip to content

Email API V3 — Developer Guide


Overview

The Email API ingests an email into the Sprinklr Platform as either a customer message or a brand message. It is an ingestion-only API — it writes email records into Sprinklr so they surface in engagement workflows. It does not send email on your behalf, and it does not read email back out.

Dev Note: This API can only be used for ingesting data into Sprinklr.

To view an ingested email, create an Engagement Dashboard with the Email column and filter on the account ID.

Email V3 exposes three operations:

OperationMethodPathoperationId
Ingest an email (URL / base64 attachments)POST/api/v3/emailEmailApiV3_ingestEmail
Ingest an email with local file attachmentsPOST/api/v3/email/uploadEmailApiV3_ingestEmailWithAttachments

The central design change from V2 is consolidation. V2 published two separate creation endpoints that differed only in how the attachment arrived:

  • POST /api/v2/email/create — JSON body, attachment supplied as a URL
  • POST /api/v2/email/generate — multipart/form-data, attachment supplied as a local file

V3 collapses the verb out of the path (POST already implies creation) and lets the attachment source drive the shape of the request rather than the path.

1.1 The email ingestion model

An ingested email is assembled from four layers. Understanding them is the fastest way to understand every field in this guide.

LayerFieldsWhat it does
RoutingaccountId / accountUserIdSelects the Sprinklr Email Account the message lands in. Without it, the message has no inbox to arrive at.
Envelopefrom, to, cc, bcc, subject, sentTimeStandard email addressing and metadata.
Contentbody, attachments[]The message payload. body supports HTML.
Classification & enrichmentbrandPost, customPropertiesDecides whether the message is inbound (customer) or outbound (brand), and attaches Sprinklr custom-field values.

from is the identity anchor. The from address acts as a unique identifier: if consecutive calls carry the same from address, every message is associated with the same sender profile. A new audience profile is created for the details supplied in from when no profile matches. This is the mechanism that threads a customer's emails into one conversation view.

1.2 Customer message vs brand message

A single field decides the direction of the message:

brandPostInterpretationto field
false or omittedCustomer message — inbound, from a customer to the brandOptional
trueBrand message — outbound, from the brand to a customerRequired — the recipient the brand sent to

brandPost defaults to false (customer message).

1.3 Addressing the email account

Every ingest call must name the Sprinklr Email Account that receives the message. This is the email address of the Email Account added on the Sprinklr Accounts page — not an arbitrary mailbox, and not the customer's address.

  • V2: ?aId={emailId}, URL-encoded
  • V3: ?accountId={id}, URL-encoded — "Replaces v2's aId — renamed for clarity and consistency"

URL-encode the value. An email address contains @, which must be encoded as %40 in a query string.


2. Base URLs and environments

All API calls are sent to the production endpoint:

https://api3.sprinklr.com/{env}/api/v3

So the email resource in production is:

https://api3.sprinklr.com/{env}/api/v3/email

Replace {env} with your assigned environment identifier.

See APIs | Sprinklr Developer Portal for the environment list mapped to your workspace.


3. Authentication and common headers

All Email API calls are authenticated with OAuth 2.0. See Developer Tools in Sprinklr for API key and secret generation, and the Authorize flow.

HeaderValuePurpose
AuthorizationBearer {{accessToken}}Authenticates the user with the server
Key{{apiKey}}Authenticates the application with the server
Content-Typeapplication/jsonDeclares the request body media type
Content-Typemultipart/form-dataDeclares the request body media type for local file upload
Acceptapplication/jsonDeclares the acceptable response type

4. Write operations

4.1 Ingest an email

POST /api/v3/email

Ingests an external inbound email as a customer or brand message, with optional attachments supplied by URL or base64-encoded content.

Query parameters

ParameterRequiredTypeDescription
accountIdRequiredStringThe email account ID within Sprinklr. URL-encoded. Replaces V2's aId — renamed for clarity and consistency.

Request body

ParameterSub-parameterRequiredTypeDescription
fromRequiredStringEmail address of the sender. Acts as a unique identifier — the same address links messages to the same sender profile.
toOptionalStringPrimary recipient email address. Required only when ingesting as a brand message.
ccOptionalArray[String]CC recipient email addresses. Changed from V2 — see the note below.
bccOptionalArray[String]BCC recipient email addresses. Changed from V2 — see the note below.
subjectRequiredStringSubject line of the email.
bodyRequiredStringBody content of the email. Supports HTML. Use <p> tags for line breaks.
brandPostOptionalBooleanIf true, the email is ingested as a brand message. Default: false (customer message).
sentTimeOptionalInteger (int64)Sent time in epoch milliseconds.
accountUserIdSee noteStringEmail account user ID. Present in EmailCreateRequestDTO; conflicts with the query-parameter accountId specified in IN-12882.
customPropertiesOptionalObjectMap of custom-field key → array of string values. Keys are Sprinklr custom-field names in _c_<id> form.
attachmentsOptionalArray[Object]Attachment objects. Schema: ExternalMailAttachment.
fileNameRequiredStringThe name of the file attachment.
contentTypeRequiredStringThe MIME/asset type of the file attachment. See §6.
urlConditionalStringThe URL where the attachment can be accessed. Use for web-hosted attachments.
base64EncodedContentConditionalStringThe base64-encoded content of the file attachment. New in V3 — no V2 equivalent.

attachments provide url or base64EncodedContent. "Attachments: provide url or base64EncodedContent. For local file uploads use the multipart variant of this endpoint." The two fields are alternatives, not companions.

Line breaks in body

body accepts HTML. To render line breaks, wrap each line in a paragraph tag.

<p class="export-block__parent">Testing</p><p class="export-block__parent">Email</p><p class="export-block__parent">API</p><p class="export-block__parent">With Line Breaks</p>

Request — ingest as a customer message

curl --location 'https://api3.sprinklr.com/{env}/api/v3/email?accountId=support%40yourbrand.com' \
--header 'Authorization: Bearer {{accessToken}}' \
--header 'Key: {{apiKey}}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
  "from": "customer@example.com",
  "cc": ["team1@example.com"],
  "bcc": ["archive@example.com"],
  "subject": "Test Email Query Thread",
  "body": "<p class=\"export-block__parent\">My order has not arrived.</p><p class=\"export-block__parent\">Order #10432.</p>",
  "brandPost": false,
  "attachments": [
    {
      "fileName": "receipt",
      "contentType": "SPREADSHEET",
      "url": "https://files.example.com/400002/bf8fcd8bf0e8-99344174.xlsx"
    }
  ],
  "customProperties": {
    "_c_5fc0cb96b0a31e0d4535f447": ["Value1", "Value2"],
    "_c_5fcb618ed75d24677df0fd22": ["1"],
    "_c_619696a27d40de0ce801f801": ["textField"],
    "_c_619697007d40de0ce8020268": ["1635791400000"]
  }
}'

Request — ingest as a brand message

The only structural difference is brandPost: true and the now-required to:

curl --location 'https://api3.sprinklr.com/{env}/api/v3/email?accountId=support%40yourbrand.com' \
--header 'Authorization: Bearer {{accessToken}}' \
--header 'Key: {{apiKey}}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
  "from": "support@yourbrand.com",
  "to": "customer@example.com",
  "cc": ["team1@example.com"],
  "subject": "Re: Test Email Query Thread",
  "brandPost": true,
  "body": "<p class=\"export-block__parent\">Thanks for reaching out — your replacement has shipped.</p>",
  "sentTime": 1635791400000,
  "attachments": [
    {
      "fileName": "shipping-label",
      "contentType": "PDF",
      "url": "https://files.example.com/400002/label-99344174.pdf"
    }
  ]
}'

Response

200 OK
SUCCESS

4.2 Ingest an email with local file attachments

POST /api/v3/email/upload

Ingests an email where attachments are local files sent as multipart/form-data. This is the V3 successor to V2's POST /api/v2/email/generate.

Query parameters

ParameterRequiredTypeDescription
accountIdRequiredStringEmail account user id.

Form-data fields

Carried forward from the V2 /email/generate contract. The OpenAPI document does not declare a requestBody for this operation, so the field list below is sourced from the V2 Developer Portal page and IN-12882.

Form-data fieldRequiredTypeDescription
fromRequiredStringEmail address of the sender.
subjectRequiredStringSubject line of the email.
bodyRequiredStringBody content of the email.
fileOptionalFileEmail attachment, up to 100 MB. Multiple attachments are supported — repeat the file part.

Supported local attachment types: pdf, excel, mp3, mp4, doc, txt, html, image, csv, zip.

Request

curl --location --request POST 'https://api3.sprinklr.com/{env}/api/v3/email/upload?accountUserId=support%40yourbrand.com' \
--header 'Authorization: Bearer {{accessToken}}' \
--header 'Key: {{apiKey}}' \
--form 'from=customer@example.com' \
--form 'subject=Screenshot of the error' \
--form 'body=Yeah! test it with attachment' \
--form 'file=@/Users/abc/Desktop/screenshot.png'

Response

200 OK
SUCCESS

5. V2 → V3 migration

The following are the three structural changes:

  1. Two endpoints consolidated into one. V2 had POST /email/create (URL attachment, JSON body) and POST /email/generate (local file attachment, form-data). V3 uses a single POST /email; the server infers the attachment source from whether url or file is present in the attachment object — the same pattern as media upload single vs bulk. (See the §1 conflict box — the OpenAPI document still shows two paths.)
  2. Verb removed from path. /email/create and /email/generate → /email. POST already implies creation.
  3. aId renamed to accountId. ?aId={id} → ?accountId={id}. A cryptic abbreviation replaced with a self-documenting name consistent with V3 naming conventions.

6. Supported attachment content types

Values for attachments[].contentType on POST /api/v3/email..

contentTypeTypical use
IMAGEPNG, JPEG, GIF screenshots and photos
VIDEOMP4 and other video attachments
AUDIOMP3 and other audio attachments
DOCWord-processor documents
DOCUMENTGeneric documents
PDFPDF files
SPREADSHEETXLSX / XLS spreadsheets
CSVComma-separated values
HTMLHTML files
PRESENTATIONSlide decks
PSDPhotoshop documents
PSBLarge-format Photoshop documents
ZIPArchives
BINARYGeneric binary content
FONTFont files
SUBTITLESubtitle / caption tracks

For local file uploads via POST /api/v3/email/upload, the following file types are supported: pdf, excel, mp3, mp4, doc, txt, html, image, csv, zip. Maximum 100 MB per file. Multiple attachments are supported.


7. Use cases

Ingest inbound customer mail from a legacy mailbox

You run a support mailbox outside Sprinklr and want every inbound message to appear in Sprinklr's engagement workflow.

POST /api/v3/email with brandPost: false (or omitted), from set to the customer's address, and accountId set to the Sprinklr Email Account. The customer's audience profile is created or matched automatically from from.

Mirror outbound brand replies for a complete thread

Ingesting only inbound mail produces a one-sided conversation. Mirror the agent's replies too:

POST /api/v3/email with brandPost: true, from set to the brand address, and to set to the customer. Because from anchors the profile, the inbound and outbound messages thread into the same conversation view.

Backfill historical email during a platform migration

Set sentTime to the original epoch-millisecond timestamp on every record so the imported history sorts correctly rather than collapsing onto the import date. This field does not exist in V2 — it is one of the concrete reasons to migrate a backfill job to V3.

Pair it with a correlation ID in customProperties so you can reconcile the import against your source system.

Ingest a large screenshot an agent captured locally

A 40 MB screen recording exists only on the agent's machine. Use the multipart endpoint:

POST /api/v3/email/upload with --form 'file=@/path/to/recording.mp4'. The 100 MB per-file ceiling applies.

Preserve line breaks in a plain-text source

Your source system emits plain text with \n. Sprinklr renders body as HTML, so newlines collapse. Transform each line before sending:

Line one\nLine two

becomes

<p class="export-block__parent">Line one</p><p class="export-block__parent">Line two</p>

Route to different mailboxes per brand or region

accountId selects the receiving Email Account. Drive it from configuration — one entry per brand, region, or product line — so the same ingestion code serves every mailbox and adding a mailbox is a config change, not a deployment.


All JSON payloads in this guide are illustrative examples derived from the supplied specifications and published references. They are not real customer data and are not guaranteed production responses. All credentials are placeholders ({{accessToken}}, {{apiKey}}) and must never be committed or logged.