Send Email
Get Email Delivery Details
Sends transactional email using Marketing Cloud's triggered send functionality. In order to use this service, configure a triggered send definition in Email Studio. This documentation applies only to triggered sends that are managed in Email Studio. To use the transactional messaging REST API, review Transactional Messaging API.
| Name | Type | Description | |
|---|---|---|---|
| ObjectID | GUID | Required | ID of the entry event send definition that comes from the response when creating a TriggeredSendDefinition. Either this or the external key is required. |
| key | string | Required | External key of the entry event send definition. Either this or the ObjectID is required. |
| Name | Type | Description | |
|---|---|---|---|
| From | object | Object containing email address and name of sender. | |
| From.Address | string | Email address that will show as the sender. | |
| From.Name | string | Name of the sender. | |
| To | object | Required | Object requiring email address and optional subscriber parameters passed in at send time. |
| To.Address | string | Required | Email address of the message recipient. |
| To.SubscriberKey | string | Required | Unique identifier defined for the message recipient. |
| To.ContactAttributes | object | The profile attributes setup determines the attributes that can be passed in. | |
| To.ContactAttributes.SubscriberAttributes | object | Name and value pairs for subscriber attributes defined for the message. | |
| Options | object | Object used to specify asynchronous or synchronous. If not specified, defaults to asynchronous. | |
| Options.RequestType | string | Valid values ASYNC and SYNC. Default value when not defined is ASYNC. Determines if the request is processed asychronously. |
Example Asynchronous Request Using Send ID
1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /messaging/v1/messageDefinitionSends/dfa5ab87-1b0f-e211-b71b-9c8e9920e9fc/send
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7 "From": {
8 "Address": "code@exacttarget.com",
9 "Name": "Code@"
10 },
11 "To": {
12 "Address": "example@example.com",
13 "SubscriberKey": "example@example.com",
14 "ContactAttributes": {
15 "SubscriberAttributes": {
16 "Region": "West",
17 "City": "Indianapolis",
18 "State": "IN"
19 }
20 }
21 },
22 "Options": {
23 "RequestType": "ASYNC"
24 }
25}Example Asynchronous Request Using Customer Key
1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /messaging/v1/messageDefinitionSends/key:external_key/send
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7 "From": {
8 "Address": "code@exacttarget.com",
9 "Name": "Code@"
10 },
11 "To": {
12 "Address": "example@example.com",
13 "SubscriberKey": "example@example.com",
14 "ContactAttributes": {
15 "SubscriberAttributes": {
16 "Region": "West",
17 "City": "Indianapolis",
18 "State": "IN"
19 }
20 }
21 },
22 "Options": {
23 "RequestType": "ASYNC"
24 }
25}Example Synchronous Request Using Send ID
1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /messaging/v1/messageDefinitionSends/dfa5ab87-1b0f-e211-b71b-9c8e9920e9fc/send
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7 "From": {
8 "Address": "code@exacttarget.com",
9 "Name": "Code@"
10 },
11 "To": {
12 "Address": "example@example.com",
13 "SubscriberKey": "example@example.com",
14 "ContactAttributes": {
15 "SubscriberAttributes": {
16 "Region": "West",
17 "City": "Indianapolis",
18 "State": "IN"
19 }
20 }
21 },
22 "Options": {
23 "RequestType": "SYNC"
24 }
25}Example Synchronous Request Using Customer Key
1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /messaging/v1/messageDefinitionSends/key:cust_key/send
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7 "From": {
8 "Address": "code@exacttarget.com",
9 "Name": "Code@"
10 },
11 "To": {
12 "Address": "example@example.com",
13 "SubscriberKey": "example@example.com",
14 "ContactAttributes": {
15 "SubscriberAttributes": {
16 "Region": "West",
17 "City": "Indianapolis",
18 "State": "IN"
19 }
20 }
21 },
22 "Options": {
23 "RequestType": "SYNC"
24 }
25}Example Response (Asynchronous)
Queued status for an asynchronous request means that the request is accepted for processing. Refer to Get Email Delivery Details for the final message request status.
1HTTP/1.1 202 Accepted
2{
3 "requestId": "e2ddb203-ea53-4843-b2d4-9f8c0c862913",
4 "responses": [ {
5 "recipientSendId": "e2ddb203-ea53-4843-b2d4-9f8c0c862913",
6 "hasErrors": false,
7 "messages": ["Queued"]
8 }]
9}Error Response (Synchronous)
1HTTP/1.1 202 Accepted
2{
3 "requestId": "21977680-17e1-469d-9162-bd3f20149cbb",
4 "responses": [ {
5 "recipientSendId": "21977680-17e1-469d-9162-bd3f20149cbb",
6 "hasErrors": true,
7 "messageErrors": [ {
8 "messageErrorCode": 180008,
9 "messageErrorStatus": "Unable to queue Triggered Send request. There are no valid subscribers."
10 }]
11 }]
12}Error Response
1HTTP/1.1 202 Accepted
2{
3 "recipientSendId": "",
4 "hasErrors": true,
5 "messages": ["InvalidOrMissingToAddress"]
6}